@cardenelabs/cdl 0.5.0 → 0.6.1
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/README.md +3 -3
- package/dist/index.cjs +1352 -1258
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +61 -44
- package/dist/index.d.ts +61 -44
- package/dist/index.js +1349 -1258
- package/dist/index.js.map +1 -1
- package/dist/react.cjs +2732 -2592
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +1 -1
- package/dist/react.d.ts +1 -1
- package/dist/react.js +2732 -2592
- package/dist/react.js.map +1 -1
- package/dist/{render-C78lIXeC.d.cts → render-DquCvgOB.d.cts} +65 -14
- package/dist/{render-C78lIXeC.d.ts → render-DquCvgOB.d.ts} +65 -14
- package/package.json +1 -1
- package/src/formula/parser.ts +35 -0
- package/src/index.ts +24 -4
- package/src/kinds/chart-bar.tsx +13 -2
- package/src/kinds/chart-line.tsx +13 -3
- package/src/kinds/chart-pie.tsx +13 -2
- package/src/kinds/dyn-shape.tsx +3 -2
- package/src/kinds/funnel.tsx +16 -3
- package/src/kinds/gantt.tsx +16 -3
- package/src/kinds/generic.tsx +9 -5
- package/src/kinds/quadrant.tsx +16 -3
- package/src/kinds/user-journey.tsx +24 -9
- package/src/layout/spec.ts +1 -2
- package/src/layout/tokens.ts +1 -2
- package/src/layout.ts +1 -0
- package/src/presets.ts +7 -100
- package/src/render/derived-values.ts +261 -0
- package/src/render/nodes.tsx +14 -12
- package/src/render/payload-binding.ts +196 -0
- package/src/render/utils.ts +47 -3
- package/src/template-name.ts +43 -0
- package/src/types.ts +72 -18
- package/src/validate.ts +42 -9
- package/src/visual-validate.ts +10 -10
- package/src/kinds/mind-radial.tsx +0 -209
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as CdlDiagram, S as Signal, a as CdlInput, b as CdlLane, c as CdlNode, T as Tone, d as Side, E as EdgeStyle, e as CdlState, f as CdlEventTarget, g as Computed, h as CdlScrollTrigger, L as LaidDiagram,
|
|
2
|
-
export {
|
|
1
|
+
import { C as CdlDiagram, S as Signal, a as CdlInput, b as CdlLane, c as CdlNode, T as Tone, d as Side, E as EdgeStyle, e as CdlState, f as CdlEventTarget, g as Computed, h as CdlDerivedValue, i as CdlScrollTrigger, L as LaidDiagram, j as CdlDiagramViewProps, k as LaidEdge, l as LaidNode, m as CdlEdge, B as BBox, N as NodeKind, J as JourneyEmotion, Q as QuadrantKey } from './render-DquCvgOB.cjs';
|
|
2
|
+
export { n as CdlDiagramView, o as CdlEventBinding, p as CdlEventKind, q as CdlFormula, r as CdlPhase, I as InteractiveHandlerMap, s as InteractiveSignalsAccessor, t as LaidLane, u as NODE_KINDS, v as ScrollProgressHandle, w as TONES, x as computeEventBindingKey, y as computeFormulaKey, z as computeInputSignalKey, A as computeScrollTriggerKey, D as computed, F as createInteractiveSignalsAccessor, G as createScrollProgressHandle, H as createScrollProgressSignals, K as hasInteractivePrimitives, M as signal } from './render-DquCvgOB.cjs';
|
|
3
3
|
import { JSX } from 'react';
|
|
4
4
|
|
|
5
5
|
declare function effect(fn: () => void | (() => void)): () => void;
|
|
@@ -1259,6 +1259,44 @@ declare function evaluate(ast: FormulaAst, ctxOrResolver: FormulaContext | Formu
|
|
|
1259
1259
|
*/
|
|
1260
1260
|
declare function createFormulaComputeds(diagram: CdlDiagram, signals: Record<string, Signal<unknown>>): Record<string, Computed<number | boolean>>;
|
|
1261
1261
|
|
|
1262
|
+
/**
|
|
1263
|
+
* 他の値から自動で決まる値を解く層 (cdl#453 / dragon#1161 段 1)。
|
|
1264
|
+
*
|
|
1265
|
+
* 段 (`animation`) が動かす値を出した後に、 参照の関係から順序を決めて式を評価する。
|
|
1266
|
+
* 段の補間中も毎 frame ここを通るため、 掛け算 / 割り算 / 比較 / `min` / `max` のような
|
|
1267
|
+
* 端点 2 点では表せない関係も途中の値が正しくなる。
|
|
1268
|
+
*
|
|
1269
|
+
* 止まった値は結果に載せない。 載せなければ図には `{名前}` が残り、 読み手
|
|
1270
|
+
* (`resolveNumericAttr` / `payload-binding` / `visibleIf`) が既に持っている
|
|
1271
|
+
* 「解決できていない」 の扱いにそのまま乗る。 伝えるための経路を新設しない。
|
|
1272
|
+
*
|
|
1273
|
+
* ただし同じ名前が `states` にもある場合は、 段が出した初期値をそのまま残す
|
|
1274
|
+
* (「まだ計算されていない間の値」 として使う)。
|
|
1275
|
+
*/
|
|
1276
|
+
/** 値が止まった理由。 呼び出し側が伝え方を決められるように種類を分けておく */
|
|
1277
|
+
type DerivedNoticeKind = "cycle" | "unknown-reference" | "parse-error" | "eval-error" | "duplicate-id" | "invalid-id";
|
|
1278
|
+
type DerivedNotice = {
|
|
1279
|
+
/** 止まった値の名前 */
|
|
1280
|
+
id: string;
|
|
1281
|
+
kind: DerivedNoticeKind;
|
|
1282
|
+
message: string;
|
|
1283
|
+
};
|
|
1284
|
+
type DerivedResult = {
|
|
1285
|
+
/** 段の値に、 解けた値を足したもの */
|
|
1286
|
+
values: Record<string, string>;
|
|
1287
|
+
/** 止まった値。 解けた値しか無ければ空 */
|
|
1288
|
+
notices: DerivedNotice[];
|
|
1289
|
+
};
|
|
1290
|
+
/**
|
|
1291
|
+
* 段の値に、 他の値から決まる値を足して返す。
|
|
1292
|
+
*
|
|
1293
|
+
* 宣言が無ければ受け取った値をそのまま返す (同じ object をそのまま返すので、
|
|
1294
|
+
* 宣言を持たない図は追加の割当てを 1 つも払わない)。
|
|
1295
|
+
*/
|
|
1296
|
+
declare function applyDerivedValues(base: Record<string, string>, derived: readonly CdlDerivedValue[] | undefined): DerivedResult;
|
|
1297
|
+
/** 段の値に、 他の値から決まる値を足した record だけを返す (伝える情報が要らない呼び出し用) */
|
|
1298
|
+
declare function withDerivedValues(base: Record<string, string>, derived: readonly CdlDerivedValue[] | undefined): Record<string, string>;
|
|
1299
|
+
|
|
1262
1300
|
/**
|
|
1263
1301
|
* scroll progress 計算 (pure function、 CAR #245)。
|
|
1264
1302
|
*
|
|
@@ -3013,7 +3051,7 @@ type TreeBuilder = {
|
|
|
3013
3051
|
* .build();
|
|
3014
3052
|
*/
|
|
3015
3053
|
declare function tree(preset: TreePreset): TreeBuilder;
|
|
3016
|
-
|
|
3054
|
+
|
|
3017
3055
|
type JourneyStep = {
|
|
3018
3056
|
id: string;
|
|
3019
3057
|
title: string;
|
|
@@ -3111,7 +3149,7 @@ type FunnelBuilder = {
|
|
|
3111
3149
|
* .build();
|
|
3112
3150
|
*/
|
|
3113
3151
|
declare function funnel(preset: FunnelPreset): FunnelBuilder;
|
|
3114
|
-
type QuadrantQuadrantLabel =
|
|
3152
|
+
type QuadrantQuadrantLabel = QuadrantKey;
|
|
3115
3153
|
type QuadrantItem = {
|
|
3116
3154
|
id: string;
|
|
3117
3155
|
title: string;
|
|
@@ -3368,48 +3406,27 @@ type StateMachine2Builder = {
|
|
|
3368
3406
|
* .build();
|
|
3369
3407
|
*/
|
|
3370
3408
|
declare function stateMachine2(preset: StateMachine2Preset): StateMachine2Builder;
|
|
3371
|
-
|
|
3372
|
-
id: string;
|
|
3373
|
-
title: string;
|
|
3374
|
-
/** 色 tone (default は defaultTone)。 8 方向で auto rotate も可 */
|
|
3375
|
-
tone?: Tone;
|
|
3376
|
-
subtitle?: string;
|
|
3377
|
-
};
|
|
3378
|
-
type MindMapRadialPreset = {
|
|
3379
|
-
id: string;
|
|
3380
|
-
topic: string;
|
|
3381
|
-
/** 中心 node の title (id は builder が "center" で内部生成) */
|
|
3382
|
-
centerTitle: string;
|
|
3383
|
-
/** 中心 node の id override (default "center") */
|
|
3384
|
-
centerId?: string;
|
|
3385
|
-
/** 中心から branch までの距離 (world coord、 default 350) */
|
|
3386
|
-
radius?: number;
|
|
3387
|
-
/** branch node の width (default 260) */
|
|
3388
|
-
branchWidth?: number;
|
|
3389
|
-
/** 中心 node の width (default 260) */
|
|
3390
|
-
centerWidth?: number;
|
|
3391
|
-
defaultTone?: Tone;
|
|
3392
|
-
};
|
|
3393
|
-
type MindMapRadialBuilder = {
|
|
3394
|
-
branch: (b: MindMapRadialBranch) => MindMapRadialBuilder;
|
|
3395
|
-
build: () => ReturnType<DiagramBuilder["build"]>;
|
|
3396
|
-
};
|
|
3409
|
+
|
|
3397
3410
|
/**
|
|
3398
|
-
*
|
|
3399
|
-
*
|
|
3411
|
+
* 全 state の現時点 value を計算 (現在 phase + これまでの phase の最終 tween 値を集約)。
|
|
3412
|
+
* - set = 即時切替 (phase 到達で value 上書き、 lerp なし)
|
|
3413
|
+
* - tween = 数値補間 (現 phase 中は progress で lerp、 過去 phase は to 固定)
|
|
3400
3414
|
*
|
|
3401
|
-
*
|
|
3402
|
-
*
|
|
3403
|
-
*
|
|
3415
|
+
* 段の値を出した後に `laid.derived` (他の値から自動で決まる値) を参照順で解いて足す。
|
|
3416
|
+
* 毎 frame ここを通るので、 掛け算 / 比較のような端点 2 点では表せない関係も途中の値が
|
|
3417
|
+
* 正しくなる。 同じ名前が `states` にもある場合は解けた値が勝ち、 解けなければ初期値が残る。
|
|
3418
|
+
*/
|
|
3419
|
+
declare function computeStateValues(laid: LaidDiagram, phaseIdx: number, progress: number): Record<string, string>;
|
|
3420
|
+
/**
|
|
3421
|
+
* template literal `{stateId}` を values map で置換 (未解決は `{id}` のまま)。
|
|
3422
|
+
* array signal 拡張 (SSOT): 値が JSON array (例 `"[1,2,3]"`) の signal に対しては、
|
|
3423
|
+
* `{sig[0]}` = 要素 0 の値、 `{sig.length}` = 要素数、
|
|
3424
|
+
* `{sig.sum}` / `{sig.max}` / `{sig.min}` / `{sig.avg}` = 数値集約 (非数値 element は 0 扱い)。
|
|
3425
|
+
* array 記法対象外 signal は従来通り `{sig}` で単純置換。
|
|
3404
3426
|
*
|
|
3405
|
-
*
|
|
3406
|
-
*
|
|
3407
|
-
* .branch({ id: "users", title: "Users" }) // 0° (right)
|
|
3408
|
-
* .branch({ id: "road", title: "Roadmap" }) // 45° (bottom-right)
|
|
3409
|
-
* .branch({ id: "metrics", title: "Metrics" }) // 90° (bottom)
|
|
3410
|
-
* ...
|
|
3411
|
-
* .build();
|
|
3427
|
+
* 名前に使える文字は `template-name.ts` が決める (engine 全体で 1 つ)。 ここだけで
|
|
3428
|
+
* 定義すると、 式を書ける側との間で「読めるが書けない」 「書けるが読めない」 名前ができる。
|
|
3412
3429
|
*/
|
|
3413
|
-
declare function
|
|
3430
|
+
declare function interpolate(template: string, values: Record<string, string>): string;
|
|
3414
3431
|
|
|
3415
|
-
export { ARROW_ANGLE_MAX_DEG, ARROW_ENDPOINT_CENTER_TOL, type AnimationChain, type AuthorIntentOptions, type AuthorIntentReport, type BinaryOp, CHAIN_MIN_CLEARANCE, CHAIN_SHIFT_MAX_ACCUMULATED, CHAIN_SHIFT_MAX_ITER, CLEARANCE_LABEL_LABEL, CLEARANCE_LANE_LABEL, CLEARANCE_NODE_LABEL, CLEARANCE_PATH_LABEL, COLUMN_GAP_VARIANCE_TOL, CdlDiagram, CdlDiagramThumbnail, CdlEdge, type CdlEventHandler, CdlEventTarget, CdlInput, CdlLane, CdlNode, CdlScrollTrigger, CdlState, type ChartBuilder, type ChartDatum, type ChartPreset, type ChartType, type ClassDiagramBuilder, type ClassDiagramPreset, type ClassRelationType, Computed, DETOUR_GAP, DETOUR_SLOT_GAP, DIST_LABEL_PATH_MAX, DIST_LABEL_PATH_MIN, type DiagramAdapter, type DiagramBuilder, type Discrepancy, type DiscrepancyKind, type DomVerifyReport, EDGE_LABEL_TEXT, EDGE_STUB_OUT, type EdgeLabelLine, type EdgeLabelTextSpec, EdgeStyle, type ErBuilder, type ErEntity, type ErPreset, type ErRelation, type ErRelationCardinality, type EventAttachHandle, type EventChain, FAN_GAP, FONT_RENDER_TOLERANCE_WORLD, type FlowBuilder, type FlowPreset, type FlowStepInput, type FlowchartBuilder, type FlowchartEdge, type FlowchartNode, type FlowchartNodeShape, type FlowchartPreset, type FormulaAst, type FormulaContext, type FsmState, type FsmStateNested, type FsmTransition, type FsmTransitionExt, type FunnelBuilder, type FunnelPreset, type FunnelStage, type GanttBuilder, type GanttPreset, type GanttTask, type GenericDiagramSpec, type GenericDiscrepancy, type GenericDiscrepancyKind, type GenericVerifyOptions, type Rect as GeometryRect, type Segment as GeometrySegment, type InfraConnection, type InfraNode, type InfrastructureBuilder, type InfrastructurePreset, type InputChain, type IntentDiscrepancy, type IntentDiscrepancyKind,
|
|
3432
|
+
export { ARROW_ANGLE_MAX_DEG, ARROW_ENDPOINT_CENTER_TOL, type AnimationChain, type AuthorIntentOptions, type AuthorIntentReport, type BinaryOp, CHAIN_MIN_CLEARANCE, CHAIN_SHIFT_MAX_ACCUMULATED, CHAIN_SHIFT_MAX_ITER, CLEARANCE_LABEL_LABEL, CLEARANCE_LANE_LABEL, CLEARANCE_NODE_LABEL, CLEARANCE_PATH_LABEL, COLUMN_GAP_VARIANCE_TOL, CdlDerivedValue, CdlDiagram, CdlDiagramThumbnail, CdlEdge, type CdlEventHandler, CdlEventTarget, CdlInput, CdlLane, CdlNode, CdlScrollTrigger, CdlState, type ChartBuilder, type ChartDatum, type ChartPreset, type ChartType, type ClassDiagramBuilder, type ClassDiagramPreset, type ClassRelationType, Computed, DETOUR_GAP, DETOUR_SLOT_GAP, DIST_LABEL_PATH_MAX, DIST_LABEL_PATH_MIN, type DerivedNotice, type DerivedNoticeKind, type DerivedResult, type DiagramAdapter, type DiagramBuilder, type Discrepancy, type DiscrepancyKind, type DomVerifyReport, EDGE_LABEL_TEXT, EDGE_STUB_OUT, type EdgeLabelLine, type EdgeLabelTextSpec, EdgeStyle, type ErBuilder, type ErEntity, type ErPreset, type ErRelation, type ErRelationCardinality, type EventAttachHandle, type EventChain, FAN_GAP, FONT_RENDER_TOLERANCE_WORLD, type FlowBuilder, type FlowPreset, type FlowStepInput, type FlowchartBuilder, type FlowchartEdge, type FlowchartNode, type FlowchartNodeShape, type FlowchartPreset, type FormulaAst, type FormulaContext, type FsmState, type FsmStateNested, type FsmTransition, type FsmTransitionExt, type FunnelBuilder, type FunnelPreset, type FunnelStage, type GanttBuilder, type GanttPreset, type GanttTask, type GenericDiagramSpec, type GenericDiscrepancy, type GenericDiscrepancyKind, type GenericVerifyOptions, type Rect as GeometryRect, type Segment as GeometrySegment, type InfraConnection, type InfraNode, type InfrastructureBuilder, type InfrastructurePreset, type InputChain, type IntentDiscrepancy, type IntentDiscrepancyKind, JourneyEmotion, type JourneyStep, LABEL_INIT_CLEARANCE, LABEL_INIT_CLEARANCE_DOTTED_FLOW, LABEL_SIZE_TOLERANCE_WORLD, LABEL_TO_PATH_CLEARANCE, LANE_BORDER_CLEARANCE_TOL, LaidDiagram, LaidEdge, LaidNode, type LayoutWithValidationOptions, type LayoutWithValidationResult, MARKER_GLOW_RADIUS, MIN_COLUMN_ALIGNMENT_TOLERANCE, MIN_ROW_ALIGNMENT_TOLERANCE, type MathFnName, type MindBranch, type MindMapBuilder, type MindMapPreset, NEAR_COLLISION_DEFAULT_MIN, NEAR_COLLISION_POLICY, NODE_FRAME_SELECTOR, type NetworkBuilder, type NetworkDevice, type NetworkDeviceKind, type NetworkLink, type NetworkPreset, NodeKind, type PageLike, type PhaseBuilder, type QuadrantBuilder, type QuadrantItem, type QuadrantPreset, type QuadrantQuadrantLabel, ROW_GAP_VARIANCE_TOL, SPEC_CLEARANCE_POLICY, STAGE_SVG_SELECTOR, type SequenceBuilder, type SequencePreset, type SequenceStep, Side, Signal, type StateMachine2Builder, type StateMachine2Preset, type StateMachineBuilder, type StateMachinePreset, type SweepReport, type SwimlanePreset, TARGET_LABEL_PATH_DIST, Tone, type TopologyBuilder, type TopologyConnection, type TopologyContainer, type TopologyGroupBuilder, type TopologyPreset, type TreeBuilder, type TreeNode, type TreePreset, type UmlClass, type UmlRelation, type UserJourneyBuilder, type UserJourneyPreset, type ValidateOptions, type ValidationProfile, type VerifyOptions, type Violation, type VisualAxis, type VisualValidationReport, WCAG_AA_LARGE, WCAG_AA_NORMAL, applyDerivedValues, assertNever, attachEventHandlers, batch, bboxClearance, bboxDiffWorld, cdlAdapter, chart, classDiagram, compile, computeScrollProgress, computeStateValues, computeViewportScale, countEdgeCrossings, createFormulaComputeds, createInputSignals, diagram, effect, er, evaluate as evaluateFormula, extractIdentifiers, flow, flowchart, funnel, gantt, infrastructure, inputDefaultValue, interpolate, isLargeText, labelInitClearance, layout, layoutWithValidation, mindMap, network, parseFormula, pointRectEdgeDistance, pointToSegmentDistance, predictLabelBBoxWorld, predictNodeBBoxWorld, projectEdgeLabel, projectNode, projectPathSegment, pxToWorld, quadrant, rectRectClearance, rectRectOverlapArea, rendersRows, requiredContrastRatio, requiredNearClearance, requiredRowsHeight, requiredRowsWidth, requiredSpecClearance, resolveEdgeLabelOverlapsWithChain, resolveEdgeLabelOverlapsWithChainAndPropagate, resolveOverlapsWithChain, resolveTarget, resolveTargetAll, segmentsIntersect, sequence, stateMachine, stateMachine2, swimlane, topology, tree, untrack, userJourney, validate, verifyAllDiagramsDom, verifyAuthorIntent, verifyAuthorIntentAll, verifyDiagramDom, visualValidate, visualValidateAll, visualValidateLaid, withDerivedValues, worldToPx };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as CdlDiagram, S as Signal, a as CdlInput, b as CdlLane, c as CdlNode, T as Tone, d as Side, E as EdgeStyle, e as CdlState, f as CdlEventTarget, g as Computed, h as CdlScrollTrigger, L as LaidDiagram,
|
|
2
|
-
export {
|
|
1
|
+
import { C as CdlDiagram, S as Signal, a as CdlInput, b as CdlLane, c as CdlNode, T as Tone, d as Side, E as EdgeStyle, e as CdlState, f as CdlEventTarget, g as Computed, h as CdlDerivedValue, i as CdlScrollTrigger, L as LaidDiagram, j as CdlDiagramViewProps, k as LaidEdge, l as LaidNode, m as CdlEdge, B as BBox, N as NodeKind, J as JourneyEmotion, Q as QuadrantKey } from './render-DquCvgOB.js';
|
|
2
|
+
export { n as CdlDiagramView, o as CdlEventBinding, p as CdlEventKind, q as CdlFormula, r as CdlPhase, I as InteractiveHandlerMap, s as InteractiveSignalsAccessor, t as LaidLane, u as NODE_KINDS, v as ScrollProgressHandle, w as TONES, x as computeEventBindingKey, y as computeFormulaKey, z as computeInputSignalKey, A as computeScrollTriggerKey, D as computed, F as createInteractiveSignalsAccessor, G as createScrollProgressHandle, H as createScrollProgressSignals, K as hasInteractivePrimitives, M as signal } from './render-DquCvgOB.js';
|
|
3
3
|
import { JSX } from 'react';
|
|
4
4
|
|
|
5
5
|
declare function effect(fn: () => void | (() => void)): () => void;
|
|
@@ -1259,6 +1259,44 @@ declare function evaluate(ast: FormulaAst, ctxOrResolver: FormulaContext | Formu
|
|
|
1259
1259
|
*/
|
|
1260
1260
|
declare function createFormulaComputeds(diagram: CdlDiagram, signals: Record<string, Signal<unknown>>): Record<string, Computed<number | boolean>>;
|
|
1261
1261
|
|
|
1262
|
+
/**
|
|
1263
|
+
* 他の値から自動で決まる値を解く層 (cdl#453 / dragon#1161 段 1)。
|
|
1264
|
+
*
|
|
1265
|
+
* 段 (`animation`) が動かす値を出した後に、 参照の関係から順序を決めて式を評価する。
|
|
1266
|
+
* 段の補間中も毎 frame ここを通るため、 掛け算 / 割り算 / 比較 / `min` / `max` のような
|
|
1267
|
+
* 端点 2 点では表せない関係も途中の値が正しくなる。
|
|
1268
|
+
*
|
|
1269
|
+
* 止まった値は結果に載せない。 載せなければ図には `{名前}` が残り、 読み手
|
|
1270
|
+
* (`resolveNumericAttr` / `payload-binding` / `visibleIf`) が既に持っている
|
|
1271
|
+
* 「解決できていない」 の扱いにそのまま乗る。 伝えるための経路を新設しない。
|
|
1272
|
+
*
|
|
1273
|
+
* ただし同じ名前が `states` にもある場合は、 段が出した初期値をそのまま残す
|
|
1274
|
+
* (「まだ計算されていない間の値」 として使う)。
|
|
1275
|
+
*/
|
|
1276
|
+
/** 値が止まった理由。 呼び出し側が伝え方を決められるように種類を分けておく */
|
|
1277
|
+
type DerivedNoticeKind = "cycle" | "unknown-reference" | "parse-error" | "eval-error" | "duplicate-id" | "invalid-id";
|
|
1278
|
+
type DerivedNotice = {
|
|
1279
|
+
/** 止まった値の名前 */
|
|
1280
|
+
id: string;
|
|
1281
|
+
kind: DerivedNoticeKind;
|
|
1282
|
+
message: string;
|
|
1283
|
+
};
|
|
1284
|
+
type DerivedResult = {
|
|
1285
|
+
/** 段の値に、 解けた値を足したもの */
|
|
1286
|
+
values: Record<string, string>;
|
|
1287
|
+
/** 止まった値。 解けた値しか無ければ空 */
|
|
1288
|
+
notices: DerivedNotice[];
|
|
1289
|
+
};
|
|
1290
|
+
/**
|
|
1291
|
+
* 段の値に、 他の値から決まる値を足して返す。
|
|
1292
|
+
*
|
|
1293
|
+
* 宣言が無ければ受け取った値をそのまま返す (同じ object をそのまま返すので、
|
|
1294
|
+
* 宣言を持たない図は追加の割当てを 1 つも払わない)。
|
|
1295
|
+
*/
|
|
1296
|
+
declare function applyDerivedValues(base: Record<string, string>, derived: readonly CdlDerivedValue[] | undefined): DerivedResult;
|
|
1297
|
+
/** 段の値に、 他の値から決まる値を足した record だけを返す (伝える情報が要らない呼び出し用) */
|
|
1298
|
+
declare function withDerivedValues(base: Record<string, string>, derived: readonly CdlDerivedValue[] | undefined): Record<string, string>;
|
|
1299
|
+
|
|
1262
1300
|
/**
|
|
1263
1301
|
* scroll progress 計算 (pure function、 CAR #245)。
|
|
1264
1302
|
*
|
|
@@ -3013,7 +3051,7 @@ type TreeBuilder = {
|
|
|
3013
3051
|
* .build();
|
|
3014
3052
|
*/
|
|
3015
3053
|
declare function tree(preset: TreePreset): TreeBuilder;
|
|
3016
|
-
|
|
3054
|
+
|
|
3017
3055
|
type JourneyStep = {
|
|
3018
3056
|
id: string;
|
|
3019
3057
|
title: string;
|
|
@@ -3111,7 +3149,7 @@ type FunnelBuilder = {
|
|
|
3111
3149
|
* .build();
|
|
3112
3150
|
*/
|
|
3113
3151
|
declare function funnel(preset: FunnelPreset): FunnelBuilder;
|
|
3114
|
-
type QuadrantQuadrantLabel =
|
|
3152
|
+
type QuadrantQuadrantLabel = QuadrantKey;
|
|
3115
3153
|
type QuadrantItem = {
|
|
3116
3154
|
id: string;
|
|
3117
3155
|
title: string;
|
|
@@ -3368,48 +3406,27 @@ type StateMachine2Builder = {
|
|
|
3368
3406
|
* .build();
|
|
3369
3407
|
*/
|
|
3370
3408
|
declare function stateMachine2(preset: StateMachine2Preset): StateMachine2Builder;
|
|
3371
|
-
|
|
3372
|
-
id: string;
|
|
3373
|
-
title: string;
|
|
3374
|
-
/** 色 tone (default は defaultTone)。 8 方向で auto rotate も可 */
|
|
3375
|
-
tone?: Tone;
|
|
3376
|
-
subtitle?: string;
|
|
3377
|
-
};
|
|
3378
|
-
type MindMapRadialPreset = {
|
|
3379
|
-
id: string;
|
|
3380
|
-
topic: string;
|
|
3381
|
-
/** 中心 node の title (id は builder が "center" で内部生成) */
|
|
3382
|
-
centerTitle: string;
|
|
3383
|
-
/** 中心 node の id override (default "center") */
|
|
3384
|
-
centerId?: string;
|
|
3385
|
-
/** 中心から branch までの距離 (world coord、 default 350) */
|
|
3386
|
-
radius?: number;
|
|
3387
|
-
/** branch node の width (default 260) */
|
|
3388
|
-
branchWidth?: number;
|
|
3389
|
-
/** 中心 node の width (default 260) */
|
|
3390
|
-
centerWidth?: number;
|
|
3391
|
-
defaultTone?: Tone;
|
|
3392
|
-
};
|
|
3393
|
-
type MindMapRadialBuilder = {
|
|
3394
|
-
branch: (b: MindMapRadialBranch) => MindMapRadialBuilder;
|
|
3395
|
-
build: () => ReturnType<DiagramBuilder["build"]>;
|
|
3396
|
-
};
|
|
3409
|
+
|
|
3397
3410
|
/**
|
|
3398
|
-
*
|
|
3399
|
-
*
|
|
3411
|
+
* 全 state の現時点 value を計算 (現在 phase + これまでの phase の最終 tween 値を集約)。
|
|
3412
|
+
* - set = 即時切替 (phase 到達で value 上書き、 lerp なし)
|
|
3413
|
+
* - tween = 数値補間 (現 phase 中は progress で lerp、 過去 phase は to 固定)
|
|
3400
3414
|
*
|
|
3401
|
-
*
|
|
3402
|
-
*
|
|
3403
|
-
*
|
|
3415
|
+
* 段の値を出した後に `laid.derived` (他の値から自動で決まる値) を参照順で解いて足す。
|
|
3416
|
+
* 毎 frame ここを通るので、 掛け算 / 比較のような端点 2 点では表せない関係も途中の値が
|
|
3417
|
+
* 正しくなる。 同じ名前が `states` にもある場合は解けた値が勝ち、 解けなければ初期値が残る。
|
|
3418
|
+
*/
|
|
3419
|
+
declare function computeStateValues(laid: LaidDiagram, phaseIdx: number, progress: number): Record<string, string>;
|
|
3420
|
+
/**
|
|
3421
|
+
* template literal `{stateId}` を values map で置換 (未解決は `{id}` のまま)。
|
|
3422
|
+
* array signal 拡張 (SSOT): 値が JSON array (例 `"[1,2,3]"`) の signal に対しては、
|
|
3423
|
+
* `{sig[0]}` = 要素 0 の値、 `{sig.length}` = 要素数、
|
|
3424
|
+
* `{sig.sum}` / `{sig.max}` / `{sig.min}` / `{sig.avg}` = 数値集約 (非数値 element は 0 扱い)。
|
|
3425
|
+
* array 記法対象外 signal は従来通り `{sig}` で単純置換。
|
|
3404
3426
|
*
|
|
3405
|
-
*
|
|
3406
|
-
*
|
|
3407
|
-
* .branch({ id: "users", title: "Users" }) // 0° (right)
|
|
3408
|
-
* .branch({ id: "road", title: "Roadmap" }) // 45° (bottom-right)
|
|
3409
|
-
* .branch({ id: "metrics", title: "Metrics" }) // 90° (bottom)
|
|
3410
|
-
* ...
|
|
3411
|
-
* .build();
|
|
3427
|
+
* 名前に使える文字は `template-name.ts` が決める (engine 全体で 1 つ)。 ここだけで
|
|
3428
|
+
* 定義すると、 式を書ける側との間で「読めるが書けない」 「書けるが読めない」 名前ができる。
|
|
3412
3429
|
*/
|
|
3413
|
-
declare function
|
|
3430
|
+
declare function interpolate(template: string, values: Record<string, string>): string;
|
|
3414
3431
|
|
|
3415
|
-
export { ARROW_ANGLE_MAX_DEG, ARROW_ENDPOINT_CENTER_TOL, type AnimationChain, type AuthorIntentOptions, type AuthorIntentReport, type BinaryOp, CHAIN_MIN_CLEARANCE, CHAIN_SHIFT_MAX_ACCUMULATED, CHAIN_SHIFT_MAX_ITER, CLEARANCE_LABEL_LABEL, CLEARANCE_LANE_LABEL, CLEARANCE_NODE_LABEL, CLEARANCE_PATH_LABEL, COLUMN_GAP_VARIANCE_TOL, CdlDiagram, CdlDiagramThumbnail, CdlEdge, type CdlEventHandler, CdlEventTarget, CdlInput, CdlLane, CdlNode, CdlScrollTrigger, CdlState, type ChartBuilder, type ChartDatum, type ChartPreset, type ChartType, type ClassDiagramBuilder, type ClassDiagramPreset, type ClassRelationType, Computed, DETOUR_GAP, DETOUR_SLOT_GAP, DIST_LABEL_PATH_MAX, DIST_LABEL_PATH_MIN, type DiagramAdapter, type DiagramBuilder, type Discrepancy, type DiscrepancyKind, type DomVerifyReport, EDGE_LABEL_TEXT, EDGE_STUB_OUT, type EdgeLabelLine, type EdgeLabelTextSpec, EdgeStyle, type ErBuilder, type ErEntity, type ErPreset, type ErRelation, type ErRelationCardinality, type EventAttachHandle, type EventChain, FAN_GAP, FONT_RENDER_TOLERANCE_WORLD, type FlowBuilder, type FlowPreset, type FlowStepInput, type FlowchartBuilder, type FlowchartEdge, type FlowchartNode, type FlowchartNodeShape, type FlowchartPreset, type FormulaAst, type FormulaContext, type FsmState, type FsmStateNested, type FsmTransition, type FsmTransitionExt, type FunnelBuilder, type FunnelPreset, type FunnelStage, type GanttBuilder, type GanttPreset, type GanttTask, type GenericDiagramSpec, type GenericDiscrepancy, type GenericDiscrepancyKind, type GenericVerifyOptions, type Rect as GeometryRect, type Segment as GeometrySegment, type InfraConnection, type InfraNode, type InfrastructureBuilder, type InfrastructurePreset, type InputChain, type IntentDiscrepancy, type IntentDiscrepancyKind,
|
|
3432
|
+
export { ARROW_ANGLE_MAX_DEG, ARROW_ENDPOINT_CENTER_TOL, type AnimationChain, type AuthorIntentOptions, type AuthorIntentReport, type BinaryOp, CHAIN_MIN_CLEARANCE, CHAIN_SHIFT_MAX_ACCUMULATED, CHAIN_SHIFT_MAX_ITER, CLEARANCE_LABEL_LABEL, CLEARANCE_LANE_LABEL, CLEARANCE_NODE_LABEL, CLEARANCE_PATH_LABEL, COLUMN_GAP_VARIANCE_TOL, CdlDerivedValue, CdlDiagram, CdlDiagramThumbnail, CdlEdge, type CdlEventHandler, CdlEventTarget, CdlInput, CdlLane, CdlNode, CdlScrollTrigger, CdlState, type ChartBuilder, type ChartDatum, type ChartPreset, type ChartType, type ClassDiagramBuilder, type ClassDiagramPreset, type ClassRelationType, Computed, DETOUR_GAP, DETOUR_SLOT_GAP, DIST_LABEL_PATH_MAX, DIST_LABEL_PATH_MIN, type DerivedNotice, type DerivedNoticeKind, type DerivedResult, type DiagramAdapter, type DiagramBuilder, type Discrepancy, type DiscrepancyKind, type DomVerifyReport, EDGE_LABEL_TEXT, EDGE_STUB_OUT, type EdgeLabelLine, type EdgeLabelTextSpec, EdgeStyle, type ErBuilder, type ErEntity, type ErPreset, type ErRelation, type ErRelationCardinality, type EventAttachHandle, type EventChain, FAN_GAP, FONT_RENDER_TOLERANCE_WORLD, type FlowBuilder, type FlowPreset, type FlowStepInput, type FlowchartBuilder, type FlowchartEdge, type FlowchartNode, type FlowchartNodeShape, type FlowchartPreset, type FormulaAst, type FormulaContext, type FsmState, type FsmStateNested, type FsmTransition, type FsmTransitionExt, type FunnelBuilder, type FunnelPreset, type FunnelStage, type GanttBuilder, type GanttPreset, type GanttTask, type GenericDiagramSpec, type GenericDiscrepancy, type GenericDiscrepancyKind, type GenericVerifyOptions, type Rect as GeometryRect, type Segment as GeometrySegment, type InfraConnection, type InfraNode, type InfrastructureBuilder, type InfrastructurePreset, type InputChain, type IntentDiscrepancy, type IntentDiscrepancyKind, JourneyEmotion, type JourneyStep, LABEL_INIT_CLEARANCE, LABEL_INIT_CLEARANCE_DOTTED_FLOW, LABEL_SIZE_TOLERANCE_WORLD, LABEL_TO_PATH_CLEARANCE, LANE_BORDER_CLEARANCE_TOL, LaidDiagram, LaidEdge, LaidNode, type LayoutWithValidationOptions, type LayoutWithValidationResult, MARKER_GLOW_RADIUS, MIN_COLUMN_ALIGNMENT_TOLERANCE, MIN_ROW_ALIGNMENT_TOLERANCE, type MathFnName, type MindBranch, type MindMapBuilder, type MindMapPreset, NEAR_COLLISION_DEFAULT_MIN, NEAR_COLLISION_POLICY, NODE_FRAME_SELECTOR, type NetworkBuilder, type NetworkDevice, type NetworkDeviceKind, type NetworkLink, type NetworkPreset, NodeKind, type PageLike, type PhaseBuilder, type QuadrantBuilder, type QuadrantItem, type QuadrantPreset, type QuadrantQuadrantLabel, ROW_GAP_VARIANCE_TOL, SPEC_CLEARANCE_POLICY, STAGE_SVG_SELECTOR, type SequenceBuilder, type SequencePreset, type SequenceStep, Side, Signal, type StateMachine2Builder, type StateMachine2Preset, type StateMachineBuilder, type StateMachinePreset, type SweepReport, type SwimlanePreset, TARGET_LABEL_PATH_DIST, Tone, type TopologyBuilder, type TopologyConnection, type TopologyContainer, type TopologyGroupBuilder, type TopologyPreset, type TreeBuilder, type TreeNode, type TreePreset, type UmlClass, type UmlRelation, type UserJourneyBuilder, type UserJourneyPreset, type ValidateOptions, type ValidationProfile, type VerifyOptions, type Violation, type VisualAxis, type VisualValidationReport, WCAG_AA_LARGE, WCAG_AA_NORMAL, applyDerivedValues, assertNever, attachEventHandlers, batch, bboxClearance, bboxDiffWorld, cdlAdapter, chart, classDiagram, compile, computeScrollProgress, computeStateValues, computeViewportScale, countEdgeCrossings, createFormulaComputeds, createInputSignals, diagram, effect, er, evaluate as evaluateFormula, extractIdentifiers, flow, flowchart, funnel, gantt, infrastructure, inputDefaultValue, interpolate, isLargeText, labelInitClearance, layout, layoutWithValidation, mindMap, network, parseFormula, pointRectEdgeDistance, pointToSegmentDistance, predictLabelBBoxWorld, predictNodeBBoxWorld, projectEdgeLabel, projectNode, projectPathSegment, pxToWorld, quadrant, rectRectClearance, rectRectOverlapArea, rendersRows, requiredContrastRatio, requiredNearClearance, requiredRowsHeight, requiredRowsWidth, requiredSpecClearance, resolveEdgeLabelOverlapsWithChain, resolveEdgeLabelOverlapsWithChainAndPropagate, resolveOverlapsWithChain, resolveTarget, resolveTargetAll, segmentsIntersect, sequence, stateMachine, stateMachine2, swimlane, topology, tree, untrack, userJourney, validate, verifyAllDiagramsDom, verifyAuthorIntent, verifyAuthorIntentAll, verifyDiagramDom, visualValidate, visualValidateAll, visualValidateLaid, withDerivedValues, worldToPx };
|