@cardenelabs/cdl 0.31.0 → 0.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -1
- package/README.md +40 -0
- package/dist/index.cjs +353 -64
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +353 -64
- package/dist/index.js.map +1 -1
- package/dist/react.cjs +353 -64
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +1 -1
- package/dist/react.d.ts +1 -1
- package/dist/react.js +353 -64
- package/dist/react.js.map +1 -1
- package/dist/{render-D6wVFGfI.d.cts → render-DjnLKv2Q.d.cts} +15 -1
- package/dist/{render-D6wVFGfI.d.ts → render-DjnLKv2Q.d.ts} +15 -1
- package/package.json +1 -1
- package/src/index.ts +1 -0
- package/src/kinds/chart-line.tsx +11 -0
- package/src/kinds/chart-pie.tsx +451 -48
- package/src/render/template-fields.ts +2 -0
- package/src/types.ts +15 -0
|
@@ -411,6 +411,18 @@ type CdlNode = {
|
|
|
411
411
|
chartValueRise?: boolean;
|
|
412
412
|
/** chart-line を描き切った後、粒で経路をなぞって点を順に出す */
|
|
413
413
|
chartTrace?: boolean;
|
|
414
|
+
/**
|
|
415
|
+
* chart-pie の見せ方 (cdl#684)。 書かない図は `ring` と同じ。
|
|
416
|
+
*
|
|
417
|
+
* - `ring` ... 輪を扇に切り分け、外へ引き出し線を伸ばして名札を置く
|
|
418
|
+
* - `arcs` ... 系列ごとに 1 本の弧を置き、割合を角度ではなく弧の長さで読む
|
|
419
|
+
* - `table` ... 輪を左に寄せ、右に 名前 / 割合 / 実数 の 3 列の表を組む
|
|
420
|
+
*
|
|
421
|
+
* 型の外の値は `ring` として描く = 見せ方が決まらないより、既定の形が出る方がよい。
|
|
422
|
+
*
|
|
423
|
+
* `previous` (cdl#680) が効くのは `ring` だけ。 他の形は内側の輪を描かない。
|
|
424
|
+
*/
|
|
425
|
+
chartPieForm?: ChartPieForm;
|
|
414
426
|
/**
|
|
415
427
|
* gantt-timeline 専用の task payload。 task 全件を 1 node に格納し、
|
|
416
428
|
* kinds/gantt.tsx が縦軸 task lane + 横軸日付 rect bar で SVG 描画する。
|
|
@@ -464,6 +476,8 @@ type BoundNumber = number | string;
|
|
|
464
476
|
*/
|
|
465
477
|
type BoundEnum<T extends string> = T | (string & {});
|
|
466
478
|
/** Chart 系 kind の 1 datum payload。 label + value + optional tone (color) */
|
|
479
|
+
/** chart-pie の見せ方 (cdl#684)。 SSOT は `kinds/chart-pie.tsx` */
|
|
480
|
+
type ChartPieForm = "ring" | "arcs" | "table";
|
|
467
481
|
type ChartDatumPayload = {
|
|
468
482
|
label: string;
|
|
469
483
|
/** 棒 / 折れ線 / 扇の大きさ。 `{signal}` で状態に追随する */
|
|
@@ -2869,4 +2883,4 @@ type CdlDiagramViewProps = {
|
|
|
2869
2883
|
};
|
|
2870
2884
|
declare function CdlDiagramView({ diagram, laid: laidProp, hideHeader, hideMiniPhaseIndicator, focusPhaseId, debug, emitGeometryWarn, headingLevel, interactiveHandlers }: CdlDiagramViewProps): JSX.Element;
|
|
2871
2885
|
|
|
2872
|
-
export {
|
|
2886
|
+
export { createScrollProgressSignals as $, EDGE_REVEALS as A, type BBox as B, type CdlDiagram as C, EDGE_REVEAL_DEFAULT as D, type EdgeStyle as E, EDGE_STYLES as F, type EdgeReveal as G, type InteractiveSignalsAccessor as H, type InteractiveHandlerMap as I, type JourneyEmotion as J, type LaidLane as K, type LaidDiagram as L, NODE_KINDS as M, type NodeKind as N, type ScrollProgressHandle as O, TONES as P, type QuadrantKey as Q, type RowMark as R, type Signal as S, type Tone as T, computeEventBindingKey as U, computeFormulaKey as V, computeInputSignalKey as W, computeScrollTriggerKey as X, computed as Y, createInteractiveSignalsAccessor as Z, createScrollProgressHandle as _, type CdlInput as a, hasInteractivePrimitives as a0, sequenceBoardMetrics as a1, sequenceStepId as a2, signal as a3, type CdlLane as b, type CdlNode as c, type Side as d, type EdgeRole as e, type EdgeHead as f, type EdgeHeadFill as g, type CdlState as h, type CdlEventTarget as i, type Computed as j, type CdlDerivedValue as k, type CdlScrollTrigger as l, type CdlDiagramViewProps as m, type LaidEdge as n, type LaidNode as o, type CdlEdge as p, CdlDiagramView as q, type CdlEventBinding as r, type CdlEventKind as s, type CdlFormula as t, type CdlPhase as u, type ChartPieForm as v, EDGE_HEADS as w, EDGE_HEAD_DEFAULT as x, EDGE_HEAD_FILLS as y, EDGE_HEAD_FILL_DEFAULT as z };
|
|
@@ -411,6 +411,18 @@ type CdlNode = {
|
|
|
411
411
|
chartValueRise?: boolean;
|
|
412
412
|
/** chart-line を描き切った後、粒で経路をなぞって点を順に出す */
|
|
413
413
|
chartTrace?: boolean;
|
|
414
|
+
/**
|
|
415
|
+
* chart-pie の見せ方 (cdl#684)。 書かない図は `ring` と同じ。
|
|
416
|
+
*
|
|
417
|
+
* - `ring` ... 輪を扇に切り分け、外へ引き出し線を伸ばして名札を置く
|
|
418
|
+
* - `arcs` ... 系列ごとに 1 本の弧を置き、割合を角度ではなく弧の長さで読む
|
|
419
|
+
* - `table` ... 輪を左に寄せ、右に 名前 / 割合 / 実数 の 3 列の表を組む
|
|
420
|
+
*
|
|
421
|
+
* 型の外の値は `ring` として描く = 見せ方が決まらないより、既定の形が出る方がよい。
|
|
422
|
+
*
|
|
423
|
+
* `previous` (cdl#680) が効くのは `ring` だけ。 他の形は内側の輪を描かない。
|
|
424
|
+
*/
|
|
425
|
+
chartPieForm?: ChartPieForm;
|
|
414
426
|
/**
|
|
415
427
|
* gantt-timeline 専用の task payload。 task 全件を 1 node に格納し、
|
|
416
428
|
* kinds/gantt.tsx が縦軸 task lane + 横軸日付 rect bar で SVG 描画する。
|
|
@@ -464,6 +476,8 @@ type BoundNumber = number | string;
|
|
|
464
476
|
*/
|
|
465
477
|
type BoundEnum<T extends string> = T | (string & {});
|
|
466
478
|
/** Chart 系 kind の 1 datum payload。 label + value + optional tone (color) */
|
|
479
|
+
/** chart-pie の見せ方 (cdl#684)。 SSOT は `kinds/chart-pie.tsx` */
|
|
480
|
+
type ChartPieForm = "ring" | "arcs" | "table";
|
|
467
481
|
type ChartDatumPayload = {
|
|
468
482
|
label: string;
|
|
469
483
|
/** 棒 / 折れ線 / 扇の大きさ。 `{signal}` で状態に追随する */
|
|
@@ -2869,4 +2883,4 @@ type CdlDiagramViewProps = {
|
|
|
2869
2883
|
};
|
|
2870
2884
|
declare function CdlDiagramView({ diagram, laid: laidProp, hideHeader, hideMiniPhaseIndicator, focusPhaseId, debug, emitGeometryWarn, headingLevel, interactiveHandlers }: CdlDiagramViewProps): JSX.Element;
|
|
2871
2885
|
|
|
2872
|
-
export {
|
|
2886
|
+
export { createScrollProgressSignals as $, EDGE_REVEALS as A, type BBox as B, type CdlDiagram as C, EDGE_REVEAL_DEFAULT as D, type EdgeStyle as E, EDGE_STYLES as F, type EdgeReveal as G, type InteractiveSignalsAccessor as H, type InteractiveHandlerMap as I, type JourneyEmotion as J, type LaidLane as K, type LaidDiagram as L, NODE_KINDS as M, type NodeKind as N, type ScrollProgressHandle as O, TONES as P, type QuadrantKey as Q, type RowMark as R, type Signal as S, type Tone as T, computeEventBindingKey as U, computeFormulaKey as V, computeInputSignalKey as W, computeScrollTriggerKey as X, computed as Y, createInteractiveSignalsAccessor as Z, createScrollProgressHandle as _, type CdlInput as a, hasInteractivePrimitives as a0, sequenceBoardMetrics as a1, sequenceStepId as a2, signal as a3, type CdlLane as b, type CdlNode as c, type Side as d, type EdgeRole as e, type EdgeHead as f, type EdgeHeadFill as g, type CdlState as h, type CdlEventTarget as i, type Computed as j, type CdlDerivedValue as k, type CdlScrollTrigger as l, type CdlDiagramViewProps as m, type LaidEdge as n, type LaidNode as o, type CdlEdge as p, CdlDiagramView as q, type CdlEventBinding as r, type CdlEventKind as s, type CdlFormula as t, type CdlPhase as u, type ChartPieForm as v, EDGE_HEADS as w, EDGE_HEAD_DEFAULT as x, EDGE_HEAD_FILLS as y, EDGE_HEAD_FILL_DEFAULT as z };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cardenelabs/cdl",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.32.0",
|
|
4
4
|
"description": "CDL (Chainome Diagram Language). Mermaid-like declarative DSL that compiles to animated SVG diagrams. Built for blockchain / Solidity flows, generic enough for sequence / flow / state / ER / topology diagrams.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "cardene777",
|
package/src/index.ts
CHANGED
package/src/kinds/chart-line.tsx
CHANGED
|
@@ -141,6 +141,17 @@ export function ChartLineNode({
|
|
|
141
141
|
|
|
142
142
|
return (
|
|
143
143
|
<g transform={`translate(${x0} ${y0})`}>
|
|
144
|
+
<rect
|
|
145
|
+
data-cdl-role="node-body"
|
|
146
|
+
x={0}
|
|
147
|
+
y={0}
|
|
148
|
+
width={node.w}
|
|
149
|
+
height={node.h}
|
|
150
|
+
rx={16}
|
|
151
|
+
fill="var(--cdl-node-fill, #ffffff)"
|
|
152
|
+
stroke="var(--cdl-divider, #d4d4d8)"
|
|
153
|
+
strokeWidth={active ? 1.5 : 1}
|
|
154
|
+
/>
|
|
144
155
|
{gridTicks.map((t, i) => (
|
|
145
156
|
<g key={`grid-${i}`}>
|
|
146
157
|
<line
|