@cardenelabs/cdl 0.5.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/LICENSE +21 -0
- package/README.md +343 -0
- package/SPEC.md +374 -0
- package/dist/index.cjs +28085 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +3415 -0
- package/dist/index.d.ts +3415 -0
- package/dist/index.js +27962 -0
- package/dist/index.js.map +1 -0
- package/dist/react.cjs +23043 -0
- package/dist/react.cjs.map +1 -0
- package/dist/react.d.cts +2 -0
- package/dist/react.d.ts +2 -0
- package/dist/react.js +23041 -0
- package/dist/react.js.map +1 -0
- package/dist/render-C78lIXeC.d.cts +2449 -0
- package/dist/render-C78lIXeC.d.ts +2449 -0
- package/examples/quick-start.md +88 -0
- package/package.json +79 -0
- package/src/anim/core/easing.ts +77 -0
- package/src/anim/core/timeline.ts +335 -0
- package/src/anim/core/types.ts +42 -0
- package/src/anim/index.ts +20 -0
- package/src/anim/react/index.ts +3 -0
- package/src/anim/react/useReducedMotion.ts +27 -0
- package/src/anim/react/useTimeline.ts +48 -0
- package/src/assert-never.ts +16 -0
- package/src/author-intent-verify.ts +587 -0
- package/src/builder.ts +3740 -0
- package/src/compile.ts +12 -0
- package/src/dom-verify-core.ts +121 -0
- package/src/dom-verify-types.ts +21 -0
- package/src/dom-verify.ts +948 -0
- package/src/event-handler/index.ts +184 -0
- package/src/formula/ast.ts +46 -0
- package/src/formula/evaluator.ts +163 -0
- package/src/formula/formula-computeds.ts +83 -0
- package/src/formula/index.ts +5 -0
- package/src/formula/parser.ts +399 -0
- package/src/index.ts +284 -0
- package/src/input-signals.ts +74 -0
- package/src/kinds/actor.tsx +79 -0
- package/src/kinds/card.tsx +61 -0
- package/src/kinds/chart-bar.tsx +121 -0
- package/src/kinds/chart-line.tsx +163 -0
- package/src/kinds/chart-pie.tsx +107 -0
- package/src/kinds/compact-title.ts +164 -0
- package/src/kinds/dyn-shape.tsx +394 -0
- package/src/kinds/event.tsx +70 -0
- package/src/kinds/function.tsx +53 -0
- package/src/kinds/funnel.tsx +122 -0
- package/src/kinds/gantt.tsx +193 -0
- package/src/kinds/generic.tsx +368 -0
- package/src/kinds/mind-map.tsx +367 -0
- package/src/kinds/mind-radial.tsx +209 -0
- package/src/kinds/node-tone.ts +18 -0
- package/src/kinds/quadrant.tsx +164 -0
- package/src/kinds/row-align.ts +179 -0
- package/src/kinds/shape-basement.tsx +683 -0
- package/src/kinds/shape-blockchain.tsx +750 -0
- package/src/kinds/shape-commerce.tsx +553 -0
- package/src/kinds/shape-finance.tsx +706 -0
- package/src/kinds/shape-hardware.tsx +862 -0
- package/src/kinds/shape-people.tsx +439 -0
- package/src/kinds/shape-region.tsx +383 -0
- package/src/kinds/shape-software.tsx +859 -0
- package/src/kinds/storage.tsx +180 -0
- package/src/kinds/text-width.ts +73 -0
- package/src/kinds/tree.tsx +275 -0
- package/src/kinds/user-journey.tsx +240 -0
- package/src/label-text.ts +71 -0
- package/src/layout/clearance-constants.ts +47 -0
- package/src/layout/collisions.ts +2078 -0
- package/src/layout/edges.ts +2498 -0
- package/src/layout/footer-shape.ts +97 -0
- package/src/layout/geometry.ts +135 -0
- package/src/layout/label-shift.ts +28 -0
- package/src/layout/lanes.ts +328 -0
- package/src/layout/nodes.ts +190 -0
- package/src/layout/predict-bbox.ts +76 -0
- package/src/layout/px-projection.ts +176 -0
- package/src/layout/spec.ts +872 -0
- package/src/layout/text-width.ts +133 -0
- package/src/layout/tokens.ts +181 -0
- package/src/layout/viewbox.ts +47 -0
- package/src/layout-with-validation.ts +175 -0
- package/src/layout.ts +381 -0
- package/src/presets.ts +2108 -0
- package/src/reactive/batch.ts +48 -0
- package/src/reactive/computed.ts +85 -0
- package/src/reactive/effect.ts +145 -0
- package/src/reactive/index.ts +6 -0
- package/src/reactive/internal.ts +109 -0
- package/src/reactive/signal.ts +113 -0
- package/src/render/edges.tsx +318 -0
- package/src/render/header.tsx +146 -0
- package/src/render/interactive-panel.tsx +9620 -0
- package/src/render/nodes.tsx +319 -0
- package/src/render/stage.tsx +377 -0
- package/src/render/tone.ts +64 -0
- package/src/render/utils.ts +238 -0
- package/src/render.tsx +221 -0
- package/src/scroll-trigger/index.ts +109 -0
- package/src/scroll-trigger/progress.ts +49 -0
- package/src/thumbnail.tsx +114 -0
- package/src/types.ts +2371 -0
- package/src/validate.ts +268 -0
- package/src/visual-validate.ts +4381 -0
|
@@ -0,0 +1,2449 @@
|
|
|
1
|
+
import { JSX } from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* mutable な reactive value。 `.value` getter / setter で読み書き、
|
|
5
|
+
* 読み取り時に current subscriber (computed / effect) を dep として自動登録する。
|
|
6
|
+
*
|
|
7
|
+
* `.peek()` は依存追跡なしで現 value を読み取る (effect 内で「値は見たいが再実行 trigger にしたくない」 用途)。
|
|
8
|
+
* `.subscribe(fn)` は effect 経路を通さず手動で notification listener を登録する
|
|
9
|
+
* (framework 統合 / 外部 stream との bridge 用途、 dispose function を返す)。
|
|
10
|
+
*/
|
|
11
|
+
interface Signal<T> {
|
|
12
|
+
get value(): T;
|
|
13
|
+
set value(v: T);
|
|
14
|
+
peek(): T;
|
|
15
|
+
subscribe(fn: (v: T) => void): () => void;
|
|
16
|
+
}
|
|
17
|
+
declare function signal<T>(initial: T): Signal<T>;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* dependency 変化時に自動で再計算される derived value。 lazy evaluation で、
|
|
21
|
+
* `.value` が read されるまでは fn を評価しない。 memoize して dep が変化しない限り再計算しない。
|
|
22
|
+
*
|
|
23
|
+
* computed は subscriber (dep 変化を受け取る) かつ dependency (下流の computed / effect の dep になる)
|
|
24
|
+
* の両側面を持つ = graph の中間 node。
|
|
25
|
+
*/
|
|
26
|
+
interface Computed<T> {
|
|
27
|
+
get value(): T;
|
|
28
|
+
peek(): T;
|
|
29
|
+
}
|
|
30
|
+
declare function computed<T>(fn: () => T): Computed<T>;
|
|
31
|
+
|
|
32
|
+
/** 意味付きの色の名前。 検査・描画・test はこの 1 つの列を出所にする。 */
|
|
33
|
+
declare const TONES: readonly ["accent", "teal", "success", "error", "warning", "info"];
|
|
34
|
+
type Tone = (typeof TONES)[number];
|
|
35
|
+
/** 描画できる箱の種類。 検査・記法一覧・型はこの 1 つの列を出所にする。 */
|
|
36
|
+
declare const NODE_KINDS: readonly ["dyn-rect", "dyn-circle", "dyn-arc", "dyn-wave", "dyn-polygon", "actor", "function", "storage", "event", "card", "person", "user-group", "admin", "developer", "external-user", "database", "cache", "queue", "message-bus", "cloud", "cdn", "service", "api", "frontend", "backend", "webhook", "microservice", "signer", "oracle", "merkle-tree", "decision", "chart-pie", "chart-line", "chart-bar", "gantt-timeline", "mind-map", "mind-radial", "funnel-stages", "quadrant-matrix", "tree-hierarchy", "journey-map", "shape-file", "shape-folder", "shape-cloud", "shape-cylinder", "shape-hexagon", "shape-diamond", "shape-stack", "shape-person", "shape-window", "shape-terminal", "shape-code-block", "shape-kanban-card", "shape-message-bubble", "shape-gear", "shape-server-rack", "shape-network-node", "shape-mobile-device", "shape-iot-sensor", "shape-robot-arm", "shape-satellite", "shape-smart-contract", "shape-blockchain-block", "shape-rpc-node", "shape-wallet", "shape-nft", "shape-token", "shape-blockchain", "shape-bitcoin-chain", "shape-ethereum-chain", "shape-blockchain-node", "shape-bank", "shape-trust-bank", "shape-payment-provider", "shape-credit-card", "shape-brokerage", "shape-exchange", "shape-atm", "shape-website", "shape-storefront", "shape-warehouse", "shape-online-shop", "shape-cdn-edge", "shape-api-gateway", "shape-auditor", "shape-regulator", "shape-notary", "shape-lawyer", "shape-trader", "shape-customer-service"];
|
|
37
|
+
type NodeKind = (typeof NODE_KINDS)[number];
|
|
38
|
+
type Side = "top" | "right" | "bottom" | "left";
|
|
39
|
+
/**
|
|
40
|
+
* edge の visual style variant。
|
|
41
|
+
* - "solid" (default) ... 実線 + 矢頭、 inactive は dashed grey
|
|
42
|
+
* - "dotted-flow" ... 点線 + active phase で粒子が path 沿いに流れる。
|
|
43
|
+
* path が経由 node を貫通する場合は自動で粒子が node 中心を貫通する動きに切替。
|
|
44
|
+
*/
|
|
45
|
+
type EdgeStyle = "solid" | "dotted-flow";
|
|
46
|
+
type CdlLane = {
|
|
47
|
+
id: string;
|
|
48
|
+
/** lane の x 座標 (optional、 未指定なら engine が前 lane 右端 + gap で auto 計算) */
|
|
49
|
+
x?: number;
|
|
50
|
+
/**
|
|
51
|
+
* lane の幅 (world 単位)。
|
|
52
|
+
*
|
|
53
|
+
* engine が `max(指定値, 中の node の最大幅 + 左右余白 × 2)` まで広げる。
|
|
54
|
+
*
|
|
55
|
+
* 左右余白は最低 25 で、 隣の lane を詰めて置くほど大きくなる。 隣り合う node の間隔は
|
|
56
|
+
* 「lane 間隔 + 左右余白 × 2」 で決まるため、 lane を詰めた分を余白で埋め合わせて
|
|
57
|
+
* node 同士が近づきすぎないようにしている (目標 = node 同士の clearance policy + 余裕)。
|
|
58
|
+
* lane を十分に離して置いた図では最低値の 25 が使われ、 幅は `node 最大幅 + 50` になる。
|
|
59
|
+
*
|
|
60
|
+
* `role: "overlay"` の lane が絡む対はこの埋め合わせの対象外 (重ねることが目的の配置を
|
|
61
|
+
* engine が引き剥がさないため)。
|
|
62
|
+
*
|
|
63
|
+
* それ以外の lane 対は重なっていても埋め合わせるが、 重なり幅そのものは埋めない
|
|
64
|
+
* (重なり 0 として扱う)。 重なり幅を足し込むと lane が青天井に太るため、 余白の上限は
|
|
65
|
+
* 「間隔 0 で並べた時に必要な値」 で頭打ちになる。
|
|
66
|
+
*
|
|
67
|
+
* この上限があるため、 node 同士の間隔の保証には境界がある。
|
|
68
|
+
*
|
|
69
|
+
* - 離して置いた lane (間隔 0 以上) ... 目標値を必ず満たす
|
|
70
|
+
* - 重ねて置いた lane ... 目標値から重なり幅を引いた値になる。 重なりが「目標値 - 下限値」
|
|
71
|
+
* を超えると下限を割り、 engine は直さず `visualValidate` の clearance が報告する
|
|
72
|
+
* (engine が直すには lane を動かすしかなく、 著者が置いた位置を engine が動かすことになるため)
|
|
73
|
+
*
|
|
74
|
+
* `posX` と `posY` を両方指定した lane はこの auto 拡張の対象外で、 `posW` があれば
|
|
75
|
+
* そちら、 無ければこの値が使われる。 座標を固定した lane は上記の埋め合わせにも
|
|
76
|
+
* 参加しないため、 その隣で間隔を満たすかは著者の配置次第になる。
|
|
77
|
+
*/
|
|
78
|
+
width: number;
|
|
79
|
+
label?: string;
|
|
80
|
+
contain?: boolean;
|
|
81
|
+
/**
|
|
82
|
+
* この lane を何のために置いているか (既定 = `"column"`)。
|
|
83
|
+
*
|
|
84
|
+
* - `"column"` ... 他の lane と横に並べる。 隣と近づきすぎないよう engine が幅で間隔を調整する
|
|
85
|
+
* - `"overlay"` ... 他の lane に重ねることが目的。 group を囲む枠や gantt の timeline 帯など。
|
|
86
|
+
* 重ねるのが意図なので **間隔の調整対象から外れる** (自身の幅を隣との間隔のために広げず、
|
|
87
|
+
* 隣の lane にとっても「隣接する lane」 として数えられない)
|
|
88
|
+
*
|
|
89
|
+
* `"overlay"` でも幅と位置が完全に固定される訳ではない。 中に node があれば収まる幅までは
|
|
90
|
+
* 広がり、 左側の lane が広がった分は位置が右へ動く (帯だけ取り残されると重ねている対象から
|
|
91
|
+
* ずれるため)。 固定したい場合は `posX` / `posY` を使う。
|
|
92
|
+
*
|
|
93
|
+
* 未指定は `"column"` として扱う。 `"overlay"` を付け忘れた lane が他と重なっていても
|
|
94
|
+
* engine は幅を青天井には広げない (重なり幅は埋めず、 間隔 0 相当までで頭打ちにする) ため、
|
|
95
|
+
* 付け忘れが図の崩壊にはつながらない。
|
|
96
|
+
*/
|
|
97
|
+
role?: "column" | "overlay";
|
|
98
|
+
/** UML sequence diagram の lifeline (= lane の中央 x に縦の点線を描画) */
|
|
99
|
+
lifeline?: boolean;
|
|
100
|
+
/**
|
|
101
|
+
* 明示指定した座標。 `posX` と `posY` の **両方**が揃った lane は「置いた位置に置く」
|
|
102
|
+
* 扱いになる。 片方だけでは何も変わらない。
|
|
103
|
+
*
|
|
104
|
+
* 位置の自動計算 (前 lane の右端からの送り) も、 中の node や edge label に合わせた幅の
|
|
105
|
+
* 自動拡張も走らない。 いずれも「指定した位置と幅から動かさない」 ための扱い。
|
|
106
|
+
*/
|
|
107
|
+
posX?: number;
|
|
108
|
+
posY?: number;
|
|
109
|
+
/**
|
|
110
|
+
* 明示指定した大きさ。 `posX` と `posY` が揃っている時だけ効く。
|
|
111
|
+
*
|
|
112
|
+
* 大きさだけを変えたい場合は `width` を使う。
|
|
113
|
+
*/
|
|
114
|
+
posW?: number;
|
|
115
|
+
posH?: number;
|
|
116
|
+
};
|
|
117
|
+
type CdlNode = {
|
|
118
|
+
id: string;
|
|
119
|
+
lane: string;
|
|
120
|
+
stack: number;
|
|
121
|
+
kind: NodeKind;
|
|
122
|
+
title: string;
|
|
123
|
+
eyebrow?: string;
|
|
124
|
+
subtitle?: string;
|
|
125
|
+
/** mono 数値表示用、 `{stateId}` を含めれば state 値で動的置換 */
|
|
126
|
+
value?: string;
|
|
127
|
+
/** kind=storage 時の行 (各 mono、 state 参照可) */
|
|
128
|
+
rows?: string[];
|
|
129
|
+
/** width override (default は NodeKind 別 NODE_SIZE)、 catalog thumbnail 用に縮小可 */
|
|
130
|
+
w?: number;
|
|
131
|
+
/** height override */
|
|
132
|
+
h?: number;
|
|
133
|
+
/**
|
|
134
|
+
* 明示指定した座標。 `posX` と `posY` の **両方**が揃った node は「置いた位置に置く」
|
|
135
|
+
* 扱いになる。 片方だけでは何も変わらない。
|
|
136
|
+
*
|
|
137
|
+
* 効果は位置計算だけではない。 stack 順の配置を skip して指定値を使うことに加えて、
|
|
138
|
+
* 重なり解消で動かされなくなり、 lane 中心との整合を見る検証の対象からも外れる。
|
|
139
|
+
* いずれも「指定した位置から動かさない」 ための扱い。
|
|
140
|
+
*/
|
|
141
|
+
posX?: number;
|
|
142
|
+
posY?: number;
|
|
143
|
+
/**
|
|
144
|
+
* 明示指定した大きさ。 `posX` と `posY` が揃っている時だけ効く。
|
|
145
|
+
*
|
|
146
|
+
* 採用されるのは `posX !== undefined && posY !== undefined` の時だけで、 行高さの計算には
|
|
147
|
+
* 参加しない。 大きさだけを変えたい場合は `w` / `h` を使う。
|
|
148
|
+
*/
|
|
149
|
+
posW?: number;
|
|
150
|
+
posH?: number;
|
|
151
|
+
/**
|
|
152
|
+
* node の主色。 未指定なら kind ごとの既定色。
|
|
153
|
+
*
|
|
154
|
+
* 変わるのは kind の既定色を使って描かれる部分で、 枠線 / eyebrow の文字色 / icon /
|
|
155
|
+
* 強調表示中の行の値。 本文の文字色と背景は変わらない。
|
|
156
|
+
*
|
|
157
|
+
* 効くのは `actor` / `function` / `storage` / `event` / `card` と `person` 以降の汎用 kind の
|
|
158
|
+
* 計 26 種。 それ以外は自前の配色を持つため指定しても変わらず、 検査も通す。 効く kind の
|
|
159
|
+
* 一覧は `test/node-styling.test.tsx` が実装から計算した集合と突き合わせている。
|
|
160
|
+
*
|
|
161
|
+
* 既定色と同じ名前を明示指定しても色が変わる kind がある (既定色の hex が `render/tone.ts`
|
|
162
|
+
* の値とずれているため)。
|
|
163
|
+
*/
|
|
164
|
+
tone?: Tone;
|
|
165
|
+
/**
|
|
166
|
+
* visual binding: width の render-time template (CAR visual-binding foundation)。
|
|
167
|
+
* `.node('bar', { w: 40, wBind: '{barW}' })` の様に書くと、 signal 'barW' の値で width が
|
|
168
|
+
* リアルタイム変化する。 template は `{signal-id}` or interpolate 式、 解決失敗時は layout の
|
|
169
|
+
* w にフォールバック。 layout は wBind を無視して static w を使う (edge routing は静的 layout
|
|
170
|
+
* を維持、 visual は signal に追随、 の分離設計)。
|
|
171
|
+
*/
|
|
172
|
+
wBind?: string;
|
|
173
|
+
/** visual binding: height の render-time template (wBind と同 semantics) */
|
|
174
|
+
hBind?: string;
|
|
175
|
+
/**
|
|
176
|
+
* node opacity (0..1)、 numeric 直接指定 or `{signal-id}` template で signal 追随可。
|
|
177
|
+
* fade-in / attention 変化 / conditional 表示に使う。 未指定なら 1 (完全表示)。
|
|
178
|
+
*/
|
|
179
|
+
opacity?: number | string;
|
|
180
|
+
/**
|
|
181
|
+
* dynamic shape spec (CAR: shape primitive)。 kind が dyn-rect / dyn-circle / dyn-arc /
|
|
182
|
+
* dyn-wave / dyn-polygon の時、 内部 fill / size / angle 等を signal 値で駆動する。
|
|
183
|
+
* fixed template (chart-pie / gantt 等) ではなく汎用 container として組合せ可能な直交
|
|
184
|
+
* primitive。 shape 経路の詳細 field は CdlDynShape 型を参照。
|
|
185
|
+
*/
|
|
186
|
+
shape?: CdlDynShape;
|
|
187
|
+
/**
|
|
188
|
+
* conditional visibility = truthy 判定で表示切替、 signal template で dynamic 制御可能。
|
|
189
|
+
* "1" / "true" / 非 "0" / 非 "false" / 非空文字を truthy と判定。
|
|
190
|
+
*/
|
|
191
|
+
visibleIf?: string;
|
|
192
|
+
/**
|
|
193
|
+
* render-time X offset (pixel、 numeric or `{signal}` template)、 layout 計算後の cx を
|
|
194
|
+
* offsetX だけ shift して SVG 描画する。 edges / auto-layout は shift 前の base position を
|
|
195
|
+
* 使うため、 radial / free-form position 表示専用 (network 図 hub-and-spoke で spoke node を
|
|
196
|
+
* 円周上に見せる等)。 signal template で reactive 移動も可能。
|
|
197
|
+
*/
|
|
198
|
+
renderOffsetX?: number | string;
|
|
199
|
+
/** render-time Y offset (pixel or `{signal}` template)、 renderOffsetX と同 semantics */
|
|
200
|
+
renderOffsetY?: number | string;
|
|
201
|
+
/**
|
|
202
|
+
* Chart 系 kind (chart-pie / chart-line / chart-bar) 専用の datum payload。
|
|
203
|
+
* 数値 chart の全 datum を 1 node に格納し、 kinds/chart-*.tsx が自己完結で SVG 描画する。
|
|
204
|
+
*/
|
|
205
|
+
chartData?: ChartDatumPayload[];
|
|
206
|
+
/**
|
|
207
|
+
* gantt-timeline 専用の task payload。 task 全件を 1 node に格納し、
|
|
208
|
+
* kinds/gantt.tsx が縦軸 task lane + 横軸日付 rect bar で SVG 描画する。
|
|
209
|
+
*/
|
|
210
|
+
ganttData?: GanttTaskPayload[];
|
|
211
|
+
/**
|
|
212
|
+
* mind-map / mind-radial 専用の branch payload。 tree 構造を 1 node に格納し、
|
|
213
|
+
* kinds/mind-map.tsx / mind-radial.tsx が中心 + 放射で SVG 描画する。
|
|
214
|
+
*/
|
|
215
|
+
mindData?: MindBranchPayload;
|
|
216
|
+
/** funnel-stages 専用の stage 配列 payload、 逆三角形 stage 描画に使う */
|
|
217
|
+
funnelData?: FunnelStagePayload[];
|
|
218
|
+
/** quadrant-matrix 専用の 2 軸 + item 配列 payload、 十字軸 + 4 象限描画に使う */
|
|
219
|
+
quadrantData?: QuadrantPayload;
|
|
220
|
+
/** tree-hierarchy 専用の tree node payload、 縦階層 hierarchical 描画に使う */
|
|
221
|
+
treeData?: TreeNodePayload[];
|
|
222
|
+
/** journey-map 専用の step 配列 payload、 感情曲線 + touchpoint 描画に使う */
|
|
223
|
+
journeyData?: JourneyStepPayload[];
|
|
224
|
+
};
|
|
225
|
+
/** Chart 系 kind の 1 datum payload。 label + value + optional tone (color) */
|
|
226
|
+
type ChartDatumPayload = {
|
|
227
|
+
label: string;
|
|
228
|
+
value: number;
|
|
229
|
+
tone?: Tone;
|
|
230
|
+
};
|
|
231
|
+
/** gantt-timeline kind の 1 task payload。 label + start/end + owner + dependsOn */
|
|
232
|
+
type GanttTaskPayload = {
|
|
233
|
+
id: string;
|
|
234
|
+
title: string;
|
|
235
|
+
/** 開始 index (0-based 相対位置) */
|
|
236
|
+
startIdx: number;
|
|
237
|
+
/** 終了 index (0-based 相対位置、 startIdx と同じなら 1 cell 幅) */
|
|
238
|
+
endIdx: number;
|
|
239
|
+
/** 開始 label (例 "Q1" / "2026-01") */
|
|
240
|
+
startLabel: string;
|
|
241
|
+
/** 終了 label (例 "Q2" / "2026-03") */
|
|
242
|
+
endLabel: string;
|
|
243
|
+
owner?: string;
|
|
244
|
+
dependsOn?: string;
|
|
245
|
+
tone?: Tone;
|
|
246
|
+
};
|
|
247
|
+
/** mind-map / mind-radial kind の branch tree payload。 rootId + branch 配列 */
|
|
248
|
+
type MindBranchPayload = {
|
|
249
|
+
rootId: string;
|
|
250
|
+
rootTitle: string;
|
|
251
|
+
branches: MindBranchNode[];
|
|
252
|
+
};
|
|
253
|
+
/** 1 branch node = id + title + parent + optional tone + subtitle */
|
|
254
|
+
type MindBranchNode = {
|
|
255
|
+
id: string;
|
|
256
|
+
title: string;
|
|
257
|
+
parent: string;
|
|
258
|
+
tone?: Tone;
|
|
259
|
+
subtitle?: string;
|
|
260
|
+
};
|
|
261
|
+
/** funnel-stages kind の 1 stage payload。 title + count + optional subtitle */
|
|
262
|
+
type FunnelStagePayload = {
|
|
263
|
+
id: string;
|
|
264
|
+
title: string;
|
|
265
|
+
count: number;
|
|
266
|
+
subtitle?: string;
|
|
267
|
+
};
|
|
268
|
+
/** quadrant-matrix kind の 2 軸 + item 配列 payload */
|
|
269
|
+
type QuadrantPayload = {
|
|
270
|
+
xAxis: {
|
|
271
|
+
left: string;
|
|
272
|
+
right: string;
|
|
273
|
+
};
|
|
274
|
+
yAxis: {
|
|
275
|
+
bottom: string;
|
|
276
|
+
top: string;
|
|
277
|
+
};
|
|
278
|
+
quadrantLabels: {
|
|
279
|
+
topLeft: string;
|
|
280
|
+
topRight: string;
|
|
281
|
+
bottomLeft: string;
|
|
282
|
+
bottomRight: string;
|
|
283
|
+
};
|
|
284
|
+
items: QuadrantItemPayload[];
|
|
285
|
+
};
|
|
286
|
+
/** quadrant-matrix の 1 item payload */
|
|
287
|
+
type QuadrantItemPayload = {
|
|
288
|
+
id: string;
|
|
289
|
+
title: string;
|
|
290
|
+
quadrant: "topLeft" | "topRight" | "bottomLeft" | "bottomRight";
|
|
291
|
+
subtitle?: string;
|
|
292
|
+
};
|
|
293
|
+
/** tree-hierarchy kind の 1 node payload */
|
|
294
|
+
type TreeNodePayload = {
|
|
295
|
+
id: string;
|
|
296
|
+
title: string;
|
|
297
|
+
parent?: string;
|
|
298
|
+
subtitle?: string;
|
|
299
|
+
eyebrow?: string;
|
|
300
|
+
};
|
|
301
|
+
/** journey-map kind の 1 step payload */
|
|
302
|
+
type JourneyStepPayload = {
|
|
303
|
+
id: string;
|
|
304
|
+
title: string;
|
|
305
|
+
/** emotion 5 段階 (delighted / happy / neutral / frustrated / angry) */
|
|
306
|
+
emotion: "delighted" | "happy" | "neutral" | "frustrated" | "angry";
|
|
307
|
+
touchpoint?: string;
|
|
308
|
+
opportunity?: string;
|
|
309
|
+
};
|
|
310
|
+
type CdlEdge = {
|
|
311
|
+
id: string;
|
|
312
|
+
from: string;
|
|
313
|
+
to: string;
|
|
314
|
+
label: string;
|
|
315
|
+
sub?: string;
|
|
316
|
+
tone: Tone;
|
|
317
|
+
side?: Side;
|
|
318
|
+
/** visual style、 default "solid" */
|
|
319
|
+
style?: EdgeStyle;
|
|
320
|
+
/**
|
|
321
|
+
* FSM transition の guard 条件 (例 "if validated")。
|
|
322
|
+
* stateMachine preset では sub に併合される、 text-dsl v0.5 では guard 単独で渡せる。
|
|
323
|
+
*/
|
|
324
|
+
guard?: string;
|
|
325
|
+
/**
|
|
326
|
+
* ER 関係 cardinality を author が宣言した文字列 (例 "1:N" / "N:M" / "1..*")。
|
|
327
|
+
* compileEr 経路で edge label に "(1:N)" 形式で併記、 他 preset では透過。
|
|
328
|
+
*/
|
|
329
|
+
cardinality?: string;
|
|
330
|
+
/** label の x 方向 fine offset (default 0)、 著者が細かく位置調整するための逃げ道 */
|
|
331
|
+
labelOffsetX?: number;
|
|
332
|
+
/** label の y 方向 fine offset (default 0、 + で下、 - で上) */
|
|
333
|
+
labelOffsetY?: number;
|
|
334
|
+
/** routing mode (default "default" = 自動 routing、 "back-detour" = back transition 用の上方 detour 強制) */
|
|
335
|
+
routing?: "default" | "back-detour";
|
|
336
|
+
/**
|
|
337
|
+
* CAR-549 SSOT ... label を edge path 上に「被せる」 か「離す」 かの制御 flag。
|
|
338
|
+
* default (false or undefined) = LABEL_INIT_CLEARANCE (34 world、 CAR-630 で 26 → 34 復帰) 離して配置。
|
|
339
|
+
* true = label center を edge path 上に重ねる (flowchart の true/false condition label 等、
|
|
340
|
+
* edge の semantic を強調するため path と label を重ね表示する)。
|
|
341
|
+
*/
|
|
342
|
+
overlay?: boolean;
|
|
343
|
+
/**
|
|
344
|
+
* signal binding: edge stroke-width の render-time template。
|
|
345
|
+
* `.edge('a', 'b', { widthBind: '{flow}' })` の様に書くと signal で edge 太さが動く。
|
|
346
|
+
* fallback = active 2 / inactive 1.5、 signal 経由の template で number 解釈。
|
|
347
|
+
*/
|
|
348
|
+
widthBind?: string;
|
|
349
|
+
/**
|
|
350
|
+
* signal binding: edge stroke color の template、 signal で色が変わる。
|
|
351
|
+
* fallback = tone 別 color。 hex or css color 文字列を signal に持たせて置換。
|
|
352
|
+
*/
|
|
353
|
+
strokeBind?: string;
|
|
354
|
+
/**
|
|
355
|
+
* signal binding: edge stroke-dashoffset の template (0..N)、 SVG stroke-dasharray + dashoffset で流れる線を表現。
|
|
356
|
+
* timeline signal と組合わせて chain の流れを animate 可能。
|
|
357
|
+
*/
|
|
358
|
+
dashOffsetBind?: string;
|
|
359
|
+
/**
|
|
360
|
+
* canvas pivot 新 spec (dragon canvas pivot spec §layout-role-conversion)。
|
|
361
|
+
* posX1 / posY1 = edge の from 端 point の絶対座標、 posX2 / posY2 = edge の to 端 point の絶対座標。
|
|
362
|
+
* 両 point が set 済なら CDL の layoutEdges 経路が該当 edge の routing 再計算を skip し、
|
|
363
|
+
* 直線 path (posX1, posY1) → (posX2, posY2) を最終 path として採用する。
|
|
364
|
+
* 未指定なら従来通り orthogonal L 字 routing + label placement が計算 (catalog 100+ backward compat 保証)。
|
|
365
|
+
*/
|
|
366
|
+
posX1?: number;
|
|
367
|
+
posY1?: number;
|
|
368
|
+
posX2?: number;
|
|
369
|
+
posY2?: number;
|
|
370
|
+
};
|
|
371
|
+
type CdlState = {
|
|
372
|
+
id: string;
|
|
373
|
+
initial: number | string;
|
|
374
|
+
};
|
|
375
|
+
/**
|
|
376
|
+
* interactive input widget spec (v0.5+、 CAR #243)。
|
|
377
|
+
*
|
|
378
|
+
* consumer app 側 (React / plain HTML 等) が widget を描画、 signal 経由で cdl の SVG 内 text / rect / path
|
|
379
|
+
* と bind する data model。 cdl 自身は widget を描画せず、 metadata としてのみ持つ。
|
|
380
|
+
*
|
|
381
|
+
* `id` は signal 名として使われ、 consumer が `createInputSignals(diagram).<id>` で対応する Signal を取得する。
|
|
382
|
+
* discriminated union で kind ごとに options / defaultValue の型を厳密化する。
|
|
383
|
+
*/
|
|
384
|
+
type CdlInput = {
|
|
385
|
+
id: string;
|
|
386
|
+
kind: "slider";
|
|
387
|
+
/** 最小値 (inclusive) */
|
|
388
|
+
min: number;
|
|
389
|
+
/** 最大値 (inclusive) */
|
|
390
|
+
max: number;
|
|
391
|
+
/** 刻み幅 (default 1) */
|
|
392
|
+
step?: number;
|
|
393
|
+
defaultValue: number;
|
|
394
|
+
label?: string;
|
|
395
|
+
} | {
|
|
396
|
+
id: string;
|
|
397
|
+
kind: "number";
|
|
398
|
+
/** 最小値 (省略時は制約なし) */
|
|
399
|
+
min?: number;
|
|
400
|
+
/** 最大値 (省略時は制約なし) */
|
|
401
|
+
max?: number;
|
|
402
|
+
defaultValue: number;
|
|
403
|
+
label?: string;
|
|
404
|
+
} | {
|
|
405
|
+
id: string;
|
|
406
|
+
kind: "dropdown";
|
|
407
|
+
/** 選択肢一覧 (非空必須、 defaultValue はこの中の 1 つ) */
|
|
408
|
+
options: readonly string[];
|
|
409
|
+
defaultValue: string;
|
|
410
|
+
label?: string;
|
|
411
|
+
} | {
|
|
412
|
+
id: string;
|
|
413
|
+
kind: "toggle";
|
|
414
|
+
defaultValue: boolean;
|
|
415
|
+
label?: string;
|
|
416
|
+
}
|
|
417
|
+
/**
|
|
418
|
+
* XY pad = 2 軸 slider、 `.input.xypad(id)` は 実は 2 個の signal (id_x / id_y) を生成する
|
|
419
|
+
* 仕組みではなく、 単一 signal に `{x, y}` object を保持する経路を採用 (widget が 2D point 選択)。
|
|
420
|
+
* 但し template で使う場合の複雑度を下げるため、 実装上は id と id_y の 2 signal ペアで管理する。
|
|
421
|
+
*/
|
|
422
|
+
| {
|
|
423
|
+
id: string;
|
|
424
|
+
kind: "xypad";
|
|
425
|
+
xMin: number;
|
|
426
|
+
xMax: number;
|
|
427
|
+
yMin: number;
|
|
428
|
+
yMax: number;
|
|
429
|
+
defaultX: number;
|
|
430
|
+
defaultY: number;
|
|
431
|
+
label?: string;
|
|
432
|
+
}
|
|
433
|
+
/** stepper = +/- ボタンで integer を増減、 min / max / step を持つ */
|
|
434
|
+
| {
|
|
435
|
+
id: string;
|
|
436
|
+
kind: "stepper";
|
|
437
|
+
min?: number;
|
|
438
|
+
max?: number;
|
|
439
|
+
step?: number;
|
|
440
|
+
defaultValue: number;
|
|
441
|
+
label?: string;
|
|
442
|
+
}
|
|
443
|
+
/** radio group = 排他選択、 dropdown と同じ options / defaultValue だが視覚は横並び button */
|
|
444
|
+
| {
|
|
445
|
+
id: string;
|
|
446
|
+
kind: "radio";
|
|
447
|
+
options: readonly string[];
|
|
448
|
+
defaultValue: string;
|
|
449
|
+
label?: string;
|
|
450
|
+
}
|
|
451
|
+
/** color picker = hex color 文字列 (#RRGGBB) を signal に保持 */
|
|
452
|
+
| {
|
|
453
|
+
id: string;
|
|
454
|
+
kind: "color";
|
|
455
|
+
defaultValue: string;
|
|
456
|
+
label?: string;
|
|
457
|
+
}
|
|
458
|
+
/** range slider = 2 thumb で min/max を独立指定、 単一 signal に "lo,hi" で格納 */
|
|
459
|
+
| {
|
|
460
|
+
id: string;
|
|
461
|
+
kind: "range";
|
|
462
|
+
min: number;
|
|
463
|
+
max: number;
|
|
464
|
+
step?: number;
|
|
465
|
+
defaultLo: number;
|
|
466
|
+
defaultHi: number;
|
|
467
|
+
label?: string;
|
|
468
|
+
}
|
|
469
|
+
/** multi-select = 複数 option を chip 選択、 signal に "a,b,c" (comma sep) で格納 */
|
|
470
|
+
| {
|
|
471
|
+
id: string;
|
|
472
|
+
kind: "multi-select";
|
|
473
|
+
options: readonly string[];
|
|
474
|
+
defaultValues: readonly string[];
|
|
475
|
+
label?: string;
|
|
476
|
+
}
|
|
477
|
+
/** tabs = 排他 tab UI、 dropdown と同 semantics だが視覚は tab bar */
|
|
478
|
+
| {
|
|
479
|
+
id: string;
|
|
480
|
+
kind: "tabs";
|
|
481
|
+
options: readonly string[];
|
|
482
|
+
defaultValue: string;
|
|
483
|
+
label?: string;
|
|
484
|
+
}
|
|
485
|
+
/** date-time = HTML native datetime-local、 ISO string を signal に */
|
|
486
|
+
| {
|
|
487
|
+
id: string;
|
|
488
|
+
kind: "datetime";
|
|
489
|
+
defaultValue: string;
|
|
490
|
+
label?: string;
|
|
491
|
+
}
|
|
492
|
+
/** text input = 短い文字列入力、 signal に string を反映 */
|
|
493
|
+
| {
|
|
494
|
+
id: string;
|
|
495
|
+
kind: "text";
|
|
496
|
+
defaultValue: string;
|
|
497
|
+
placeholder?: string;
|
|
498
|
+
maxLength?: number;
|
|
499
|
+
label?: string;
|
|
500
|
+
}
|
|
501
|
+
/**
|
|
502
|
+
* timeline = 時間軸を signal 化、 0..1 の progress を保持 + play / pause / seek /
|
|
503
|
+
* speed 制御 UI を提供。 phase 制御と独立、 汎用的な animation clock。
|
|
504
|
+
*/
|
|
505
|
+
| {
|
|
506
|
+
id: string;
|
|
507
|
+
kind: "timeline";
|
|
508
|
+
/** loop 1 周期の ms (default 3000) */
|
|
509
|
+
duration: number;
|
|
510
|
+
/** 起動時 autoplay (default true) */
|
|
511
|
+
autoplay?: boolean;
|
|
512
|
+
/** loop するか (default true)、 false なら 1 周で停止 */
|
|
513
|
+
loop?: boolean;
|
|
514
|
+
/** 選択可能な speed (default [0.5, 1, 2, 4]) */
|
|
515
|
+
speeds?: readonly number[];
|
|
516
|
+
/** 初期 speed index (default speeds の 1 index、 即 1x) */
|
|
517
|
+
defaultSpeedIdx?: number;
|
|
518
|
+
label?: string;
|
|
519
|
+
};
|
|
520
|
+
/**
|
|
521
|
+
* dynamic shape spec (CAR: shape primitive)。 SVG stage 内に描画される汎用 container、
|
|
522
|
+
* signal 値で fill / radius / angle 等が動く。 chart-* / gantt-* のような fixed template
|
|
523
|
+
* ではなく orthogonal に組合せ可能な primitive、 EIP1559 相当の「rect 3 個縦並びで各 fill
|
|
524
|
+
* が signal 追随」 や「circle の radius が signal で伸縮」 のような表現を可能にする。
|
|
525
|
+
*/
|
|
526
|
+
type CdlDynShape = {
|
|
527
|
+
kind: "rect";
|
|
528
|
+
/** 内部を埋める値 (0..fillMax)、 signal template `{id}` or numeric */
|
|
529
|
+
source: string | number;
|
|
530
|
+
/** source の最大値 (fill が 100% になる値) */
|
|
531
|
+
fillMax: number;
|
|
532
|
+
/** fill 方向 = 'up' (下から上)、 'down' (上から下)、 'left' (右から左)、 'right' (左から右) */
|
|
533
|
+
orient?: "up" | "down" | "left" | "right";
|
|
534
|
+
/** fill 色、 template で signal 追随可 */
|
|
535
|
+
fill?: string;
|
|
536
|
+
/** 枠線色 */
|
|
537
|
+
stroke?: string;
|
|
538
|
+
/** 角丸 radius (px) */
|
|
539
|
+
radius?: number;
|
|
540
|
+
} | {
|
|
541
|
+
kind: "circle";
|
|
542
|
+
/** 半径 (px) を signal 追随、 numeric or template */
|
|
543
|
+
radius?: number | string;
|
|
544
|
+
/** 中央から放射状 fill (0..1) を signal 追随、 progress ring 用 */
|
|
545
|
+
fillProgress?: number | string;
|
|
546
|
+
fill?: string;
|
|
547
|
+
stroke?: string;
|
|
548
|
+
} | {
|
|
549
|
+
kind: "arc";
|
|
550
|
+
/** 内側 / 外側 radius (default: h/2 と w/2 の小さい方) */
|
|
551
|
+
innerRadius?: number;
|
|
552
|
+
outerRadius?: number;
|
|
553
|
+
/** 開始角度 (度、 3 時方向を 0 とする、 時計回り + 、 default -90) */
|
|
554
|
+
startAngle?: number;
|
|
555
|
+
/** 現在の角度を signal で駆動、 numeric or template */
|
|
556
|
+
angle: number | string;
|
|
557
|
+
/** 最大 sweep (360 で full circle) */
|
|
558
|
+
sweepMax?: number;
|
|
559
|
+
fill?: string;
|
|
560
|
+
stroke?: string;
|
|
561
|
+
} | {
|
|
562
|
+
kind: "wave";
|
|
563
|
+
/** 現在の水位 (0..amplitude)、 signal 追随 */
|
|
564
|
+
level: number | string;
|
|
565
|
+
/** 最大水位 (level = amplitude で 100% fill) */
|
|
566
|
+
amplitude: number;
|
|
567
|
+
/** 波の周波数 (山の数、 default 2) */
|
|
568
|
+
frequency?: number;
|
|
569
|
+
/** 波の振幅 (px、 default 6) */
|
|
570
|
+
waveHeight?: number;
|
|
571
|
+
fill?: string;
|
|
572
|
+
stroke?: string;
|
|
573
|
+
} | {
|
|
574
|
+
kind: "polygon";
|
|
575
|
+
/** 頂点数 (3-12、 3=triangle / 4=square / 5=pentagon / 6=hexagon 等) */
|
|
576
|
+
sides: number;
|
|
577
|
+
/** 半径 = 中心から頂点までの距離、 signal 追随可 */
|
|
578
|
+
radius?: number | string;
|
|
579
|
+
/** 回転角度 (度)、 signal 追随可 */
|
|
580
|
+
rotation?: number | string;
|
|
581
|
+
fill?: string;
|
|
582
|
+
stroke?: string;
|
|
583
|
+
};
|
|
584
|
+
/**
|
|
585
|
+
* readout widget spec (visual displays)、 signal / state 値を可視化する widget primitive
|
|
586
|
+
* (CAR: interactive widget 拡充)。 input が「値を入れる」 のに対し、 readout は「値を見せる」。
|
|
587
|
+
*/
|
|
588
|
+
type CdlReadout = {
|
|
589
|
+
id: string;
|
|
590
|
+
kind: "bar";
|
|
591
|
+
source: string;
|
|
592
|
+
min: number;
|
|
593
|
+
max: number;
|
|
594
|
+
color?: string;
|
|
595
|
+
label?: string;
|
|
596
|
+
} | {
|
|
597
|
+
id: string;
|
|
598
|
+
kind: "gauge";
|
|
599
|
+
source: string;
|
|
600
|
+
min: number;
|
|
601
|
+
max: number;
|
|
602
|
+
color?: string;
|
|
603
|
+
label?: string;
|
|
604
|
+
} | {
|
|
605
|
+
id: string;
|
|
606
|
+
kind: "stat";
|
|
607
|
+
source: string;
|
|
608
|
+
caption?: string;
|
|
609
|
+
unit?: string;
|
|
610
|
+
label?: string;
|
|
611
|
+
} | {
|
|
612
|
+
id: string;
|
|
613
|
+
kind: "sparkline";
|
|
614
|
+
source: string;
|
|
615
|
+
history?: number;
|
|
616
|
+
color?: string;
|
|
617
|
+
label?: string;
|
|
618
|
+
}
|
|
619
|
+
/** countup = signal 値変化を animation で補間表示、 「50 → 80 に 800ms でカウントアップ」 */
|
|
620
|
+
| {
|
|
621
|
+
id: string;
|
|
622
|
+
kind: "countup";
|
|
623
|
+
source: string;
|
|
624
|
+
/** アニメ時間 ms (default 600) */
|
|
625
|
+
durationMs?: number;
|
|
626
|
+
/** 小数点桁数 (default 0) */
|
|
627
|
+
decimals?: number;
|
|
628
|
+
/** 単位 (例 "%", "ms") */
|
|
629
|
+
unit?: string;
|
|
630
|
+
label?: string;
|
|
631
|
+
}
|
|
632
|
+
/** typewriter = string signal を 1 字ずつ表示、 explanatory reveal 用 */
|
|
633
|
+
| {
|
|
634
|
+
id: string;
|
|
635
|
+
kind: "typewriter";
|
|
636
|
+
source: string;
|
|
637
|
+
/** 1 字あたり ms (default 40) */
|
|
638
|
+
charMs?: number;
|
|
639
|
+
label?: string;
|
|
640
|
+
}
|
|
641
|
+
/** delta = 前回値との差分を ↑/↓ + 数値で表示、 KPI 変化に */
|
|
642
|
+
| {
|
|
643
|
+
id: string;
|
|
644
|
+
kind: "delta";
|
|
645
|
+
source: string;
|
|
646
|
+
/** 小数点桁数 (default 1) */
|
|
647
|
+
decimals?: number;
|
|
648
|
+
unit?: string;
|
|
649
|
+
label?: string;
|
|
650
|
+
}
|
|
651
|
+
/** percent-ring = 円形の環状 progress、 gauge より compact */
|
|
652
|
+
| {
|
|
653
|
+
id: string;
|
|
654
|
+
kind: "percent-ring";
|
|
655
|
+
source: string;
|
|
656
|
+
/** source の最大値 (progress = source / max) */
|
|
657
|
+
max: number;
|
|
658
|
+
color?: string;
|
|
659
|
+
label?: string;
|
|
660
|
+
}
|
|
661
|
+
/** heat cell = signal 値を色 gradient で表現、 heatmap や status pill に */
|
|
662
|
+
| {
|
|
663
|
+
id: string;
|
|
664
|
+
kind: "heat-cell";
|
|
665
|
+
source: string;
|
|
666
|
+
min: number;
|
|
667
|
+
max: number;
|
|
668
|
+
/** 色 gradient (低い → 高い)、 default ["#e0e6ef", "#2d6a8f"] */
|
|
669
|
+
colors?: readonly string[];
|
|
670
|
+
label?: string;
|
|
671
|
+
}
|
|
672
|
+
/** badge = 数値をそのまま pill 表示、 stat より小さい */
|
|
673
|
+
| {
|
|
674
|
+
id: string;
|
|
675
|
+
kind: "badge";
|
|
676
|
+
source: string;
|
|
677
|
+
/** color source (default source と同じ)、 別 signal で色を切替可能 */
|
|
678
|
+
colorSource?: string;
|
|
679
|
+
/** 値と色 mapping (例: [{value: 'ok', color: 'green'}])、 未指定なら brand 色 */
|
|
680
|
+
map?: readonly {
|
|
681
|
+
value: string;
|
|
682
|
+
color: string;
|
|
683
|
+
}[];
|
|
684
|
+
label?: string;
|
|
685
|
+
}
|
|
686
|
+
/** status-dot = 3-4 状態を色 dot + text で、 online/offline 系 */
|
|
687
|
+
| {
|
|
688
|
+
id: string;
|
|
689
|
+
kind: "status-dot";
|
|
690
|
+
source: string;
|
|
691
|
+
map: readonly {
|
|
692
|
+
value: string;
|
|
693
|
+
color: string;
|
|
694
|
+
label?: string;
|
|
695
|
+
}[];
|
|
696
|
+
label?: string;
|
|
697
|
+
}
|
|
698
|
+
/** path-progress = SVG path を signal (0-100) の割合で stroke-dashoffset 進行、 progress bar の path 版 */
|
|
699
|
+
| {
|
|
700
|
+
id: string;
|
|
701
|
+
kind: "path-progress";
|
|
702
|
+
source: string;
|
|
703
|
+
/** SVG path d attribute (M x y L x y ... 形式) */
|
|
704
|
+
pathD: string;
|
|
705
|
+
/** viewBox 幅 (default 200) */
|
|
706
|
+
viewW?: number;
|
|
707
|
+
/** viewBox 高さ (default 40) */
|
|
708
|
+
viewH?: number;
|
|
709
|
+
/** stroke 幅 (default 6) */
|
|
710
|
+
strokeWidth?: number;
|
|
711
|
+
color?: string;
|
|
712
|
+
/** source 値の最大 (default 100)、 進行率 = source / max */
|
|
713
|
+
max?: number;
|
|
714
|
+
label?: string;
|
|
715
|
+
}
|
|
716
|
+
/** array-list = array signal を bullet list 表示、 各 element を row 化 */
|
|
717
|
+
| {
|
|
718
|
+
id: string;
|
|
719
|
+
kind: "array-list";
|
|
720
|
+
source: string;
|
|
721
|
+
/** row template (`{item}` = element 値) */
|
|
722
|
+
itemTemplate?: string;
|
|
723
|
+
/** 最大表示件数 (超過分は "…" 表示) */
|
|
724
|
+
max?: number;
|
|
725
|
+
label?: string;
|
|
726
|
+
}
|
|
727
|
+
/** array-bar = array signal の各 element を bar 高さで一列に並べる、 histogram 的 */
|
|
728
|
+
| {
|
|
729
|
+
id: string;
|
|
730
|
+
kind: "array-bar";
|
|
731
|
+
source: string;
|
|
732
|
+
/** 個別 bar の min/max (bar 高さ 0-100% 換算) */
|
|
733
|
+
min: number;
|
|
734
|
+
max: number;
|
|
735
|
+
color?: string;
|
|
736
|
+
label?: string;
|
|
737
|
+
}
|
|
738
|
+
/** line-chart = array signal を line chart 表示 (連続 point / 折れ線)、 time-series 的 */
|
|
739
|
+
| {
|
|
740
|
+
id: string;
|
|
741
|
+
kind: "line-chart";
|
|
742
|
+
source: string;
|
|
743
|
+
min: number;
|
|
744
|
+
max: number;
|
|
745
|
+
viewW?: number;
|
|
746
|
+
viewH?: number;
|
|
747
|
+
color?: string;
|
|
748
|
+
/** area fill も描画 (default false) */
|
|
749
|
+
fill?: boolean;
|
|
750
|
+
label?: string;
|
|
751
|
+
}
|
|
752
|
+
/** stacked-bar = 2 array signal を並列 bar で比較、 A / B の高さ比較 diagram 用 */
|
|
753
|
+
| {
|
|
754
|
+
id: string;
|
|
755
|
+
kind: "stacked-bar";
|
|
756
|
+
sourceA: string;
|
|
757
|
+
sourceB: string;
|
|
758
|
+
min: number;
|
|
759
|
+
max: number;
|
|
760
|
+
colorA?: string;
|
|
761
|
+
colorB?: string;
|
|
762
|
+
label?: string;
|
|
763
|
+
}
|
|
764
|
+
/**
|
|
765
|
+
* waterfall = array signal を左から累積、 各 element を差分 bar として表示 (財務 / 決算 waterfall chart 用)。
|
|
766
|
+
* `[100, -20, 30, -10, 40]` なら 100 → 80 → 110 → 100 → 140 の累積を bar で示す。 正 = colorPos、 負 = colorNeg。
|
|
767
|
+
*/
|
|
768
|
+
| {
|
|
769
|
+
id: string;
|
|
770
|
+
kind: "waterfall";
|
|
771
|
+
source: string;
|
|
772
|
+
min: number;
|
|
773
|
+
max: number;
|
|
774
|
+
viewW?: number;
|
|
775
|
+
viewH?: number;
|
|
776
|
+
colorPos?: string;
|
|
777
|
+
colorNeg?: string;
|
|
778
|
+
label?: string;
|
|
779
|
+
}
|
|
780
|
+
/**
|
|
781
|
+
* matrix = 2D array (array of arrays) を色 gradient セルで表示 (confusion matrix / heatmap / grid state 用)。
|
|
782
|
+
* source signal は `[[1,2,3],[4,5,6],[7,8,9]]` 形式の JSON string を保持。
|
|
783
|
+
*/
|
|
784
|
+
| {
|
|
785
|
+
id: string;
|
|
786
|
+
kind: "matrix";
|
|
787
|
+
source: string;
|
|
788
|
+
min: number;
|
|
789
|
+
max: number;
|
|
790
|
+
cellSize?: number;
|
|
791
|
+
colors?: readonly string[];
|
|
792
|
+
showValue?: boolean;
|
|
793
|
+
label?: string;
|
|
794
|
+
}
|
|
795
|
+
/**
|
|
796
|
+
* progress-group = array signal を progress bar list として表示 (task list progress 用)、
|
|
797
|
+
* 各 element を 0-max 割合の bar として並列。 labelSource で optional label array を指定可能。
|
|
798
|
+
*/
|
|
799
|
+
| {
|
|
800
|
+
id: string;
|
|
801
|
+
kind: "progress-group";
|
|
802
|
+
source: string;
|
|
803
|
+
max: number;
|
|
804
|
+
labelSource?: string;
|
|
805
|
+
color?: string;
|
|
806
|
+
label?: string;
|
|
807
|
+
}
|
|
808
|
+
/**
|
|
809
|
+
* sequence-timeline = array signal を横 timeline 上の event marker として表示。
|
|
810
|
+
* source は各 event の [t, name] pair の JSON string 想定 (`[[0,"login"],[100,"auth"],[400,"resp"]]`)
|
|
811
|
+
* 又は t のみ配列 (`[0,100,400]`) で index を name として使う。 time axis は min-max で正規化。
|
|
812
|
+
*/
|
|
813
|
+
| {
|
|
814
|
+
id: string;
|
|
815
|
+
kind: "sequence-timeline";
|
|
816
|
+
source: string;
|
|
817
|
+
min: number;
|
|
818
|
+
max: number;
|
|
819
|
+
viewW?: number;
|
|
820
|
+
viewH?: number;
|
|
821
|
+
color?: string;
|
|
822
|
+
label?: string;
|
|
823
|
+
}
|
|
824
|
+
/**
|
|
825
|
+
* radar = array signal (N 次元 value) を N-gon spider chart で表示。
|
|
826
|
+
* source は N 個の 数値 array (`[8, 5, 7, 3, 9]`)、 各 axis は 0-max 正規化、
|
|
827
|
+
* labelSource で optional axis 名 array。
|
|
828
|
+
*/
|
|
829
|
+
| {
|
|
830
|
+
id: string;
|
|
831
|
+
kind: "radar";
|
|
832
|
+
source: string;
|
|
833
|
+
max: number;
|
|
834
|
+
viewW?: number;
|
|
835
|
+
viewH?: number;
|
|
836
|
+
color?: string;
|
|
837
|
+
labelSource?: string;
|
|
838
|
+
label?: string;
|
|
839
|
+
}
|
|
840
|
+
/**
|
|
841
|
+
* bubble-chart = 3D data (x, y, r) の bubbles、 source は `[[x,y,r], ...]` の 3-tuple array。
|
|
842
|
+
* x-min/max、 y-min/max、 r-min/max で正規化、 SVG viewBox 内に配置。
|
|
843
|
+
*/
|
|
844
|
+
| {
|
|
845
|
+
id: string;
|
|
846
|
+
kind: "bubble-chart";
|
|
847
|
+
source: string;
|
|
848
|
+
xMin: number;
|
|
849
|
+
xMax: number;
|
|
850
|
+
yMin: number;
|
|
851
|
+
yMax: number;
|
|
852
|
+
rMin: number;
|
|
853
|
+
rMax: number;
|
|
854
|
+
viewW?: number;
|
|
855
|
+
viewH?: number;
|
|
856
|
+
color?: string;
|
|
857
|
+
label?: string;
|
|
858
|
+
}
|
|
859
|
+
/**
|
|
860
|
+
* donut = array signal を multi-segment donut chart で表示 (percentage-ring の N segment 版)。
|
|
861
|
+
* 各 segment は array[i] / sum で角度、 color rotate で色分け、 center hole 半径可調整。
|
|
862
|
+
*/
|
|
863
|
+
| {
|
|
864
|
+
id: string;
|
|
865
|
+
kind: "donut";
|
|
866
|
+
source: string;
|
|
867
|
+
viewW?: number;
|
|
868
|
+
viewH?: number;
|
|
869
|
+
colors?: readonly string[];
|
|
870
|
+
innerRatio?: number;
|
|
871
|
+
label?: string;
|
|
872
|
+
}
|
|
873
|
+
/**
|
|
874
|
+
* calendar-heatmap = 1 年分の日次 count を week × day matrix で表示 (GitHub contribution graph 系)。
|
|
875
|
+
* source は 365 element の numeric array、 各 index が day 0-364、 color gradient で count 表現。
|
|
876
|
+
*/
|
|
877
|
+
| {
|
|
878
|
+
id: string;
|
|
879
|
+
kind: "calendar-heatmap";
|
|
880
|
+
source: string;
|
|
881
|
+
/** count max value (color intensity の 100% 到達点) */
|
|
882
|
+
max: number;
|
|
883
|
+
/** cell size px (default 10) */
|
|
884
|
+
cellSize?: number;
|
|
885
|
+
/** cell gap px (default 2) */
|
|
886
|
+
cellGap?: number;
|
|
887
|
+
colors?: readonly string[];
|
|
888
|
+
label?: string;
|
|
889
|
+
}
|
|
890
|
+
/**
|
|
891
|
+
* mini-map = 大 canvas 上の現在 viewport を縮小表示 (overview 系)。
|
|
892
|
+
* source は `[vx, vy, vw, vh]` の 4-tuple JSON (viewport rect in canvas coords)、
|
|
893
|
+
* canvasW / canvasH で大 canvas 全体の座標系を宣言。
|
|
894
|
+
*/
|
|
895
|
+
| {
|
|
896
|
+
id: string;
|
|
897
|
+
kind: "mini-map";
|
|
898
|
+
source: string;
|
|
899
|
+
canvasW: number;
|
|
900
|
+
canvasH: number;
|
|
901
|
+
viewW?: number;
|
|
902
|
+
viewH?: number;
|
|
903
|
+
color?: string;
|
|
904
|
+
label?: string;
|
|
905
|
+
}
|
|
906
|
+
/**
|
|
907
|
+
* kpi-card = 現在値 + 直前値との delta + mini sparkline を 1 tile に composite (dashboard 用 KPI 単体)。
|
|
908
|
+
* source = 現在値 signal、 historySource = 数値 array signal (sparkline)、 comparisonSource = 直前値 signal (delta 計算用)。
|
|
909
|
+
*/
|
|
910
|
+
| {
|
|
911
|
+
id: string;
|
|
912
|
+
kind: "kpi-card";
|
|
913
|
+
source: string;
|
|
914
|
+
historySource: string;
|
|
915
|
+
comparisonSource: string;
|
|
916
|
+
unit?: string;
|
|
917
|
+
colorPos?: string;
|
|
918
|
+
colorNeg?: string;
|
|
919
|
+
label?: string;
|
|
920
|
+
}
|
|
921
|
+
/**
|
|
922
|
+
* candlestick = OHLC array (`[[open, high, low, close], ...]`) を蝋燭足で表示 (finance chart 用)。
|
|
923
|
+
* close >= open は colorUp、 close < open は colorDown で色分け、 wick (high/low) は 縦線。
|
|
924
|
+
*/
|
|
925
|
+
| {
|
|
926
|
+
id: string;
|
|
927
|
+
kind: "candlestick";
|
|
928
|
+
source: string;
|
|
929
|
+
min: number;
|
|
930
|
+
max: number;
|
|
931
|
+
viewW?: number;
|
|
932
|
+
viewH?: number;
|
|
933
|
+
colorUp?: string;
|
|
934
|
+
colorDown?: string;
|
|
935
|
+
label?: string;
|
|
936
|
+
}
|
|
937
|
+
/**
|
|
938
|
+
* venn = 2-set Venn diagram、 source = `[|A|, |B|, |A∩B|]` の 3-tuple。
|
|
939
|
+
* 円 A と円 B の中心を A, B の相対 size 比で position、 intersection を色 blend 表示。
|
|
940
|
+
*/
|
|
941
|
+
| {
|
|
942
|
+
id: string;
|
|
943
|
+
kind: "venn";
|
|
944
|
+
source: string;
|
|
945
|
+
viewW?: number;
|
|
946
|
+
viewH?: number;
|
|
947
|
+
colorA?: string;
|
|
948
|
+
colorB?: string;
|
|
949
|
+
labelA?: string;
|
|
950
|
+
labelB?: string;
|
|
951
|
+
label?: string;
|
|
952
|
+
}
|
|
953
|
+
/**
|
|
954
|
+
* slope = before/after slope chart。 source = `[[beforeVal, afterVal, name], ...]` の 3-tuple array、
|
|
955
|
+
* 2 column の dot + connecting line で before → after 変化を表示。
|
|
956
|
+
*/
|
|
957
|
+
| {
|
|
958
|
+
id: string;
|
|
959
|
+
kind: "slope";
|
|
960
|
+
source: string;
|
|
961
|
+
min: number;
|
|
962
|
+
max: number;
|
|
963
|
+
viewW?: number;
|
|
964
|
+
viewH?: number;
|
|
965
|
+
colorUp?: string;
|
|
966
|
+
colorDown?: string;
|
|
967
|
+
label?: string;
|
|
968
|
+
}
|
|
969
|
+
/**
|
|
970
|
+
* funnel = conversion funnel chart。 source = `[[stage, count], ...]` の 2-tuple array (order 順)、
|
|
971
|
+
* 各 stage を trapezoid で描画、 段階的 narrowing で conversion rate を可視化。
|
|
972
|
+
*/
|
|
973
|
+
| {
|
|
974
|
+
id: string;
|
|
975
|
+
kind: "funnel";
|
|
976
|
+
source: string;
|
|
977
|
+
viewW?: number;
|
|
978
|
+
viewH?: number;
|
|
979
|
+
colorTop?: string;
|
|
980
|
+
colorBottom?: string;
|
|
981
|
+
label?: string;
|
|
982
|
+
}
|
|
983
|
+
/**
|
|
984
|
+
* gantt = task timeline。 source = `[[name, start, duration], ...]` の 3-tuple array、
|
|
985
|
+
* 各 task を bar で表示 (start-x / duration-w)、 timelime 上に色分け。
|
|
986
|
+
*/
|
|
987
|
+
| {
|
|
988
|
+
id: string;
|
|
989
|
+
kind: "gantt";
|
|
990
|
+
source: string;
|
|
991
|
+
/** timeline 全体の min / max (day / hour 単位任意) */
|
|
992
|
+
min: number;
|
|
993
|
+
max: number;
|
|
994
|
+
viewW?: number;
|
|
995
|
+
viewH?: number;
|
|
996
|
+
color?: string;
|
|
997
|
+
label?: string;
|
|
998
|
+
}
|
|
999
|
+
/**
|
|
1000
|
+
* treemap = hierarchical rectangles。 source = `[[name, size], ...]` array (top level のみ、 nested 非対応)、
|
|
1001
|
+
* squarified 風 layout で area 比例配置。
|
|
1002
|
+
*/
|
|
1003
|
+
| {
|
|
1004
|
+
id: string;
|
|
1005
|
+
kind: "treemap";
|
|
1006
|
+
source: string;
|
|
1007
|
+
viewW?: number;
|
|
1008
|
+
viewH?: number;
|
|
1009
|
+
colors?: readonly string[];
|
|
1010
|
+
label?: string;
|
|
1011
|
+
}
|
|
1012
|
+
/**
|
|
1013
|
+
* sankey = 2 column flow diagram。 source = `[[fromName, toName, flow], ...]`、
|
|
1014
|
+
* left column = source group、 right column = target group、 flow の合計高さを bar 化、 flow を curve で結ぶ。
|
|
1015
|
+
*/
|
|
1016
|
+
| {
|
|
1017
|
+
id: string;
|
|
1018
|
+
kind: "sankey";
|
|
1019
|
+
source: string;
|
|
1020
|
+
viewW?: number;
|
|
1021
|
+
viewH?: number;
|
|
1022
|
+
colors?: readonly string[];
|
|
1023
|
+
label?: string;
|
|
1024
|
+
}
|
|
1025
|
+
/**
|
|
1026
|
+
* polar-area (nightingale rose) = array を極座標 area chart で表示。
|
|
1027
|
+
* 各 element は 360/n 度の扇形、 area (r^2) 比例で 値を表現、 radar と異なり sector 単位。
|
|
1028
|
+
*/
|
|
1029
|
+
| {
|
|
1030
|
+
id: string;
|
|
1031
|
+
kind: "polar-area";
|
|
1032
|
+
source: string;
|
|
1033
|
+
max: number;
|
|
1034
|
+
viewW?: number;
|
|
1035
|
+
viewH?: number;
|
|
1036
|
+
colors?: readonly string[];
|
|
1037
|
+
labelSource?: string;
|
|
1038
|
+
label?: string;
|
|
1039
|
+
}
|
|
1040
|
+
/**
|
|
1041
|
+
* step-indicator = wizard step progress。 source = 現在 step index (数値)、 stepsSource = step 名 array。
|
|
1042
|
+
* 各 step を dot + label で横に並べ、 現在 step までを active、 それ以降を pending 色で表示。
|
|
1043
|
+
*/
|
|
1044
|
+
| {
|
|
1045
|
+
id: string;
|
|
1046
|
+
kind: "step-indicator";
|
|
1047
|
+
source: string;
|
|
1048
|
+
stepsSource: string;
|
|
1049
|
+
viewW?: number;
|
|
1050
|
+
viewH?: number;
|
|
1051
|
+
colorActive?: string;
|
|
1052
|
+
colorPending?: string;
|
|
1053
|
+
label?: string;
|
|
1054
|
+
}
|
|
1055
|
+
/**
|
|
1056
|
+
* bullet-chart = target vs actual + 3 range (bad / avg / good) horizontal bar (KPI dashboard 用)。
|
|
1057
|
+
* source = actual value、 targetSource = target value、 max で正規化。 range 3 段階を背景色 gradient で。
|
|
1058
|
+
*/
|
|
1059
|
+
| {
|
|
1060
|
+
id: string;
|
|
1061
|
+
kind: "bullet-chart";
|
|
1062
|
+
source: string;
|
|
1063
|
+
targetSource: string;
|
|
1064
|
+
max: number;
|
|
1065
|
+
/** 3 range boundary (`[bad, avg]`)、 default = [max*0.4, max*0.7] */
|
|
1066
|
+
rangeBad?: number;
|
|
1067
|
+
rangeAvg?: number;
|
|
1068
|
+
viewW?: number;
|
|
1069
|
+
viewH?: number;
|
|
1070
|
+
colorActual?: string;
|
|
1071
|
+
label?: string;
|
|
1072
|
+
}
|
|
1073
|
+
/**
|
|
1074
|
+
* number-board = 大 numeric display + optional prefix / suffix (scoreboard style)。
|
|
1075
|
+
* source = 数値 signal、 subtitle 可能。 stat より格段に大きい表示。
|
|
1076
|
+
*/
|
|
1077
|
+
| {
|
|
1078
|
+
id: string;
|
|
1079
|
+
kind: "number-board";
|
|
1080
|
+
source: string;
|
|
1081
|
+
prefix?: string;
|
|
1082
|
+
suffix?: string;
|
|
1083
|
+
/** 数字 font size px (default 42) */
|
|
1084
|
+
size?: number;
|
|
1085
|
+
color?: string;
|
|
1086
|
+
/** small subtitle 表示用 */
|
|
1087
|
+
caption?: string;
|
|
1088
|
+
label?: string;
|
|
1089
|
+
}
|
|
1090
|
+
/**
|
|
1091
|
+
* leaderboard = ranked list。 source = `[[name, value], ...]` array、 value desc sort、 rank + name + value を行表示。
|
|
1092
|
+
* medal 色 (top 3) 装飾 + max 表示件数。
|
|
1093
|
+
*/
|
|
1094
|
+
| {
|
|
1095
|
+
id: string;
|
|
1096
|
+
kind: "leaderboard";
|
|
1097
|
+
source: string;
|
|
1098
|
+
/** 最大表示件数 (default 5) */
|
|
1099
|
+
max?: number;
|
|
1100
|
+
color?: string;
|
|
1101
|
+
label?: string;
|
|
1102
|
+
}
|
|
1103
|
+
/**
|
|
1104
|
+
* traffic-light = 3-color status indicator (red / yellow / green)、 source は "red" | "yellow" | "green" | 数値 (0=red / 1=yellow / 2=green)。
|
|
1105
|
+
* 大きい 3 光 dot、 active のみ光る、 build / deploy / health status 定番。
|
|
1106
|
+
*/
|
|
1107
|
+
| {
|
|
1108
|
+
id: string;
|
|
1109
|
+
kind: "traffic-light";
|
|
1110
|
+
source: string;
|
|
1111
|
+
viewW?: number;
|
|
1112
|
+
viewH?: number;
|
|
1113
|
+
label?: string;
|
|
1114
|
+
}
|
|
1115
|
+
/**
|
|
1116
|
+
* tag-cloud = `[[tag, weight], ...]` array を weight 比例 font-size で並列表示、 keyword prominence を可視化。
|
|
1117
|
+
*/
|
|
1118
|
+
| {
|
|
1119
|
+
id: string;
|
|
1120
|
+
kind: "tag-cloud";
|
|
1121
|
+
source: string;
|
|
1122
|
+
/** min / max font size (default 10 / 24) */
|
|
1123
|
+
minSize?: number;
|
|
1124
|
+
maxSize?: number;
|
|
1125
|
+
colors?: readonly string[];
|
|
1126
|
+
label?: string;
|
|
1127
|
+
}
|
|
1128
|
+
/**
|
|
1129
|
+
* activity-feed = `[[actor, action, time], ...]` array を activity list として表示。
|
|
1130
|
+
* 各 row = actor bullet + action text + relative time、 recent-first 表示。
|
|
1131
|
+
*/
|
|
1132
|
+
| {
|
|
1133
|
+
id: string;
|
|
1134
|
+
kind: "activity-feed";
|
|
1135
|
+
source: string;
|
|
1136
|
+
max?: number;
|
|
1137
|
+
color?: string;
|
|
1138
|
+
label?: string;
|
|
1139
|
+
}
|
|
1140
|
+
/**
|
|
1141
|
+
* rating = 0-max の value を N star 表示、 half-star 対応、 review score / product rating 用。
|
|
1142
|
+
*/
|
|
1143
|
+
| {
|
|
1144
|
+
id: string;
|
|
1145
|
+
kind: "rating";
|
|
1146
|
+
source: string;
|
|
1147
|
+
/** 星の総数 (default 5) */
|
|
1148
|
+
count?: number;
|
|
1149
|
+
color?: string;
|
|
1150
|
+
label?: string;
|
|
1151
|
+
}
|
|
1152
|
+
/**
|
|
1153
|
+
* notification = alert card、 kindSource で "info" / "warn" / "error" / "success" を signal 経由切替。
|
|
1154
|
+
* title + body の 2 段表示、 kind 別 color + icon (emoji)。
|
|
1155
|
+
*/
|
|
1156
|
+
| {
|
|
1157
|
+
id: string;
|
|
1158
|
+
kind: "notification";
|
|
1159
|
+
/** kind signal (info / warn / error / success) */
|
|
1160
|
+
kindSource: string;
|
|
1161
|
+
/** title text signal */
|
|
1162
|
+
titleSource: string;
|
|
1163
|
+
/** body text signal (optional、 未指定なら title のみ表示) */
|
|
1164
|
+
bodySource?: string;
|
|
1165
|
+
label?: string;
|
|
1166
|
+
}
|
|
1167
|
+
/**
|
|
1168
|
+
* diff-counter = +N / -N の 2 stat を signal 経由で表示 (git commit style)、 addition/deletion。
|
|
1169
|
+
*/
|
|
1170
|
+
| {
|
|
1171
|
+
id: string;
|
|
1172
|
+
kind: "diff-counter";
|
|
1173
|
+
additionsSource: string;
|
|
1174
|
+
deletionsSource: string;
|
|
1175
|
+
colorAdd?: string;
|
|
1176
|
+
colorDel?: string;
|
|
1177
|
+
label?: string;
|
|
1178
|
+
}
|
|
1179
|
+
/**
|
|
1180
|
+
* chat-bubble = conversation thread。 source = `[[author, text, isSelf], ...]` array (3-tuple)、
|
|
1181
|
+
* isSelf=true で右寄せ + 別色、 false で左寄せ、 message thread 定番 layout。
|
|
1182
|
+
*/
|
|
1183
|
+
| {
|
|
1184
|
+
id: string;
|
|
1185
|
+
kind: "chat-bubble";
|
|
1186
|
+
source: string;
|
|
1187
|
+
max?: number;
|
|
1188
|
+
colorSelf?: string;
|
|
1189
|
+
colorOther?: string;
|
|
1190
|
+
label?: string;
|
|
1191
|
+
}
|
|
1192
|
+
/**
|
|
1193
|
+
* avatar = user avatar circle (initials + background color)、 source = user 名 (initials 抽出) or `[name, colorHex]` の 2-tuple。
|
|
1194
|
+
* simple 用途 = 名前だけ / 高度 = [name, color] で per-user 色制御。
|
|
1195
|
+
*/
|
|
1196
|
+
| {
|
|
1197
|
+
id: string;
|
|
1198
|
+
kind: "avatar";
|
|
1199
|
+
source: string;
|
|
1200
|
+
/** サイズ px (default 40) */
|
|
1201
|
+
size?: number;
|
|
1202
|
+
/** default color (source が name のみで color 未指定時) */
|
|
1203
|
+
color?: string;
|
|
1204
|
+
label?: string;
|
|
1205
|
+
}
|
|
1206
|
+
/**
|
|
1207
|
+
* checklist = `[[label, checked], ...]` の 2-tuple array を checked/unchecked check-box list で表示、 progress % 併記。
|
|
1208
|
+
*/
|
|
1209
|
+
| {
|
|
1210
|
+
id: string;
|
|
1211
|
+
kind: "checklist";
|
|
1212
|
+
source: string;
|
|
1213
|
+
color?: string;
|
|
1214
|
+
label?: string;
|
|
1215
|
+
}
|
|
1216
|
+
/**
|
|
1217
|
+
* circular-gauge = 270° dial (open bottom) の gauge、 speedometer / tachometer 用。
|
|
1218
|
+
* source = 現在値、 min-max で正規化、 needle 表示 + gradient arc。
|
|
1219
|
+
*/
|
|
1220
|
+
| {
|
|
1221
|
+
id: string;
|
|
1222
|
+
kind: "circular-gauge";
|
|
1223
|
+
source: string;
|
|
1224
|
+
min: number;
|
|
1225
|
+
max: number;
|
|
1226
|
+
viewW?: number;
|
|
1227
|
+
viewH?: number;
|
|
1228
|
+
color?: string;
|
|
1229
|
+
/** 中央 unit / 単位 表示 */
|
|
1230
|
+
unit?: string;
|
|
1231
|
+
label?: string;
|
|
1232
|
+
}
|
|
1233
|
+
/**
|
|
1234
|
+
* price-tag = old / new / discount% を表示 (e-commerce 定番)、
|
|
1235
|
+
* oldSource / newSource を signal 経由取得、 discount は自動計算。
|
|
1236
|
+
*/
|
|
1237
|
+
| {
|
|
1238
|
+
id: string;
|
|
1239
|
+
kind: "price-tag";
|
|
1240
|
+
oldSource: string;
|
|
1241
|
+
newSource: string;
|
|
1242
|
+
/** 通貨 prefix (例 "$", "¥") */
|
|
1243
|
+
currency?: string;
|
|
1244
|
+
colorNew?: string;
|
|
1245
|
+
colorOld?: string;
|
|
1246
|
+
colorDiscount?: string;
|
|
1247
|
+
label?: string;
|
|
1248
|
+
}
|
|
1249
|
+
/**
|
|
1250
|
+
* spinner = loading state indicator、 running/done/error 3 状態を signal 経由切替、 label text 併記。
|
|
1251
|
+
*/
|
|
1252
|
+
| {
|
|
1253
|
+
id: string;
|
|
1254
|
+
kind: "spinner";
|
|
1255
|
+
source: string;
|
|
1256
|
+
textSource: string;
|
|
1257
|
+
color?: string;
|
|
1258
|
+
label?: string;
|
|
1259
|
+
}
|
|
1260
|
+
/**
|
|
1261
|
+
* grade = 0-100 score を A/B/C/D/F letter grade で表示、 color band 別。 education / review 定番。
|
|
1262
|
+
*/
|
|
1263
|
+
| {
|
|
1264
|
+
id: string;
|
|
1265
|
+
kind: "grade";
|
|
1266
|
+
source: string;
|
|
1267
|
+
/** score max value (default 100)、 A cutoff = max*0.9、 B = 0.8、 C = 0.7、 D = 0.6 未満 = F */
|
|
1268
|
+
max?: number;
|
|
1269
|
+
label?: string;
|
|
1270
|
+
}
|
|
1271
|
+
/**
|
|
1272
|
+
* stopwatch = ms 数値 signal を MM:SS.ms 形式で表示 (large font display)。
|
|
1273
|
+
*/
|
|
1274
|
+
| {
|
|
1275
|
+
id: string;
|
|
1276
|
+
kind: "stopwatch";
|
|
1277
|
+
/** ms value signal */
|
|
1278
|
+
source: string;
|
|
1279
|
+
/** running=true で緑 running color、 false で gray idle color */
|
|
1280
|
+
runningSource?: string;
|
|
1281
|
+
size?: number;
|
|
1282
|
+
color?: string;
|
|
1283
|
+
label?: string;
|
|
1284
|
+
}
|
|
1285
|
+
/**
|
|
1286
|
+
* confidence-meter = 0-100 % を 3 color band (low/mid/high) で bar + label 表示、 ML/AI 定番。
|
|
1287
|
+
*/
|
|
1288
|
+
| {
|
|
1289
|
+
id: string;
|
|
1290
|
+
kind: "confidence-meter";
|
|
1291
|
+
source: string;
|
|
1292
|
+
lowThreshold?: number;
|
|
1293
|
+
highThreshold?: number;
|
|
1294
|
+
viewW?: number;
|
|
1295
|
+
viewH?: number;
|
|
1296
|
+
label?: string;
|
|
1297
|
+
}
|
|
1298
|
+
/**
|
|
1299
|
+
* reaction-bar = `[[emoji, count], ...]` array を emoji + count の pill list で表示、 social reactions 用。
|
|
1300
|
+
*/
|
|
1301
|
+
| {
|
|
1302
|
+
id: string;
|
|
1303
|
+
kind: "reaction-bar";
|
|
1304
|
+
source: string;
|
|
1305
|
+
color?: string;
|
|
1306
|
+
label?: string;
|
|
1307
|
+
}
|
|
1308
|
+
/**
|
|
1309
|
+
* pill-group = string array or `[[label, colorHex], ...]` を small pill badge list で表示。
|
|
1310
|
+
*/
|
|
1311
|
+
| {
|
|
1312
|
+
id: string;
|
|
1313
|
+
kind: "pill-group";
|
|
1314
|
+
source: string;
|
|
1315
|
+
/** default color (source が string array のみで color 未指定時) */
|
|
1316
|
+
color?: string;
|
|
1317
|
+
label?: string;
|
|
1318
|
+
}
|
|
1319
|
+
/**
|
|
1320
|
+
* fuel-bar = 0-100% を segmented horizontal bar で表示 (battery / fuel / stamina 定番)、 3 color band。
|
|
1321
|
+
*/
|
|
1322
|
+
| {
|
|
1323
|
+
id: string;
|
|
1324
|
+
kind: "fuel-bar";
|
|
1325
|
+
source: string;
|
|
1326
|
+
segments?: number;
|
|
1327
|
+
lowThreshold?: number;
|
|
1328
|
+
highThreshold?: number;
|
|
1329
|
+
viewW?: number;
|
|
1330
|
+
viewH?: number;
|
|
1331
|
+
label?: string;
|
|
1332
|
+
}
|
|
1333
|
+
/**
|
|
1334
|
+
* metrics-grid = `[[name, value, unit?], ...]` を 2×2 grid で 4 stat 表示、 dashboard header 定番。
|
|
1335
|
+
*/
|
|
1336
|
+
| {
|
|
1337
|
+
id: string;
|
|
1338
|
+
kind: "metrics-grid";
|
|
1339
|
+
source: string;
|
|
1340
|
+
color?: string;
|
|
1341
|
+
label?: string;
|
|
1342
|
+
}
|
|
1343
|
+
/**
|
|
1344
|
+
* thermometer = 縦 bar で温度表示、 min-max で正規化、 現在値のみ signal 経由。
|
|
1345
|
+
*/
|
|
1346
|
+
| {
|
|
1347
|
+
id: string;
|
|
1348
|
+
kind: "thermometer";
|
|
1349
|
+
source: string;
|
|
1350
|
+
min: number;
|
|
1351
|
+
max: number;
|
|
1352
|
+
viewW?: number;
|
|
1353
|
+
viewH?: number;
|
|
1354
|
+
color?: string;
|
|
1355
|
+
/** 単位 (default "°") */
|
|
1356
|
+
unit?: string;
|
|
1357
|
+
label?: string;
|
|
1358
|
+
}
|
|
1359
|
+
/**
|
|
1360
|
+
* icon-tile = `[[icon, label, value], ...]` を icon + label + value の tile 列で表示。 stat 系の visual 版。
|
|
1361
|
+
*/
|
|
1362
|
+
| {
|
|
1363
|
+
id: string;
|
|
1364
|
+
kind: "icon-tile";
|
|
1365
|
+
source: string;
|
|
1366
|
+
color?: string;
|
|
1367
|
+
label?: string;
|
|
1368
|
+
}
|
|
1369
|
+
/**
|
|
1370
|
+
* token-list = `[[icon, name, amount, deltaPct], ...]` の crypto/asset list、 icon + name + amount + delta% で表示。
|
|
1371
|
+
*/
|
|
1372
|
+
| {
|
|
1373
|
+
id: string;
|
|
1374
|
+
kind: "token-list";
|
|
1375
|
+
source: string;
|
|
1376
|
+
colorUp?: string;
|
|
1377
|
+
colorDown?: string;
|
|
1378
|
+
label?: string;
|
|
1379
|
+
}
|
|
1380
|
+
/**
|
|
1381
|
+
* map-pin = `[[name, x, y], ...]` を 2D coord 上の pin として表示、 mini map / seat map / world map 定番。
|
|
1382
|
+
*/
|
|
1383
|
+
| {
|
|
1384
|
+
id: string;
|
|
1385
|
+
kind: "map-pin";
|
|
1386
|
+
source: string;
|
|
1387
|
+
/** 座標 min/max (map の world 座標系) */
|
|
1388
|
+
xMin: number;
|
|
1389
|
+
xMax: number;
|
|
1390
|
+
yMin: number;
|
|
1391
|
+
yMax: number;
|
|
1392
|
+
viewW?: number;
|
|
1393
|
+
viewH?: number;
|
|
1394
|
+
color?: string;
|
|
1395
|
+
label?: string;
|
|
1396
|
+
}
|
|
1397
|
+
/**
|
|
1398
|
+
* priority-badge = high/med/low priority indicator + label、 issue / ticket 定番。
|
|
1399
|
+
*/
|
|
1400
|
+
| {
|
|
1401
|
+
id: string;
|
|
1402
|
+
kind: "priority-badge";
|
|
1403
|
+
source: string;
|
|
1404
|
+
textSource?: string;
|
|
1405
|
+
label?: string;
|
|
1406
|
+
}
|
|
1407
|
+
/**
|
|
1408
|
+
* podium = 1st/2nd/3rd の 3 top winner を表彰台 (縦 bar) で表示、 competition / ranking 定番。
|
|
1409
|
+
* source は `[[1st_name, 1st_score], [2nd_name, 2nd_score], [3rd_name, 3rd_score]]` (順位順 3 entries)。
|
|
1410
|
+
*/
|
|
1411
|
+
| {
|
|
1412
|
+
id: string;
|
|
1413
|
+
kind: "podium";
|
|
1414
|
+
source: string;
|
|
1415
|
+
viewW?: number;
|
|
1416
|
+
viewH?: number;
|
|
1417
|
+
label?: string;
|
|
1418
|
+
}
|
|
1419
|
+
/**
|
|
1420
|
+
* poll-bar = poll option list、 各 option + % で表示、 max 選択に winner 装飾。
|
|
1421
|
+
* source は `[[option, count], ...]` array (2-tuple)、 合計 % を自動計算。
|
|
1422
|
+
*/
|
|
1423
|
+
| {
|
|
1424
|
+
id: string;
|
|
1425
|
+
kind: "poll-bar";
|
|
1426
|
+
source: string;
|
|
1427
|
+
color?: string;
|
|
1428
|
+
colorWinner?: string;
|
|
1429
|
+
label?: string;
|
|
1430
|
+
}
|
|
1431
|
+
/**
|
|
1432
|
+
* user-stack = stacked circular avatars (GitHub reviewers style)、 name array を initials で表示、 overlap で層状に。
|
|
1433
|
+
* source は string array of names、 max 表示 + overflow +N。
|
|
1434
|
+
*/
|
|
1435
|
+
| {
|
|
1436
|
+
id: string;
|
|
1437
|
+
kind: "user-stack";
|
|
1438
|
+
source: string;
|
|
1439
|
+
max?: number;
|
|
1440
|
+
size?: number;
|
|
1441
|
+
label?: string;
|
|
1442
|
+
}
|
|
1443
|
+
/**
|
|
1444
|
+
* commit-list = `[[sha, msg, author], ...]` の git commit history、 短 sha + 1 行 msg + author で行表示。
|
|
1445
|
+
*/
|
|
1446
|
+
| {
|
|
1447
|
+
id: string;
|
|
1448
|
+
kind: "commit-list";
|
|
1449
|
+
source: string;
|
|
1450
|
+
max?: number;
|
|
1451
|
+
color?: string;
|
|
1452
|
+
label?: string;
|
|
1453
|
+
}
|
|
1454
|
+
/**
|
|
1455
|
+
* media-player = play/pause + progress bar + time display (audio/video mini player)。
|
|
1456
|
+
* source = 現在再生位置 sec、 durationSource = 総時間 sec、 playingSource = 再生 flag。
|
|
1457
|
+
*/
|
|
1458
|
+
| {
|
|
1459
|
+
id: string;
|
|
1460
|
+
kind: "media-player";
|
|
1461
|
+
source: string;
|
|
1462
|
+
durationSource: string;
|
|
1463
|
+
playingSource: string;
|
|
1464
|
+
color?: string;
|
|
1465
|
+
viewW?: number;
|
|
1466
|
+
label?: string;
|
|
1467
|
+
}
|
|
1468
|
+
/**
|
|
1469
|
+
* event-log = `[[timestamp, severity, msg], ...]` の event stream、 info/warn/error 色分け、 timestamp + msg 表示。
|
|
1470
|
+
*/
|
|
1471
|
+
| {
|
|
1472
|
+
id: string;
|
|
1473
|
+
kind: "event-log";
|
|
1474
|
+
source: string;
|
|
1475
|
+
max?: number;
|
|
1476
|
+
label?: string;
|
|
1477
|
+
}
|
|
1478
|
+
/**
|
|
1479
|
+
* search-result = `[[title, snippet, url], ...]` の search hit rows。
|
|
1480
|
+
*/
|
|
1481
|
+
| {
|
|
1482
|
+
id: string;
|
|
1483
|
+
kind: "search-result";
|
|
1484
|
+
source: string;
|
|
1485
|
+
max?: number;
|
|
1486
|
+
color?: string;
|
|
1487
|
+
label?: string;
|
|
1488
|
+
}
|
|
1489
|
+
/**
|
|
1490
|
+
* roadmap = `[[quarter, items[]]]` 形式の quarterly roadmap (Q1-Q4)、 quarter 別に task list。
|
|
1491
|
+
* source は `[["Q1", ["Task A", "Task B"]], ["Q2", ["Task C"]], ...]`。
|
|
1492
|
+
*/
|
|
1493
|
+
| {
|
|
1494
|
+
id: string;
|
|
1495
|
+
kind: "roadmap";
|
|
1496
|
+
source: string;
|
|
1497
|
+
viewW?: number;
|
|
1498
|
+
viewH?: number;
|
|
1499
|
+
label?: string;
|
|
1500
|
+
}
|
|
1501
|
+
/**
|
|
1502
|
+
* weather-forecast = `[[day, icon, high, low], ...]` の 5-day weather、 icon (☀ ☁ ☂ ⚡) + 高低 temp。
|
|
1503
|
+
*/
|
|
1504
|
+
| {
|
|
1505
|
+
id: string;
|
|
1506
|
+
kind: "weather-forecast";
|
|
1507
|
+
source: string;
|
|
1508
|
+
label?: string;
|
|
1509
|
+
}
|
|
1510
|
+
/**
|
|
1511
|
+
* video-card = `[[emoji, title, duration, viewCount], ...]` の video thumbnail list、 icon + title + duration + views。
|
|
1512
|
+
*/
|
|
1513
|
+
| {
|
|
1514
|
+
id: string;
|
|
1515
|
+
kind: "video-card";
|
|
1516
|
+
source: string;
|
|
1517
|
+
max?: number;
|
|
1518
|
+
color?: string;
|
|
1519
|
+
label?: string;
|
|
1520
|
+
}
|
|
1521
|
+
/**
|
|
1522
|
+
* order-status = order tracking steps、 source = 現在 step (0-3)、 stepsSource = step names array。 step 別 icon (📦 → 🚚 → 🏠 → ✅)。
|
|
1523
|
+
*/
|
|
1524
|
+
| {
|
|
1525
|
+
id: string;
|
|
1526
|
+
kind: "order-status";
|
|
1527
|
+
source: string;
|
|
1528
|
+
stepsSource: string;
|
|
1529
|
+
color?: string;
|
|
1530
|
+
label?: string;
|
|
1531
|
+
}
|
|
1532
|
+
/**
|
|
1533
|
+
* attendance-grid = 出席表、 source = `[[day, present1, present2, ...], ...]` の 2D array (行=日、 列=member)、 present で ● / absent で ○ 表示。
|
|
1534
|
+
*/
|
|
1535
|
+
| {
|
|
1536
|
+
id: string;
|
|
1537
|
+
kind: "attendance-grid";
|
|
1538
|
+
source: string;
|
|
1539
|
+
membersSource: string;
|
|
1540
|
+
color?: string;
|
|
1541
|
+
label?: string;
|
|
1542
|
+
}
|
|
1543
|
+
/**
|
|
1544
|
+
* timezone-clock = `[[city, offsetHours, HH:MM], ...]` の multi-timezone clock、 都市名 + オフセット + 時刻表示。
|
|
1545
|
+
*/
|
|
1546
|
+
| {
|
|
1547
|
+
id: string;
|
|
1548
|
+
kind: "timezone-clock";
|
|
1549
|
+
source: string;
|
|
1550
|
+
color?: string;
|
|
1551
|
+
label?: string;
|
|
1552
|
+
}
|
|
1553
|
+
/**
|
|
1554
|
+
* form-summary = `[[fieldName, value], ...]` の form 送信内容 summary、 label + value の 2 column layout。
|
|
1555
|
+
*/
|
|
1556
|
+
| {
|
|
1557
|
+
id: string;
|
|
1558
|
+
kind: "form-summary";
|
|
1559
|
+
source: string;
|
|
1560
|
+
color?: string;
|
|
1561
|
+
label?: string;
|
|
1562
|
+
}
|
|
1563
|
+
/**
|
|
1564
|
+
* song-queue = `[[title, artist, duration], ...]` の song playlist queue、 現在再生曲を highlight。
|
|
1565
|
+
*/
|
|
1566
|
+
| {
|
|
1567
|
+
id: string;
|
|
1568
|
+
kind: "song-queue";
|
|
1569
|
+
source: string;
|
|
1570
|
+
currentSource?: string;
|
|
1571
|
+
max?: number;
|
|
1572
|
+
color?: string;
|
|
1573
|
+
label?: string;
|
|
1574
|
+
}
|
|
1575
|
+
/**
|
|
1576
|
+
* calendar-month = 1 month calendar view、 source = `[[day, isEvent, isToday], ...]` の day 情報。
|
|
1577
|
+
* 6 週 × 7 日 grid、 event 有り day は dot marker、 today は border 強調。
|
|
1578
|
+
*/
|
|
1579
|
+
| {
|
|
1580
|
+
id: string;
|
|
1581
|
+
kind: "calendar-month";
|
|
1582
|
+
source: string;
|
|
1583
|
+
/** 月名 (例 "January 2026") */
|
|
1584
|
+
monthName?: string;
|
|
1585
|
+
color?: string;
|
|
1586
|
+
label?: string;
|
|
1587
|
+
}
|
|
1588
|
+
/**
|
|
1589
|
+
* terminal = CLI terminal output、 source = `[[prompt, cmd, output], ...]` の command history。
|
|
1590
|
+
* mono font + prompt color + output preformatted 表示。
|
|
1591
|
+
*/
|
|
1592
|
+
| {
|
|
1593
|
+
id: string;
|
|
1594
|
+
kind: "terminal";
|
|
1595
|
+
source: string;
|
|
1596
|
+
max?: number;
|
|
1597
|
+
color?: string;
|
|
1598
|
+
label?: string;
|
|
1599
|
+
}
|
|
1600
|
+
/**
|
|
1601
|
+
* chess-board = 8×8 chess board、 source = `[[file, rank, piece], ...]` の piece 配置 (file=a-h、 rank=1-8、 piece=♔♕♖♗♘♙♚♛♜♝♞♟)。
|
|
1602
|
+
*/
|
|
1603
|
+
| {
|
|
1604
|
+
id: string;
|
|
1605
|
+
kind: "chess-board";
|
|
1606
|
+
source: string;
|
|
1607
|
+
/** cell size px (default 24) */
|
|
1608
|
+
cellSize?: number;
|
|
1609
|
+
label?: string;
|
|
1610
|
+
}
|
|
1611
|
+
/**
|
|
1612
|
+
* kanban-board = 3 column task board (Todo / In Progress / Done)、 source = `[[column, task, priority?], ...]` の task 配置。
|
|
1613
|
+
* column は "todo" / "inprogress" / "done" のいずれか (case insensitive、 別名 "in-progress" / "in_progress" 許容)。 layout diversity pattern taxonomy § 1 state-based split と共鳴、 task を state 別に card 並列表示。
|
|
1614
|
+
*/
|
|
1615
|
+
| {
|
|
1616
|
+
id: string;
|
|
1617
|
+
kind: "kanban-board";
|
|
1618
|
+
source: string;
|
|
1619
|
+
/** column width px (default 130) */
|
|
1620
|
+
columnWidth?: number;
|
|
1621
|
+
/** column max task 数 (default 5、 超過は "+N more") */
|
|
1622
|
+
max?: number;
|
|
1623
|
+
label?: string;
|
|
1624
|
+
}
|
|
1625
|
+
/**
|
|
1626
|
+
* breadcrumb = navigation path、 source = `["Home", "Docs", "API", ...]` の label array、 currentSource で active index を指定。
|
|
1627
|
+
* `Home > Docs > API > Reference` の pattern で表示、 current は bold + accent color。 layout diversity pattern taxonomy § 4 pipeline flow と共鳴、 navigation 遷移を可視化。
|
|
1628
|
+
*/
|
|
1629
|
+
| {
|
|
1630
|
+
id: string;
|
|
1631
|
+
kind: "breadcrumb";
|
|
1632
|
+
source: string;
|
|
1633
|
+
/** current active index を保持する signal id (未指定なら last item を active 扱い) */
|
|
1634
|
+
currentSource?: string;
|
|
1635
|
+
/** active color (default "#2563eb") */
|
|
1636
|
+
color?: string;
|
|
1637
|
+
label?: string;
|
|
1638
|
+
}
|
|
1639
|
+
/**
|
|
1640
|
+
* timeline-vertical = 縦 timeline (dot + line + text)、 source = `[[timestamp, title, description], ...]` の event array。
|
|
1641
|
+
* layout diversity pattern taxonomy § 7 individual element split と共鳴、 各 event を dot marker で連続表示、 event log / history 定番。
|
|
1642
|
+
*/
|
|
1643
|
+
| {
|
|
1644
|
+
id: string;
|
|
1645
|
+
kind: "timeline-vertical";
|
|
1646
|
+
source: string;
|
|
1647
|
+
/** dot color (default "#2563eb") */
|
|
1648
|
+
color?: string;
|
|
1649
|
+
/** 最大表示 event 数 (default 8) */
|
|
1650
|
+
max?: number;
|
|
1651
|
+
label?: string;
|
|
1652
|
+
}
|
|
1653
|
+
/**
|
|
1654
|
+
* status-timeline = 時系列 status 遷移 (Active/Idle/Error 等)、 source = `[[timestamp, status], ...]`。
|
|
1655
|
+
* status 別 color band で横 timeline strip 表示、 uptime / server state monitoring 定番。 layout diversity pattern taxonomy § 4 pipeline flow と共鳴。
|
|
1656
|
+
*/
|
|
1657
|
+
| {
|
|
1658
|
+
id: string;
|
|
1659
|
+
kind: "status-timeline";
|
|
1660
|
+
source: string;
|
|
1661
|
+
/** status → color の対応 (default = "active":green / "idle":gray / "error":red) */
|
|
1662
|
+
colorMap?: Array<{
|
|
1663
|
+
status: string;
|
|
1664
|
+
color: string;
|
|
1665
|
+
}>;
|
|
1666
|
+
/** 最大表示 event 数 (default 10) */
|
|
1667
|
+
max?: number;
|
|
1668
|
+
label?: string;
|
|
1669
|
+
}
|
|
1670
|
+
/**
|
|
1671
|
+
* calendar-week = 7-day mini calendar、 source = `[[dayLabel, hasEvent, isToday], ...]` の 7 day tuple。 calendar-month の縮小版、 週間 dashboard 用。
|
|
1672
|
+
* layout diversity pattern taxonomy § 7 individual element split と共鳴。
|
|
1673
|
+
*/
|
|
1674
|
+
| {
|
|
1675
|
+
id: string;
|
|
1676
|
+
kind: "calendar-week";
|
|
1677
|
+
source: string;
|
|
1678
|
+
/** cell size px (default 40) */
|
|
1679
|
+
cellSize?: number;
|
|
1680
|
+
/** event color (default "#2563eb") */
|
|
1681
|
+
color?: string;
|
|
1682
|
+
label?: string;
|
|
1683
|
+
}
|
|
1684
|
+
/**
|
|
1685
|
+
* kpi-comparison = 2 KPI を horizontal bar で並列比較、 source = `[[label, value], [label, value]]` の 2-tuple。
|
|
1686
|
+
* A vs B の直接比較を可視化、 A/B test / period comparison 定番。 layout diversity pattern taxonomy § 3 category split と共鳴。
|
|
1687
|
+
*/
|
|
1688
|
+
| {
|
|
1689
|
+
id: string;
|
|
1690
|
+
kind: "kpi-comparison";
|
|
1691
|
+
source: string;
|
|
1692
|
+
/** value 最大値 (bar width の基準、 default = max(A, B)) */
|
|
1693
|
+
max?: number;
|
|
1694
|
+
/** A color (default "#2563eb") */
|
|
1695
|
+
colorA?: string;
|
|
1696
|
+
/** B color (default "#f97316") */
|
|
1697
|
+
colorB?: string;
|
|
1698
|
+
label?: string;
|
|
1699
|
+
}
|
|
1700
|
+
/**
|
|
1701
|
+
* step-progress = numbered step + progress line、 source = current step index (0-indexed number)。
|
|
1702
|
+
* stepsSource で step ラベル array。 layout diversity pattern taxonomy § 4 pipeline flow + § 5 fan-out と共鳴、 wizard progress の可視化。
|
|
1703
|
+
*/
|
|
1704
|
+
| {
|
|
1705
|
+
id: string;
|
|
1706
|
+
kind: "step-progress";
|
|
1707
|
+
source: string;
|
|
1708
|
+
/** step ラベル array を保持する signal id */
|
|
1709
|
+
stepsSource: string;
|
|
1710
|
+
/** active color (default "#2563eb") */
|
|
1711
|
+
color?: string;
|
|
1712
|
+
label?: string;
|
|
1713
|
+
}
|
|
1714
|
+
/**
|
|
1715
|
+
* user-presence = user list + presence dot、 source = `[[name, status], ...]` の tuple。
|
|
1716
|
+
* status = "online" (green) / "away" (yellow) / "offline" (gray)、 team collaboration 定番。 layout diversity pattern taxonomy § 1 state-based split と共鳴。
|
|
1717
|
+
*/
|
|
1718
|
+
| {
|
|
1719
|
+
id: string;
|
|
1720
|
+
kind: "user-presence";
|
|
1721
|
+
source: string;
|
|
1722
|
+
/** max 表示人数 (default 6、 超過は "+N more") */
|
|
1723
|
+
max?: number;
|
|
1724
|
+
label?: string;
|
|
1725
|
+
}
|
|
1726
|
+
/**
|
|
1727
|
+
* rating-thumb = thumbs up/down rating、 source = `[up_count, down_count]` の 2-tuple。
|
|
1728
|
+
* total votes + up %計算 + colored bar 表示、 review / feedback 定番。 layout diversity pattern taxonomy § 3 category split と共鳴 (2 category)。
|
|
1729
|
+
*/
|
|
1730
|
+
| {
|
|
1731
|
+
id: string;
|
|
1732
|
+
kind: "rating-thumb";
|
|
1733
|
+
source: string;
|
|
1734
|
+
/** up color (default "#22c55e") */
|
|
1735
|
+
colorUp?: string;
|
|
1736
|
+
/** down color (default "#ef4444") */
|
|
1737
|
+
colorDown?: string;
|
|
1738
|
+
label?: string;
|
|
1739
|
+
}
|
|
1740
|
+
/**
|
|
1741
|
+
* org-chart-mini = organization hierarchy 3 level (CEO → Manager → IC)、 source = `[[name, level], ...]` の tuple。
|
|
1742
|
+
* level = 0 (root) / 1 (mid) / 2 (leaf) の 3 tier で自動配置、 layout diversity pattern taxonomy § 8 tree depth split と共鳴。
|
|
1743
|
+
*/
|
|
1744
|
+
| {
|
|
1745
|
+
id: string;
|
|
1746
|
+
kind: "org-chart-mini";
|
|
1747
|
+
source: string;
|
|
1748
|
+
/** node color (default "#2563eb") */
|
|
1749
|
+
color?: string;
|
|
1750
|
+
label?: string;
|
|
1751
|
+
}
|
|
1752
|
+
/**
|
|
1753
|
+
* kpi-trend-tile = KPI current value + delta arrow + mini sparkline を 1 tile 表示、 sources = `[current, prev]`、 historySource = 履歴 array。
|
|
1754
|
+
* layout diversity pattern taxonomy § 5 fan-out と共鳴 (1 tile が current + delta + spark の 3 view を fan-out)。
|
|
1755
|
+
*/
|
|
1756
|
+
| {
|
|
1757
|
+
id: string;
|
|
1758
|
+
kind: "kpi-trend-tile";
|
|
1759
|
+
/** current value signal id */
|
|
1760
|
+
source: string;
|
|
1761
|
+
/** previous value signal id (delta 計算用) */
|
|
1762
|
+
prevSource: string;
|
|
1763
|
+
/** history array signal id (sparkline 用) */
|
|
1764
|
+
historySource: string;
|
|
1765
|
+
/** unit (例 "%" / "$M") */
|
|
1766
|
+
unit?: string;
|
|
1767
|
+
/** positive color (default "#22c55e") */
|
|
1768
|
+
colorPos?: string;
|
|
1769
|
+
/** negative color (default "#ef4444") */
|
|
1770
|
+
colorNeg?: string;
|
|
1771
|
+
label?: string;
|
|
1772
|
+
}
|
|
1773
|
+
/**
|
|
1774
|
+
* quick-poll-emoji = 3-4 emoji poll (👍/❤️/🎉 等)、 source = `[[emoji, count], ...]`。
|
|
1775
|
+
* 各 emoji + count で pill 表示、 total 合計、 winner emoji に highlight border。 layout diversity pattern taxonomy § 3 category split と共鳴 (emoji 別 category)。
|
|
1776
|
+
*/
|
|
1777
|
+
| {
|
|
1778
|
+
id: string;
|
|
1779
|
+
kind: "quick-poll-emoji";
|
|
1780
|
+
source: string;
|
|
1781
|
+
/** winner border color (default "#2563eb") */
|
|
1782
|
+
colorWinner?: string;
|
|
1783
|
+
label?: string;
|
|
1784
|
+
}
|
|
1785
|
+
/**
|
|
1786
|
+
* voice-message = audio playback UI、 source = arraySignal `[amp, amp, ...]` (0..1 amplitudes)。
|
|
1787
|
+
* horizontal bar 群 + play triangle + duration text、 progressSource 指定で playback progress overlay。
|
|
1788
|
+
* layout diversity pattern taxonomy § 7 dense sequence と共鳴 (waveform bar の連続配置)。
|
|
1789
|
+
*/
|
|
1790
|
+
| {
|
|
1791
|
+
id: string;
|
|
1792
|
+
kind: "voice-message";
|
|
1793
|
+
source: string;
|
|
1794
|
+
/** state id for playback progress 0..1 (optional) */
|
|
1795
|
+
progressSource?: string;
|
|
1796
|
+
/** total duration seconds (default 30) */
|
|
1797
|
+
duration?: number;
|
|
1798
|
+
/** play button color (default "#2563eb") */
|
|
1799
|
+
colorPlay?: string;
|
|
1800
|
+
/** bar color (default "#cbd5e1") */
|
|
1801
|
+
colorBar?: string;
|
|
1802
|
+
label?: string;
|
|
1803
|
+
}
|
|
1804
|
+
/**
|
|
1805
|
+
* thread-summary = conversation thread summary card、 source = arraySignal `[unreadNum, participantsNum, lastAuthorStr, timeAgoStr]` の 4-tuple。
|
|
1806
|
+
* unread badge + participant count + last author + time ago の 4 情報を 1 card に集約。
|
|
1807
|
+
* layout diversity pattern taxonomy § 3 category split と共鳴 (4 field 分割 layout)。
|
|
1808
|
+
*/
|
|
1809
|
+
| {
|
|
1810
|
+
id: string;
|
|
1811
|
+
kind: "thread-summary";
|
|
1812
|
+
source: string;
|
|
1813
|
+
/** unread badge color (default "#ef4444") */
|
|
1814
|
+
colorUnread?: string;
|
|
1815
|
+
label?: string;
|
|
1816
|
+
}
|
|
1817
|
+
/**
|
|
1818
|
+
* read-receipt = message read status、 source = state (number 0=sent / 1=delivered / 2=read)。
|
|
1819
|
+
* status 0 = single check gray、 1 = double check gray、 2 = double check colored (read)。
|
|
1820
|
+
* layout diversity pattern taxonomy § 2 state-driven visibility と共鳴 (status 別 icon)。
|
|
1821
|
+
*/
|
|
1822
|
+
| {
|
|
1823
|
+
id: string;
|
|
1824
|
+
kind: "read-receipt";
|
|
1825
|
+
source: string;
|
|
1826
|
+
/** read color (default "#2563eb") */
|
|
1827
|
+
colorRead?: string;
|
|
1828
|
+
/** pending color (default "#94a3b8") */
|
|
1829
|
+
colorPending?: string;
|
|
1830
|
+
label?: string;
|
|
1831
|
+
}
|
|
1832
|
+
/**
|
|
1833
|
+
* password-strength = パスワード強度 4 段階 meter、 source = state (number 0=too weak / 1=weak / 2=fair / 3=good / 4=strong)。
|
|
1834
|
+
* 4 bar segment を strength 分 fill、 label text (too weak / weak / fair / good / strong) 表示。
|
|
1835
|
+
* layout diversity pattern taxonomy § 4 rank-based split と共鳴 (level 別 rank)。
|
|
1836
|
+
*/
|
|
1837
|
+
| {
|
|
1838
|
+
id: string;
|
|
1839
|
+
kind: "password-strength";
|
|
1840
|
+
source: string;
|
|
1841
|
+
/** strong color (default "#22c55e") */
|
|
1842
|
+
colorStrong?: string;
|
|
1843
|
+
/** weak color (default "#ef4444") */
|
|
1844
|
+
colorWeak?: string;
|
|
1845
|
+
label?: string;
|
|
1846
|
+
}
|
|
1847
|
+
/**
|
|
1848
|
+
* otp-input = 6-digit OTP entry box grid、 source = arraySignal `[d0, d1, d2, d3, d4, d5]` (0-9 or -1 未入力)。
|
|
1849
|
+
* 6 box を横並び、 各 box に digit 表示、 focus (次の empty box) を highlight border。
|
|
1850
|
+
* layout diversity pattern taxonomy § 7 dense sequence と共鳴 (dense box row)。
|
|
1851
|
+
*/
|
|
1852
|
+
| {
|
|
1853
|
+
id: string;
|
|
1854
|
+
kind: "otp-input";
|
|
1855
|
+
source: string;
|
|
1856
|
+
/** focus color (default "#2563eb") */
|
|
1857
|
+
colorFocus?: string;
|
|
1858
|
+
label?: string;
|
|
1859
|
+
}
|
|
1860
|
+
/**
|
|
1861
|
+
* file-dropzone = drag-and-drop file upload zone、 source = state (string filename or "" for empty)。
|
|
1862
|
+
* empty = dashed border + icon + prompt、 filled = filename card + size 表示。
|
|
1863
|
+
* layout diversity pattern taxonomy § 2 state-driven visibility と共鳴 (empty / filled 状態切替)。
|
|
1864
|
+
*/
|
|
1865
|
+
| {
|
|
1866
|
+
id: string;
|
|
1867
|
+
kind: "file-dropzone";
|
|
1868
|
+
source: string;
|
|
1869
|
+
/** active border color (default "#2563eb") */
|
|
1870
|
+
colorActive?: string;
|
|
1871
|
+
label?: string;
|
|
1872
|
+
}
|
|
1873
|
+
/**
|
|
1874
|
+
* log-stream = real-time log tail、 source = arraySignal `[[timestamp, level, message], ...]` の 3-tuple。
|
|
1875
|
+
* level = 0=debug (gray) / 1=info (blue) / 2=warn (orange) / 3=error (red)、 最新 5 行表示。
|
|
1876
|
+
* layout diversity pattern taxonomy § 7 dense sequence と共鳴 (log row 連続配置)。
|
|
1877
|
+
*/
|
|
1878
|
+
| {
|
|
1879
|
+
id: string;
|
|
1880
|
+
kind: "log-stream";
|
|
1881
|
+
source: string;
|
|
1882
|
+
label?: string;
|
|
1883
|
+
}
|
|
1884
|
+
/**
|
|
1885
|
+
* alert-banner = severity 別 alert banner、 source = arraySignal `[severity, message]` の 2-tuple (severity = 0=info / 1=success / 2=warn / 3=error)。
|
|
1886
|
+
* severity 別 bg color + icon + message、 1 line 表示。
|
|
1887
|
+
* layout diversity pattern taxonomy § 2 state-driven visibility と共鳴 (severity 別視覚切替)。
|
|
1888
|
+
*/
|
|
1889
|
+
| {
|
|
1890
|
+
id: string;
|
|
1891
|
+
kind: "alert-banner";
|
|
1892
|
+
source: string;
|
|
1893
|
+
label?: string;
|
|
1894
|
+
}
|
|
1895
|
+
/**
|
|
1896
|
+
* service-health = service health matrix、 source = arraySignal `[[serviceName, status], ...]` の 2-tuple (status = 0=down / 1=degraded / 2=up)。
|
|
1897
|
+
* 各 service tile に status dot (red / yellow / green)、 grid layout 3-column。
|
|
1898
|
+
* layout diversity pattern taxonomy § 3 category split と共鳴 (service 別 category)。
|
|
1899
|
+
*/
|
|
1900
|
+
| {
|
|
1901
|
+
id: string;
|
|
1902
|
+
kind: "service-health";
|
|
1903
|
+
source: string;
|
|
1904
|
+
label?: string;
|
|
1905
|
+
}
|
|
1906
|
+
/**
|
|
1907
|
+
* cart-summary = shopping cart totals、 source = arraySignal `[itemCount, subtotal, shipping, total]` の 4-tuple (numbers)。
|
|
1908
|
+
* 4 row (Items / Subtotal / Shipping / Total) の label + value 表示、 Total 行は bold + colored。
|
|
1909
|
+
* layout diversity pattern taxonomy § 4 rank-based split と共鳴 (order rank の 4 段)。
|
|
1910
|
+
*/
|
|
1911
|
+
| {
|
|
1912
|
+
id: string;
|
|
1913
|
+
kind: "cart-summary";
|
|
1914
|
+
source: string;
|
|
1915
|
+
/** currency prefix (default "$") */
|
|
1916
|
+
currency?: string;
|
|
1917
|
+
/** total color (default "#2563eb") */
|
|
1918
|
+
colorTotal?: string;
|
|
1919
|
+
label?: string;
|
|
1920
|
+
}
|
|
1921
|
+
/**
|
|
1922
|
+
* pricing-tier = pricing plan card、 source = arraySignal `[planName, price, feature1, feature2, feature3]` の 5-tuple。
|
|
1923
|
+
* plan name header + price 大文字 + 3 feature bullet + CTA button 表示、 1 card layout。
|
|
1924
|
+
* layout diversity pattern taxonomy § 3 category split と共鳴 (plan tier category)。
|
|
1925
|
+
*/
|
|
1926
|
+
| {
|
|
1927
|
+
id: string;
|
|
1928
|
+
kind: "pricing-tier";
|
|
1929
|
+
source: string;
|
|
1930
|
+
/** highlight color for price + CTA (default "#2563eb") */
|
|
1931
|
+
colorAccent?: string;
|
|
1932
|
+
/** currency prefix (default "$") */
|
|
1933
|
+
currency?: string;
|
|
1934
|
+
label?: string;
|
|
1935
|
+
}
|
|
1936
|
+
/**
|
|
1937
|
+
* coupon-code = coupon code entry + apply status、 source = arraySignal `[code, discountPct]` の 2-tuple (code = string、 discountPct = number 0-100)。
|
|
1938
|
+
* code entry box + "% off" badge (discountPct > 0 なら success color、 0 なら未適用)。
|
|
1939
|
+
* layout diversity pattern taxonomy § 2 state-driven visibility と共鳴 (applied / not applied 切替)。
|
|
1940
|
+
*/
|
|
1941
|
+
| {
|
|
1942
|
+
id: string;
|
|
1943
|
+
kind: "coupon-code";
|
|
1944
|
+
source: string;
|
|
1945
|
+
/** applied color (default "#22c55e") */
|
|
1946
|
+
colorApplied?: string;
|
|
1947
|
+
label?: string;
|
|
1948
|
+
}
|
|
1949
|
+
/**
|
|
1950
|
+
* article-preview = blog article preview card、 source = arraySignal `[title, excerpt, author, timeAgo]` の 4-tuple。
|
|
1951
|
+
* thumbnail placeholder + title + excerpt + author/timeAgo meta の 1 card layout。
|
|
1952
|
+
* layout diversity pattern taxonomy § 3 category split と共鳴 (4 field split)。
|
|
1953
|
+
*/
|
|
1954
|
+
| {
|
|
1955
|
+
id: string;
|
|
1956
|
+
kind: "article-preview";
|
|
1957
|
+
source: string;
|
|
1958
|
+
/** accent color for title (default "#2563eb") */
|
|
1959
|
+
colorAccent?: string;
|
|
1960
|
+
label?: string;
|
|
1961
|
+
}
|
|
1962
|
+
/**
|
|
1963
|
+
* toc-nav = table of contents nav with active section、 source = arraySignal `[[level, title, isActive], ...]` の 3-tuple (level = 0/1/2 indent、 isActive = 0/1)。
|
|
1964
|
+
* level 別 indent、 active item に highlight border + colored text。
|
|
1965
|
+
* layout diversity pattern taxonomy § 8 tree depth split と共鳴 (level 別 indent)。
|
|
1966
|
+
*/
|
|
1967
|
+
| {
|
|
1968
|
+
id: string;
|
|
1969
|
+
kind: "toc-nav";
|
|
1970
|
+
source: string;
|
|
1971
|
+
/** active color (default "#2563eb") */
|
|
1972
|
+
colorActive?: string;
|
|
1973
|
+
label?: string;
|
|
1974
|
+
}
|
|
1975
|
+
/**
|
|
1976
|
+
* share-buttons = social share button row、 source = arraySignal `[[platform, count], ...]` の 2-tuple (platform = "tw" | "fb" | "li" | "rd" 等、 count = shares)。
|
|
1977
|
+
* horizontal button row + platform icon + count 表示。
|
|
1978
|
+
* layout diversity pattern taxonomy § 7 dense sequence と共鳴 (button 連続配置)。
|
|
1979
|
+
*/
|
|
1980
|
+
| {
|
|
1981
|
+
id: string;
|
|
1982
|
+
kind: "share-buttons";
|
|
1983
|
+
source: string;
|
|
1984
|
+
label?: string;
|
|
1985
|
+
};
|
|
1986
|
+
type CdlPhase = {
|
|
1987
|
+
id: string;
|
|
1988
|
+
duration: number;
|
|
1989
|
+
title: string;
|
|
1990
|
+
body: string;
|
|
1991
|
+
activate: string[];
|
|
1992
|
+
/** 数値 state の線形補間 (write phase で 100→90 等) */
|
|
1993
|
+
tweens: Array<{
|
|
1994
|
+
stateId: string;
|
|
1995
|
+
from: number;
|
|
1996
|
+
to: number;
|
|
1997
|
+
}>;
|
|
1998
|
+
/** 任意型 state の即時切替 (この phase に到達したら値を上書き、 lerp なし) */
|
|
1999
|
+
sets: Array<{
|
|
2000
|
+
stateId: string;
|
|
2001
|
+
value: string | number;
|
|
2002
|
+
}>;
|
|
2003
|
+
badge?: string;
|
|
2004
|
+
};
|
|
2005
|
+
/**
|
|
2006
|
+
* formula spec (v0.5+、 CAR #244)。
|
|
2007
|
+
* builder chain の `.formula(id, expression)` で追加、 expression は safe subset の算術 mini-DSL。
|
|
2008
|
+
* consumer は createFormulaComputeds(diagram, signals) で id → computed の map を得て bind する。
|
|
2009
|
+
*/
|
|
2010
|
+
type CdlFormula = {
|
|
2011
|
+
id: string;
|
|
2012
|
+
/** safe subset expression 文字列。 例 `"gasBase * (1 + delta/8)"` */
|
|
2013
|
+
expression: string;
|
|
2014
|
+
};
|
|
2015
|
+
/**
|
|
2016
|
+
* event handler の bind target (CAR #246)。 node / edge / lane の id 指定 or diagram 全体 (root)。
|
|
2017
|
+
* consumer app 側で該当 element を data-cdl-node / data-cdl-edge / data-cdl-lane 属性で識別する前提。
|
|
2018
|
+
*/
|
|
2019
|
+
type CdlEventTarget = {
|
|
2020
|
+
kind: "node";
|
|
2021
|
+
id: string;
|
|
2022
|
+
} | {
|
|
2023
|
+
kind: "edge";
|
|
2024
|
+
id: string;
|
|
2025
|
+
} | {
|
|
2026
|
+
kind: "lane";
|
|
2027
|
+
id: string;
|
|
2028
|
+
} | {
|
|
2029
|
+
kind: "diagram";
|
|
2030
|
+
};
|
|
2031
|
+
/**
|
|
2032
|
+
* DOM event 種別 (CAR #246)。 現状 click / hover の 2 種、 将来 focus / keydown 等の拡張余地あり。
|
|
2033
|
+
* hover は mouseenter に対応 (mouseleave での逆 event は別途 handler で分岐)。
|
|
2034
|
+
*/
|
|
2035
|
+
type CdlEventKind = "click" | "hover" | "double-click" | "long-press" | "drag" | "drop" | "keydown" | "focus" | "blur";
|
|
2036
|
+
/**
|
|
2037
|
+
* event handler binding spec (v0.5+、 CAR #246)。
|
|
2038
|
+
* builder chain の `.on.click(target, handlerId)` / `.on.hover(target, handlerId)` で追加、
|
|
2039
|
+
* consumer は attachEventHandlers(root, diagram, handlers) で { handlerId → function } map を渡して bind。
|
|
2040
|
+
*
|
|
2041
|
+
* JSON DSL 互換のため handler 実体は string id のみ格納、 実際の関数は attach 時に caller が渡す。
|
|
2042
|
+
* LLM 生成経路が handler id を string で書き、 consumer 側で id → function 対応表を管理する design。
|
|
2043
|
+
*/
|
|
2044
|
+
type CdlEventBinding = {
|
|
2045
|
+
id: string;
|
|
2046
|
+
event: CdlEventKind;
|
|
2047
|
+
target: CdlEventTarget;
|
|
2048
|
+
handlerId: string;
|
|
2049
|
+
};
|
|
2050
|
+
/**
|
|
2051
|
+
* scroll-driven animation trigger spec (v0.5+、 CAR #245)。
|
|
2052
|
+
*
|
|
2053
|
+
* scroll 位置に応じて 0..1 の progress を生成する trigger。 arc-intro 風 narrative や scroll 連動 timeline
|
|
2054
|
+
* の起点となる。 consumer は createScrollProgressSignal(spec) で { signal, attach, detach } を得て、
|
|
2055
|
+
* DOM element に IntersectionObserver / getBoundingClientRect 経由で bind する。
|
|
2056
|
+
*
|
|
2057
|
+
* start / end は viewport 相対位置の割合 (0 = viewport top、 1 = viewport bottom)。
|
|
2058
|
+
* 「element top が viewport 中央に来た時点で 0、 element bottom が viewport 中央に来た時点で 1」 の
|
|
2059
|
+
* classic scroll narrative pattern。
|
|
2060
|
+
*/
|
|
2061
|
+
type CdlScrollTrigger = {
|
|
2062
|
+
id: string;
|
|
2063
|
+
/**
|
|
2064
|
+
* scroll progress 0 (未開始) となる viewport 相対位置。
|
|
2065
|
+
* default = 1.0 (element top が viewport bottom に達した瞬間 = 進捗開始)。
|
|
2066
|
+
*/
|
|
2067
|
+
start?: number;
|
|
2068
|
+
/**
|
|
2069
|
+
* scroll progress 1 (完了) となる viewport 相対位置。
|
|
2070
|
+
* default = 0.0 (element bottom が viewport top に達した瞬間 = 進捗完了)。
|
|
2071
|
+
*/
|
|
2072
|
+
end?: number;
|
|
2073
|
+
/**
|
|
2074
|
+
* scrub 値 = 進捗の直接反映度合い (0 = 完全 step、 1 = 完全 scrub)。 default = 1 (連続追随)。
|
|
2075
|
+
* 現実装では常に scrub (getBoundingClientRect 直接反映)、 将来 tween 補間で step 対応の余地。
|
|
2076
|
+
*/
|
|
2077
|
+
scrub?: number;
|
|
2078
|
+
label?: string;
|
|
2079
|
+
};
|
|
2080
|
+
type CdlDiagram = {
|
|
2081
|
+
id: string;
|
|
2082
|
+
topic: string;
|
|
2083
|
+
/**
|
|
2084
|
+
* この図を structured-data (schema.org) 抽出の対象とみなすか (既定 = `"extract"`)。
|
|
2085
|
+
*
|
|
2086
|
+
* - `"extract"` ... 抽出対象。 名前付き node が足りなければ `visualValidate` が warn を出す
|
|
2087
|
+
* - `"exclude"` ... 抽出対象外。 図形 1 つを見せる見本や、 文字を持たない装飾図など、
|
|
2088
|
+
* そもそも文章として取り出す中身を持たせるつもりが無い図に付ける
|
|
2089
|
+
*
|
|
2090
|
+
* `"exclude"` を **著者が明示する** ための field。 engine 側で図の形から推測すると、
|
|
2091
|
+
* 「意図的に文字を持たない図」 と「名前を付け忘れた図」 を区別できず、 後者を見逃す。
|
|
2092
|
+
*
|
|
2093
|
+
* 既定は `"extract"` = 付け忘れても検知が緩まない向き。
|
|
2094
|
+
*/
|
|
2095
|
+
structuredData?: "extract" | "exclude";
|
|
2096
|
+
/**
|
|
2097
|
+
* interactive input widgets (v0.5+、 CAR #243)。
|
|
2098
|
+
* builder chain の `.input.slider() / .number() / .dropdown() / .toggle()` で追加。
|
|
2099
|
+
* consumer app が widget UI を描画、 signal 経由で cdl の SVG と bind する。
|
|
2100
|
+
* 省略時は空 array 相当で下位互換 (static diagram 動作は不変)。
|
|
2101
|
+
*/
|
|
2102
|
+
inputs?: CdlInput[];
|
|
2103
|
+
/**
|
|
2104
|
+
* derived value formulas (v0.5+、 CAR #244)。
|
|
2105
|
+
* builder chain の `.formula(id, expression)` で追加、 expression は algebraic mini-DSL。
|
|
2106
|
+
* consumer は createFormulaComputeds(diagram, signals) で computed を得る。
|
|
2107
|
+
* 省略時は空 array 相当で下位互換 (static diagram 動作は不変)。
|
|
2108
|
+
*/
|
|
2109
|
+
formulas?: CdlFormula[];
|
|
2110
|
+
/**
|
|
2111
|
+
* scroll-driven animation triggers (v0.5+、 CAR #245)。
|
|
2112
|
+
* builder chain の `.animation.scroll(id, opts)` で追加、 consumer は createScrollProgressSignal(spec)
|
|
2113
|
+
* で { signal, attach(element), detach } を得て DOM element に bind する。
|
|
2114
|
+
* 省略時は空 array 相当で下位互換。
|
|
2115
|
+
*/
|
|
2116
|
+
scrollTriggers?: CdlScrollTrigger[];
|
|
2117
|
+
/**
|
|
2118
|
+
* event handler bindings (v0.5+、 CAR #246)。
|
|
2119
|
+
* builder chain の `.on.click(target, handlerId)` / `.on.hover(target, handlerId)` で追加、
|
|
2120
|
+
* consumer は attachEventHandlers(root, diagram, handlers) で DOM listener を bind、
|
|
2121
|
+
* event 発火時に handlers[handlerId] を呼出す (signal set / computed 参照 / batch update 等)。
|
|
2122
|
+
* 省略時は空 array 相当で下位互換。
|
|
2123
|
+
*/
|
|
2124
|
+
eventBindings?: CdlEventBinding[];
|
|
2125
|
+
/**
|
|
2126
|
+
* readout widgets (visual displays for signal / state values、 CAR: widget 拡充)。
|
|
2127
|
+
* builder chain の `.readout.bar(id, opts)` / `.gauge` / `.stat` / `.sparkline` で追加。
|
|
2128
|
+
* 省略時は空 array 相当で下位互換。
|
|
2129
|
+
*/
|
|
2130
|
+
readouts?: CdlReadout[];
|
|
2131
|
+
lanes: CdlLane[];
|
|
2132
|
+
nodes: CdlNode[];
|
|
2133
|
+
edges: CdlEdge[];
|
|
2134
|
+
states: CdlState[];
|
|
2135
|
+
phases: CdlPhase[];
|
|
2136
|
+
/** v0.5+ ... canvas 全体仕様 (viewport.width / height で全体 size を author が宣言) */
|
|
2137
|
+
viewport?: CdlViewport;
|
|
2138
|
+
};
|
|
2139
|
+
/** Canvas 全体仕様 (v0.5+ syntax `viewport: { width, height, scale, gap, laneGap, nodeGap, labelMargin }`)。
|
|
2140
|
+
* 未指定時は layout が node 配置から自動算出する従来挙動。
|
|
2141
|
+
*
|
|
2142
|
+
* 細粒度 gap field (laneGap / nodeGap / labelMargin) は viewport.gap (全体 default) を上書きする。
|
|
2143
|
+
* 個別 field 未指定なら viewport.gap → engine default の順で fallback。 */
|
|
2144
|
+
type CdlViewport = {
|
|
2145
|
+
width?: number;
|
|
2146
|
+
height?: number;
|
|
2147
|
+
/**
|
|
2148
|
+
* SVG stage の倍率 (default 1)。 箱 / 文字 / 線 / 間隔のすべてが等比で拡大縮小される。
|
|
2149
|
+
*
|
|
2150
|
+
* 対象は SVG stage だけ。 `CdlDiagramView` が stage の上に描く header と interactive
|
|
2151
|
+
* panel は SVG の外の HTML なので倍率で変わらない。
|
|
2152
|
+
*
|
|
2153
|
+
* 倍率なしと同じ扱いになる値 = 未指定 / 1 との差が 1e-6 未満 / 0 / 負値 / NaN /
|
|
2154
|
+
* ±Infinity。 この時は倍率用の指定を一切出さず、 倍率を導入する前と完全に同一の markup に
|
|
2155
|
+
* なる。 それ以外の値は `[0.125, 8]` に丸める (`scale: 100` なら 8 倍)。
|
|
2156
|
+
*
|
|
2157
|
+
* layout は変わらない。 座標も viewBox も等倍のままで、 変わるのは描画される大きさだけ。
|
|
2158
|
+
* 画面座標との換算は `layout/px-projection.ts` と `dom-verify.ts` にある。
|
|
2159
|
+
*
|
|
2160
|
+
* 倍率を上げると図は親をはみ出す。 収め方 (scroll / pan / clip) は consumer 側の責務。
|
|
2161
|
+
* なお cdl は root に `overflow-hidden` class を出力するので、 それが効く環境では clip
|
|
2162
|
+
* される。 scroll させたい場合はまずその指定を上書きする。
|
|
2163
|
+
*
|
|
2164
|
+
* 間隔を変える `laneGap` / `nodeGap` や、 lane 幅を変える `CdlLane.width` と違い、
|
|
2165
|
+
* 本 field は全要素を等比で拡大する。 各 field の挙動はそれぞれの JSDoc を見る。
|
|
2166
|
+
*
|
|
2167
|
+
* 実装の詳細と、 現在の方式を選んだ理由は `render/stage.tsx` の該当箇所に書く。
|
|
2168
|
+
*/
|
|
2169
|
+
scale?: number;
|
|
2170
|
+
/** 全体 default gap、 個別 laneGap / nodeGap / labelMargin の fallback として使われる (互換維持)。
|
|
2171
|
+
* laneGap の fallback として使われる場合は laneGap と同じ下限 (requiredGap) が適用される。 */
|
|
2172
|
+
gap?: number;
|
|
2173
|
+
/** lanes 間 horizontal gap (default DEFAULT_LANE_GAP=80)。
|
|
2174
|
+
*
|
|
2175
|
+
* **下限つき指定 + 全対均一化**である点に注意。 指定値がそのまま lane 間隔になるとは限らない。
|
|
2176
|
+
* `expandLaneGapsForEdgeLabels` (CAR-470 / Issue #202、 `layout/lanes.ts`) が 2 段階で調整する。
|
|
2177
|
+
*
|
|
2178
|
+
* 段階 1 = 各 隣接 lane 対について、 その対を跨ぐ edge の label が両端 node に被らない
|
|
2179
|
+
* gap を先手で確保する。 指定値が下記を下回ると safety 拡張が優先される。
|
|
2180
|
+
*
|
|
2181
|
+
* requiredGap = computeLabelBoxW(edge.label, edge.sub)
|
|
2182
|
+
* + CLEARANCE_NODE_LABEL * 2 (= 32 * 2)
|
|
2183
|
+
* + EDGE_STUB_OUT * 2 (= 40 * 2)
|
|
2184
|
+
*
|
|
2185
|
+
* 段階 2 = 全対の pitch (lane 中心間距離) を最も広い対の pitch に揃える。
|
|
2186
|
+
* lane diagram の node.cx は lane 中心に固定されるため、 pitch が不揃いだと
|
|
2187
|
+
* visualValidate の row-gap-uniform (Axis 65) が node 間隔のばらつきとして検出する。
|
|
2188
|
+
*
|
|
2189
|
+
* pitch = max(全対の max(currentGap, requiredGap) + 両 lane の半幅和)
|
|
2190
|
+
*
|
|
2191
|
+
* 実測例 (2 lane、 label "msg"、 requiredGap ≈ 236.32)。
|
|
2192
|
+
* laneGap: 0 / 10 / 50 / 80 / 150 / 200 / 236 → いずれも実効 236.32 (safety 拡張が優先)
|
|
2193
|
+
* laneGap: 240 / 300 / 600 → 指定値がそのまま反映
|
|
2194
|
+
*
|
|
2195
|
+
* 3 lane 以上では、 他の対がより広い pitch を要求すると指定値も同じ pitch まで引き上げられる。
|
|
2196
|
+
* lane 幅が均一なら pitch 均一 = gap 均一、 lane 幅が不揃いなら gap ではなく中心間距離が揃う
|
|
2197
|
+
* (node が等間隔に並ぶ)。
|
|
2198
|
+
*
|
|
2199
|
+
* lane 間隔を確実に広げたい場合は、 全対の requiredGap を上回る値を指定する。 */
|
|
2200
|
+
laneGap?: number;
|
|
2201
|
+
/** nodes 間 vertical gap within lane (default DEFAULT_NODE_GAP=24、 内部 row_gap 100 から差し引いて適用) */
|
|
2202
|
+
nodeGap?: number;
|
|
2203
|
+
/** edge label 周辺余白 (default DEFAULT_LABEL_MARGIN=8、 label と node / path の clearance に加算) */
|
|
2204
|
+
labelMargin?: number;
|
|
2205
|
+
};
|
|
2206
|
+
/** Layout 計算結果 (compile 後)、 lane.x は layout で必須解決 */
|
|
2207
|
+
type LaidLane = Omit<CdlLane, "x"> & {
|
|
2208
|
+
x: number;
|
|
2209
|
+
y: number;
|
|
2210
|
+
height: number;
|
|
2211
|
+
};
|
|
2212
|
+
type LaidNode = CdlNode & {
|
|
2213
|
+
cx: number;
|
|
2214
|
+
cy: number;
|
|
2215
|
+
w: number;
|
|
2216
|
+
h: number;
|
|
2217
|
+
/** lane が描く boundary 内側に居るか */
|
|
2218
|
+
insideContainedLane: boolean;
|
|
2219
|
+
};
|
|
2220
|
+
type LaidEdge = CdlEdge & {
|
|
2221
|
+
/** 線 dot 用の visible path d (node 端で stop、 node 内を貫通しない) */
|
|
2222
|
+
d: string;
|
|
2223
|
+
/**
|
|
2224
|
+
* 進行点 glow 用の hidden path d (style="dotted-through" のみ生成、 node 中心同士)。
|
|
2225
|
+
* 粒子の animateMotion mpath 参照先として使い、 粒子が node を貫通する視覚を作る。
|
|
2226
|
+
*/
|
|
2227
|
+
dThrough?: string;
|
|
2228
|
+
fromSide: Side;
|
|
2229
|
+
toSide: Side;
|
|
2230
|
+
labelX: number;
|
|
2231
|
+
labelY: number;
|
|
2232
|
+
labelAnchor: "start" | "middle" | "end";
|
|
2233
|
+
};
|
|
2234
|
+
/**
|
|
2235
|
+
* AABB (axis-aligned bounding box)。
|
|
2236
|
+
* engine がキャンバス上で「ここに何があるか」 を全部 把握するための共通 type。
|
|
2237
|
+
*/
|
|
2238
|
+
type BBox = {
|
|
2239
|
+
/** 要素種別 */
|
|
2240
|
+
kind: "node" | "lane-label" | "edge-label" | "edge-path";
|
|
2241
|
+
/** 元の id (node id / lane id / edge id) */
|
|
2242
|
+
id: string;
|
|
2243
|
+
/** 左端 x */
|
|
2244
|
+
x: number;
|
|
2245
|
+
/** 上端 y */
|
|
2246
|
+
y: number;
|
|
2247
|
+
/** 幅 */
|
|
2248
|
+
w: number;
|
|
2249
|
+
/** 高さ */
|
|
2250
|
+
h: number;
|
|
2251
|
+
};
|
|
2252
|
+
type LaidDiagram = {
|
|
2253
|
+
id: string;
|
|
2254
|
+
topic: string;
|
|
2255
|
+
viewBox: {
|
|
2256
|
+
x: number;
|
|
2257
|
+
y: number;
|
|
2258
|
+
w: number;
|
|
2259
|
+
h: number;
|
|
2260
|
+
};
|
|
2261
|
+
/**
|
|
2262
|
+
* 図全体の倍率 (`CdlViewport.scale` を正規化した値)。
|
|
2263
|
+
*
|
|
2264
|
+
* 素通しではない。 `[0.125, 8]` に丸め、 倍率なしと同じ扱いになる値 (未指定 /
|
|
2265
|
+
* 1 との差が 1e-6 未満 / 0 / 負値 / NaN / ±Infinity) は `undefined` にする。
|
|
2266
|
+
* `scale: 100` なら `8`、 `scale: -1` なら `undefined` が入る。
|
|
2267
|
+
*
|
|
2268
|
+
* layout の座標には掛かっていない = `viewBox` も `nodes[].cx` も等倍のまま。
|
|
2269
|
+
* 描画側 (stage.tsx) が SVG の表示幅 (`width: {k × 100}%`) だけで倍率を表す。
|
|
2270
|
+
* 座標を layout 段階で掛けない理由は、 衝突検出や validation の閾値が
|
|
2271
|
+
* 等倍前提で書かれており、 拡大後の座標で判定すると基準がずれるため。
|
|
2272
|
+
*
|
|
2273
|
+
* consumer が倍率を DOM から読む場合は SVG 要素の `data-cdl-scale` を見る。
|
|
2274
|
+
* 載るのはこの正規化後の値で、 `undefined` のときは属性自体が出ない。
|
|
2275
|
+
*/
|
|
2276
|
+
diagramScale?: number;
|
|
2277
|
+
lanes: LaidLane[];
|
|
2278
|
+
nodes: LaidNode[];
|
|
2279
|
+
edges: LaidEdge[];
|
|
2280
|
+
states: CdlState[];
|
|
2281
|
+
phases: CdlPhase[];
|
|
2282
|
+
/**
|
|
2283
|
+
* キャンバス全要素の bounding box list。
|
|
2284
|
+
* engine が「ここに何があるか」 を全部把握、 衝突検証 / debug 表示 / validation で使う。
|
|
2285
|
+
*/
|
|
2286
|
+
bboxes: BBox[];
|
|
2287
|
+
/** layout で検出された overlap warning list (engine が認識した衝突) */
|
|
2288
|
+
collisions: Array<{
|
|
2289
|
+
a: BBox;
|
|
2290
|
+
b: BBox;
|
|
2291
|
+
overlap_area: number;
|
|
2292
|
+
}>;
|
|
2293
|
+
/**
|
|
2294
|
+
* near-collision = 矩形交差はないが clearance (N px) 未満で接近している組合せ。
|
|
2295
|
+
* 詰まって見える箇所を engine が機械検出するための情報源。
|
|
2296
|
+
*/
|
|
2297
|
+
nearCollisions: Array<{
|
|
2298
|
+
a: BBox;
|
|
2299
|
+
b: BBox;
|
|
2300
|
+
gap: number;
|
|
2301
|
+
required: number;
|
|
2302
|
+
}>;
|
|
2303
|
+
};
|
|
2304
|
+
|
|
2305
|
+
/**
|
|
2306
|
+
* 1 scroll trigger 用の progress signal + attach/detach 制御 handle (CAR #245)。
|
|
2307
|
+
*/
|
|
2308
|
+
type ScrollProgressHandle = {
|
|
2309
|
+
/** progress signal (0..1)。 attach 前は初期値 0、 attach 後 scroll に追随して更新される。 */
|
|
2310
|
+
readonly progress: Signal<number>;
|
|
2311
|
+
/**
|
|
2312
|
+
* 対象 element に scroll listener + IntersectionObserver を attach、 initial progress を計算する。
|
|
2313
|
+
* 二重 attach は前 element を detach してから再 attach する挙動。
|
|
2314
|
+
*/
|
|
2315
|
+
attach: (element: Element) => void;
|
|
2316
|
+
/** 現 element から離脱、 listener + observer を解除。 progress signal は最終値を保持。 */
|
|
2317
|
+
detach: () => void;
|
|
2318
|
+
};
|
|
2319
|
+
/**
|
|
2320
|
+
* diagram の scrollTriggers から progress signal handles を生成 (CAR #245)。
|
|
2321
|
+
* consumer は各 handle の attach(element) を DOM element に対して呼び、 signal.value で progress を read する。
|
|
2322
|
+
*
|
|
2323
|
+
* SSR safe = attach() 呼出前は browser API を触らないので Node.js / SSR 環境でも生成可能。
|
|
2324
|
+
*/
|
|
2325
|
+
declare function createScrollProgressSignals(diagram: CdlDiagram): Record<string, ScrollProgressHandle>;
|
|
2326
|
+
/**
|
|
2327
|
+
* 1 CdlScrollTrigger spec から ScrollProgressHandle を生成。 単体でも export、 動的追加 use case で使う。
|
|
2328
|
+
*/
|
|
2329
|
+
declare function createScrollProgressHandle(spec: CdlScrollTrigger): ScrollProgressHandle;
|
|
2330
|
+
|
|
2331
|
+
/**
|
|
2332
|
+
* consumer が渡す handler map。 handlerId (`.on.click(target, handlerId)` で書いた string) →
|
|
2333
|
+
* 実際の関数。 handler 内で signal を更新することで SVG に reactive 反映される。
|
|
2334
|
+
* signals 引数で input / computed / scroll の全 signal に access 可能。
|
|
2335
|
+
*/
|
|
2336
|
+
type InteractiveHandlerMap = Record<string, (event: Event, signals: InteractiveSignalsAccessor) => void>;
|
|
2337
|
+
/**
|
|
2338
|
+
* handler / consumer が signal に access する API (CAR #255 拡張)。
|
|
2339
|
+
*
|
|
2340
|
+
* 従来 (#253) の `{ input, formula, scroll }` を non-breaking で維持しつつ、 typed 経路を
|
|
2341
|
+
* optional で追加する。 factory (`createInteractiveSignalsAccessor`) 経由の accessor は必ず
|
|
2342
|
+
* 全 member を提供、 手動 mock で 3 member だけ提供する consumer も引き続き compile 通る。
|
|
2343
|
+
*
|
|
2344
|
+
* - `input` は互換性のため `Signal<unknown>` の raw map を維持、 advanced use 経路。
|
|
2345
|
+
* - `set*` は kind 別 typed setter、 kind mismatch は warn + no-op。 optional のため consumer
|
|
2346
|
+
* の mock で欠落しても compile 通る (呼出側は `accessor.setNumber?.(id, v)` or 型 narrowing)。
|
|
2347
|
+
* - `get*` は kind 別 typed getter、 mismatch / 未登録は warn + undefined を返す (setter との
|
|
2348
|
+
* symmetry、 read 側の silent failure も debuggable にする、 codex M2 fix)。
|
|
2349
|
+
* - `warnMissingSignal` = kind check pass 後に signals map から signal が消えている stale
|
|
2350
|
+
* ケースも warn する (codex m3 fix)。
|
|
2351
|
+
*
|
|
2352
|
+
* 従来の `signals.input[id].value = "wrong-type"` は compile pass するが runtime に
|
|
2353
|
+
* default 値へ silent fallback する silent failure を招く。 typed setter 経路で kind 契約を
|
|
2354
|
+
* 明示することで consumer handler の実装ミスを早期検出する。
|
|
2355
|
+
*/
|
|
2356
|
+
type InteractiveSignalsAccessor = {
|
|
2357
|
+
/** 互換 raw map (advanced use)、 typed setter / getter を優先すること */
|
|
2358
|
+
input: Record<string, Signal<unknown>>;
|
|
2359
|
+
formula: Record<string, Computed<number | boolean>>;
|
|
2360
|
+
scroll: Record<string, ScrollProgressHandle>;
|
|
2361
|
+
/**
|
|
2362
|
+
* 以下 6 member は optional。 factory 経由の accessor は必ず提供、 手動 mock で 3 member
|
|
2363
|
+
* だけ提供する consumer も compile 通る (codex M1 non-breaking 保証)。
|
|
2364
|
+
* consumer が呼び出す時は factory 由来と分かっている場面が多いが、 mock 対応で
|
|
2365
|
+
* `accessor.setNumber?.(id, value)` パターンも許容される。
|
|
2366
|
+
*/
|
|
2367
|
+
/** number 型 signal (slider / number) に value を書き込む、 kind mismatch は warn + no-op */
|
|
2368
|
+
setNumber?: (id: string, value: number) => void;
|
|
2369
|
+
/** string 型 signal (dropdown) に value を書き込む、 kind mismatch は warn + no-op */
|
|
2370
|
+
setString?: (id: string, value: string) => void;
|
|
2371
|
+
/** boolean 型 signal (toggle) に value を書き込む、 kind mismatch は warn + no-op */
|
|
2372
|
+
setBool?: (id: string, value: boolean) => void;
|
|
2373
|
+
/** number 型 signal の値を取得、 mismatch / 未登録は warn + undefined */
|
|
2374
|
+
getNumber?: (id: string) => number | undefined;
|
|
2375
|
+
/** string 型 signal の値を取得、 mismatch / 未登録は warn + undefined */
|
|
2376
|
+
getString?: (id: string) => string | undefined;
|
|
2377
|
+
/** boolean 型 signal の値を取得、 mismatch / 未登録は warn + undefined */
|
|
2378
|
+
getBool?: (id: string) => boolean | undefined;
|
|
2379
|
+
};
|
|
2380
|
+
/**
|
|
2381
|
+
* accessor を diagram + signals から構築する SSOT (CAR #255)。
|
|
2382
|
+
*
|
|
2383
|
+
* diagram.inputs から kind map を構築、 各 typed setter / getter で id → 期待 kind を
|
|
2384
|
+
* runtime check する。 mismatch / 未登録 / signals map stale は console.warn + no-op or
|
|
2385
|
+
* undefined (throw ではない = production の user session を crash させない、 dev 環境で
|
|
2386
|
+
* 気付ける、 の両立)。
|
|
2387
|
+
*/
|
|
2388
|
+
declare function createInteractiveSignalsAccessor(diagram: CdlDiagram, signals: Record<string, Signal<unknown>>, formula: Record<string, Computed<number | boolean>>, scroll: Record<string, ScrollProgressHandle>): InteractiveSignalsAccessor & Required<Omit<InteractiveSignalsAccessor, "input" | "formula" | "scroll">>;
|
|
2389
|
+
declare function computeInputSignalKey(diagram: CdlDiagram): string;
|
|
2390
|
+
declare function computeFormulaKey(diagram: CdlDiagram): string;
|
|
2391
|
+
declare function computeScrollTriggerKey(diagram: CdlDiagram): string;
|
|
2392
|
+
/**
|
|
2393
|
+
* event binding の schema key、 event handler useEffect の invalidation を diagram identity
|
|
2394
|
+
* から narrow するための SSOT (CAR #264)。 event + target 形状 + handlerId が同じなら key
|
|
2395
|
+
* は同一、 caller が毎 render 新 diagram object を渡しても event handler の detach/reattach
|
|
2396
|
+
* が起きない (hover 中の miss window / observer churn を防ぐ)。
|
|
2397
|
+
*/
|
|
2398
|
+
declare function computeEventBindingKey(diagram: CdlDiagram): string;
|
|
2399
|
+
/**
|
|
2400
|
+
* diagram 内 interactive primitive の有無判定 (SSR safe、 window / DOM 触らない)。
|
|
2401
|
+
*/
|
|
2402
|
+
declare function hasInteractivePrimitives(diagram: CdlDiagram): boolean;
|
|
2403
|
+
|
|
2404
|
+
type CdlDiagramViewProps = {
|
|
2405
|
+
diagram: CdlDiagram;
|
|
2406
|
+
/**
|
|
2407
|
+
* 配置まで済ませた図。 渡すとここでは組み立て直さない。
|
|
2408
|
+
*
|
|
2409
|
+
* 呼出側が既に `compile` を呼んでいる場合 (組み立ての結果を検査や図枠の原点に使う等)、
|
|
2410
|
+
* ここで測り直すと同じ図の配置を 2 度計算する。 図の規模に比例して重く、 辺 500 本で
|
|
2411
|
+
* 約 300ms かかる (実測)。
|
|
2412
|
+
*
|
|
2413
|
+
* 渡す時は `diagram` と対にする。 別の図の配置を渡すと、 描く内容と位置がずれる。
|
|
2414
|
+
* 対応が取れているかはここでは確かめない (確かめる費用が、 省く費用を上回る)。
|
|
2415
|
+
*/
|
|
2416
|
+
laid?: LaidDiagram;
|
|
2417
|
+
hideHeader?: boolean;
|
|
2418
|
+
/**
|
|
2419
|
+
* `hideHeader` 時に下部へ出る phase の小さな指標 (点列 + 現在 phase の題) を出さない。
|
|
2420
|
+
*
|
|
2421
|
+
* 下流が独自の phase UI を持つ場合に使う。 CSS で消す形にすると、 こちらの class 名や
|
|
2422
|
+
* 要素構造が変わった時に黙って効かなくなる (下流の hack が壊れたことに気付けない)。
|
|
2423
|
+
*/
|
|
2424
|
+
hideMiniPhaseIndicator?: boolean;
|
|
2425
|
+
focusPhaseId?: string;
|
|
2426
|
+
/** debug mode = engine の bbox + collision を半透明で重ね描き (開発確認用) */
|
|
2427
|
+
debug?: boolean;
|
|
2428
|
+
/**
|
|
2429
|
+
* dev warn mode = 生成時に visualValidate を走らせ warn / error を console に流す。
|
|
2430
|
+
* default = process.env.NODE_ENV === "development" 相当を caller 側で判定して渡す設計。
|
|
2431
|
+
* true 明示指定で production build でも有効化可 (Playwright 実測時など)。
|
|
2432
|
+
*/
|
|
2433
|
+
emitGeometryWarn?: boolean;
|
|
2434
|
+
/**
|
|
2435
|
+
* CdlHeader 内 phase title の heading tag level (2 | 3 | 4)、 default 3。
|
|
2436
|
+
* downstream で h1 直後配置なら 2、 h2 直後なら 3 (default)、 h3 直後なら 4 を渡す。
|
|
2437
|
+
* heading order skip を防ぐ用途、 hideHeader=true 時は無視される。
|
|
2438
|
+
*/
|
|
2439
|
+
headingLevel?: 2 | 3 | 4;
|
|
2440
|
+
/**
|
|
2441
|
+
* interactive event handler 関数 map (CAR #246 / render integration)。
|
|
2442
|
+
* diagram.eventBindings が非空の時、 handlerId → (event, signals) => void の map で consumer が
|
|
2443
|
+
* signal 更新 etc を実装する。 未指定の場合 event handler は skip される。
|
|
2444
|
+
*/
|
|
2445
|
+
interactiveHandlers?: InteractiveHandlerMap;
|
|
2446
|
+
};
|
|
2447
|
+
declare function CdlDiagramView({ diagram, laid: laidProp, hideHeader, hideMiniPhaseIndicator, focusPhaseId, debug, emitGeometryWarn, headingLevel, interactiveHandlers }: CdlDiagramViewProps): JSX.Element;
|
|
2448
|
+
|
|
2449
|
+
export { computed as A, type BBox as B, type CdlDiagram as C, createInteractiveSignalsAccessor as D, type EdgeStyle as E, createScrollProgressHandle as F, createScrollProgressSignals as G, hasInteractivePrimitives as H, type InteractiveHandlerMap as I, signal as J, type LaidDiagram as L, type NodeKind as N, type Signal as S, type Tone as T, type CdlInput as a, type CdlLane as b, type CdlNode as c, type Side as d, type CdlState as e, type CdlEventTarget as f, type Computed as g, type CdlScrollTrigger as h, type CdlDiagramViewProps as i, type LaidEdge as j, type LaidNode as k, type CdlEdge as l, CdlDiagramView as m, type CdlEventBinding as n, type CdlEventKind as o, type CdlFormula as p, type CdlPhase as q, type InteractiveSignalsAccessor as r, type LaidLane as s, NODE_KINDS as t, type ScrollProgressHandle as u, TONES as v, computeEventBindingKey as w, computeFormulaKey as x, computeInputSignalKey as y, computeScrollTriggerKey as z };
|