@cardenelabs/cdl 0.37.0 → 0.39.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +46 -1
- package/SPEC.md +6 -1
- package/dist/index.cjs +170 -110
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +170 -110
- package/dist/index.js.map +1 -1
- package/dist/react.cjs +170 -110
- 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 +170 -110
- package/dist/react.js.map +1 -1
- package/dist/{render-BYdmSviQ.d.cts → render-B1ArenZ7.d.cts} +4 -0
- package/dist/{render-BYdmSviQ.d.ts → render-B1ArenZ7.d.ts} +4 -0
- package/package.json +1 -1
- package/src/anim/core/timeline.ts +28 -10
- package/src/anim/core/types.ts +12 -0
- package/src/kinds/chart-gauge.tsx +49 -14
- package/src/kinds/chart-pie.tsx +1 -16
- package/src/kinds/chart-radial.tsx +45 -11
- package/src/kinds/chart-stacked-bar.tsx +96 -54
- package/src/kinds/draw-arc.tsx +42 -0
- package/src/render/nodes.tsx +31 -6
- package/src/render/stage.tsx +17 -3
- package/src/render.tsx +8 -1
- package/src/types.ts +4 -0
- package/src/validate.ts +6 -0
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,49 @@ CDL (Chainome Diagram Language) の主要変更履歴。
|
|
|
5
5
|
|
|
6
6
|
## [Unreleased]
|
|
7
7
|
|
|
8
|
+
## [0.39.0] - 2026-09-07
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- **弧と帯で量を表す 3 種も段の `draw` で起点から現れるようにした** (#715)
|
|
13
|
+
|
|
14
|
+
半円ゲージ (`chart-gauge`) は 9 時から上を通って 3 時へ弧が伸び、放射 (`chart-radial`) は
|
|
15
|
+
各輪が 12 時から時計回りに開き、積層帯 (`chart-stacked-bar`) は左から帯が伸びる。
|
|
16
|
+
|
|
17
|
+
どれも「量を長さで表す」 図なので、起点と伸びる向きが図の意味から決まる。 それまで
|
|
18
|
+
`draw` が効く種別は 9 つで、この 3 種は書いても何も起きなかった (実測で 6 秒間、
|
|
19
|
+
半円ゲージの弧の `d` が一度も変わらなかった)。 見本帳に並べると動く図と動かない図が混ざる。
|
|
20
|
+
|
|
21
|
+
**切り抜くのは量を表す形だけ**。 放射の軌道 (全周の薄い輪) は「あとどれだけで一周か」 を
|
|
22
|
+
示す枠なので最初から出す。 半円ゲージの合計の字は主役なので、左から半分ずつ現れると読めない。
|
|
23
|
+
積層帯の区画の字だけは区画と一緒に切り抜く (字は区画の上に乗っているため)。
|
|
24
|
+
|
|
25
|
+
形を表す属性は今までどおり触らない。 弧の `d` と区画の `width` は進みに関わらず実値で、
|
|
26
|
+
見える範囲だけが変わる。 `draw` を書かない図の絵は 1 文字も変わらない。
|
|
27
|
+
|
|
28
|
+
## [0.38.0] - 2026-09-07
|
|
29
|
+
|
|
30
|
+
### Fixed
|
|
31
|
+
|
|
32
|
+
- **図を描く動きが前半に寄って読めないのを直した** (#711)
|
|
33
|
+
|
|
34
|
+
段の進みは `easeOutQuint` を通っており、`1.2s` の段で半分に達するのが 158 ms だった
|
|
35
|
+
(直線なら 600 ms)。 値が落ち着く動きには合う曲線だが、線を引く動きはペンの速さなので、
|
|
36
|
+
同じ曲線を当てると飛び出して這う。
|
|
37
|
+
|
|
38
|
+
折れ線は線の先が点に届いた時に値の字を出すが、5 点のうち 4 点が 292 ms の間に出て、
|
|
39
|
+
最後の 1 点まで 908 ms 空いていた。「1 つずつ現れる」 という読ませ方が成立していない。
|
|
40
|
+
|
|
41
|
+
`Timeline` が曲げる前の進み (`phaseLinearProgress`) も持つようにし、描く動き
|
|
42
|
+
(`draw` の node と、その段で初めて出る矢印) だけがそれを読む。 値の補間は今までどおり
|
|
43
|
+
曲げた進みで動く。
|
|
44
|
+
|
|
45
|
+
直線にしたのは、5 点が等間隔の時刻に出る唯一の曲線だったため (実測 = 直線 294 ms 間隔、
|
|
46
|
+
`easeOut` は 188 / 219 / 275 / 518、`easeInOut` は真ん中の 3 点が寄る)。
|
|
47
|
+
|
|
48
|
+
`drawRatio` も直っている。 曲げた進みで割っていたため `0.4` と書くと段の 4.8% で
|
|
49
|
+
描き終わっていた。 これからは書いた割合が実時間の割合になる。
|
|
50
|
+
|
|
8
51
|
## [0.37.0] - 2026-09-07
|
|
9
52
|
|
|
10
53
|
### Added
|
|
@@ -1717,7 +1760,9 @@ Initial OSS release.
|
|
|
1717
1760
|
使わない = annotated tag を push しても GitHub Release は作られず、 Release を作っていない版で
|
|
1718
1761
|
行き止まりになる。
|
|
1719
1762
|
|
|
1720
|
-
[Unreleased]: https://github.com/cardene777/cdl/compare/v0.
|
|
1763
|
+
[Unreleased]: https://github.com/cardene777/cdl/compare/v0.39.0...HEAD
|
|
1764
|
+
[0.39.0]: https://github.com/cardene777/cdl/compare/v0.38.0...v0.39.0
|
|
1765
|
+
[0.38.0]: https://github.com/cardene777/cdl/compare/v0.37.0...v0.38.0
|
|
1721
1766
|
[0.37.0]: https://github.com/cardene777/cdl/compare/v0.36.0...v0.37.0
|
|
1722
1767
|
[0.36.0]: https://github.com/cardene777/cdl/compare/v0.35.0...v0.36.0
|
|
1723
1768
|
[0.35.0]: https://github.com/cardene777/cdl/compare/v0.34.0...v0.35.0
|
package/SPEC.md
CHANGED
|
@@ -140,11 +140,15 @@ phase でも線を引き直すことになる。
|
|
|
140
140
|
| `chart-line` | 左端 | 線が右へ伸びる | 点と数字は線の先が届いた時 |
|
|
141
141
|
| `chart-bar` | 横軸 | 棒が上へ伸びる | 数字は棒の頭に付いて動く |
|
|
142
142
|
| `chart-pie` | 12 時 | 扇が時計回りに開く | 凡例はその扇が開き始めた時 |
|
|
143
|
+
| `chart-slope` | 左の軸 | 線が右の軸へ伸びる | 右の値は線が右の軸に着いた時 |
|
|
143
144
|
| `journey-map` | 左端 | 気持ちの線が右へ伸びる | 段はその点に線の先が届いた時 |
|
|
144
145
|
| `mind-map` | 中心 | 枝が段ごとに外へ伸びる | 箱はその枝が届いた時 |
|
|
145
146
|
| `tree-hierarchy` | 根 | 枝が段ごとに下へ伸びる | 箱はその枝が届いた時 |
|
|
146
147
|
| `gantt-timeline` | 各帯の始端 | 帯が右へ伸びる | 依存の矢印は帯が出揃った時 |
|
|
147
148
|
| `funnel-stages` | 上端 | 段が上から順に積まれる | 件数と離脱率はその段が出切った時 |
|
|
149
|
+
| `chart-gauge` | 9 時 | 弧が上を通って 3 時へ伸びる | 合計と内訳は最初から出る |
|
|
150
|
+
| `chart-radial` | 12 時 | 各輪が時計回りに開く | 軌道と一覧は最初から出る |
|
|
151
|
+
| `chart-stacked-bar` | 左端 | 帯が右へ伸びる | 区画の字はその区画が広がった時 |
|
|
148
152
|
|
|
149
153
|
対応種別の一覧は `validate.ts` の `DRAW_KINDS` が持ち、 知らせの文面もそこから組み立てる。
|
|
150
154
|
|
|
@@ -155,7 +159,8 @@ phase でも線を引き直すことになる。
|
|
|
155
159
|
|
|
156
160
|
**枝が複数ある種別は段ごとに順に伸ばす** (`mind-map` / `tree-hierarchy`)。 深さを等分し、
|
|
157
161
|
中心 / 根に近い段から順に伸ばす。 全部を同時に伸ばすと、離れた枝が宙に浮いたまま伸びる。
|
|
158
|
-
進みの畳み方と dash の当て方は `kinds/draw-progress.ts`
|
|
162
|
+
進みの畳み方と dash の当て方は `kinds/draw-progress.ts` が、 弧で量を表す図の切り抜きは
|
|
163
|
+
`kinds/draw-arc.tsx` が SSOT。
|
|
159
164
|
|
|
160
165
|
`draw` を書かない図は従来どおり全体を描き、 DOM に属性も要素も足さない。
|
|
161
166
|
|
package/dist/index.cjs
CHANGED
|
@@ -14158,6 +14158,8 @@ var Timeline = class {
|
|
|
14158
14158
|
rafHandle = null;
|
|
14159
14159
|
phaseIndex = 0;
|
|
14160
14160
|
phaseProgress = 0;
|
|
14161
|
+
/** 曲線を通す前の進み (cdl#711)。 経過時間そのものの割合で、 描く動きが読む */
|
|
14162
|
+
phaseLinearProgress = 0;
|
|
14161
14163
|
phaseStartedAt = 0;
|
|
14162
14164
|
status = "idle";
|
|
14163
14165
|
/**
|
|
@@ -14186,12 +14188,12 @@ var Timeline = class {
|
|
|
14186
14188
|
const initial = options.initialPhaseIndex;
|
|
14187
14189
|
if (initial != null && initial > 0 && initial < phases.length) {
|
|
14188
14190
|
this.phaseIndex = initial;
|
|
14189
|
-
this.
|
|
14191
|
+
this.setProgress(1);
|
|
14190
14192
|
this.status = initial === phases.length - 1 ? "settled" : "paused";
|
|
14191
14193
|
}
|
|
14192
14194
|
this.initialState = {
|
|
14193
14195
|
phaseIndex: this.phaseIndex,
|
|
14194
|
-
|
|
14196
|
+
phaseLinearProgress: this.phaseLinearProgress,
|
|
14195
14197
|
status: this.status
|
|
14196
14198
|
};
|
|
14197
14199
|
}
|
|
@@ -14213,13 +14215,14 @@ var Timeline = class {
|
|
|
14213
14215
|
}
|
|
14214
14216
|
snapshot() {
|
|
14215
14217
|
const cached = this.cachedSnapshot;
|
|
14216
|
-
if (cached && cached.status === this.status && cached.phaseIndex === this.phaseIndex && cached.phaseProgress === this.phaseProgress && cached.totalPhases === this.phases.length) {
|
|
14218
|
+
if (cached && cached.status === this.status && cached.phaseIndex === this.phaseIndex && cached.phaseProgress === this.phaseProgress && cached.phaseLinearProgress === this.phaseLinearProgress && cached.totalPhases === this.phases.length) {
|
|
14217
14219
|
return cached;
|
|
14218
14220
|
}
|
|
14219
14221
|
const next = {
|
|
14220
14222
|
status: this.status,
|
|
14221
14223
|
phaseIndex: this.phaseIndex,
|
|
14222
14224
|
phaseProgress: this.phaseProgress,
|
|
14225
|
+
phaseLinearProgress: this.phaseLinearProgress,
|
|
14223
14226
|
totalPhases: this.phases.length
|
|
14224
14227
|
};
|
|
14225
14228
|
this.cachedSnapshot = next;
|
|
@@ -14242,7 +14245,7 @@ var Timeline = class {
|
|
|
14242
14245
|
const clamped = Math.max(0, Math.min(this.phases.length - 1, index));
|
|
14243
14246
|
this.cancelRaf();
|
|
14244
14247
|
this.phaseIndex = clamped;
|
|
14245
|
-
this.
|
|
14248
|
+
this.setProgress(1);
|
|
14246
14249
|
this.status = clamped === this.phases.length - 1 ? "settled" : "paused";
|
|
14247
14250
|
this.emit();
|
|
14248
14251
|
}
|
|
@@ -14282,14 +14285,14 @@ var Timeline = class {
|
|
|
14282
14285
|
if (this.phaseIndex <= 0) return;
|
|
14283
14286
|
this.cancelRaf();
|
|
14284
14287
|
this.phaseIndex -= 1;
|
|
14285
|
-
this.
|
|
14288
|
+
this.setProgress(1);
|
|
14286
14289
|
this.status = "paused";
|
|
14287
14290
|
this.emit();
|
|
14288
14291
|
}
|
|
14289
14292
|
reset() {
|
|
14290
14293
|
this.cancelRaf();
|
|
14291
14294
|
this.phaseIndex = 0;
|
|
14292
|
-
this.
|
|
14295
|
+
this.setProgress(0);
|
|
14293
14296
|
this.status = "idle";
|
|
14294
14297
|
this.emit();
|
|
14295
14298
|
}
|
|
@@ -14310,7 +14313,7 @@ var Timeline = class {
|
|
|
14310
14313
|
this.subscribers.clear();
|
|
14311
14314
|
this.status = this.initialState.status;
|
|
14312
14315
|
this.phaseIndex = this.initialState.phaseIndex;
|
|
14313
|
-
this.
|
|
14316
|
+
this.setProgress(this.initialState.phaseLinearProgress);
|
|
14314
14317
|
}
|
|
14315
14318
|
// ─── internals ───────────────────────────────────────────────
|
|
14316
14319
|
advancePhase() {
|
|
@@ -14346,20 +14349,20 @@ var Timeline = class {
|
|
|
14346
14349
|
}, ms);
|
|
14347
14350
|
}
|
|
14348
14351
|
beginPhaseTransition() {
|
|
14349
|
-
this.
|
|
14352
|
+
this.setProgress(0);
|
|
14350
14353
|
this.phaseStartedAt = performance.now();
|
|
14351
14354
|
this.cancelRaf();
|
|
14352
14355
|
const step = (now) => {
|
|
14353
14356
|
const duration = this.autoAdvanceMsOverride ?? this.getPhase().durationMs ?? 600;
|
|
14354
14357
|
const elapsed = now - this.phaseStartedAt;
|
|
14355
14358
|
const linearT = clamp01(elapsed / duration);
|
|
14356
|
-
this.
|
|
14359
|
+
this.setProgress(linearT);
|
|
14357
14360
|
this.emit();
|
|
14358
14361
|
if (linearT < 1) {
|
|
14359
14362
|
this.rafHandle = requestAnimationFrame(step);
|
|
14360
14363
|
return;
|
|
14361
14364
|
}
|
|
14362
|
-
this.
|
|
14365
|
+
this.setProgress(1);
|
|
14363
14366
|
this.emit();
|
|
14364
14367
|
if (this.status === "playing") {
|
|
14365
14368
|
if (this.phaseIndex < this.phases.length - 1) {
|
|
@@ -14374,6 +14377,19 @@ var Timeline = class {
|
|
|
14374
14377
|
};
|
|
14375
14378
|
this.rafHandle = requestAnimationFrame(step);
|
|
14376
14379
|
}
|
|
14380
|
+
/**
|
|
14381
|
+
* 段の進みを 2 つ同時に置く (cdl#711)。
|
|
14382
|
+
*
|
|
14383
|
+
* **代入する場所を 1 つに閉じる**。 曲げた進みと曲げる前の進みを別々に書くと、
|
|
14384
|
+
* どちらかを更新し忘れた経路が「前の段の値のまま」 で残る。
|
|
14385
|
+
*
|
|
14386
|
+
* 両端 (0 と 1) は曲線を通さず、 そのまま置く。 曲線は差し替えられる欄なので、
|
|
14387
|
+
* `easing(1)` が 1 を返す保証がない。 段の始まりと終わりの値は曲線に委ねない。
|
|
14388
|
+
*/
|
|
14389
|
+
setProgress(linear2) {
|
|
14390
|
+
this.phaseLinearProgress = linear2;
|
|
14391
|
+
this.phaseProgress = linear2 <= 0 ? 0 : linear2 >= 1 ? 1 : this.easing(linear2);
|
|
14392
|
+
}
|
|
14377
14393
|
cancelRaf() {
|
|
14378
14394
|
if (this.rafHandle != null) {
|
|
14379
14395
|
cancelAnimationFrame(this.rafHandle);
|
|
@@ -20792,7 +20808,10 @@ var DRAW_KINDS = /* @__PURE__ */ new Set([
|
|
|
20792
20808
|
"mind-map",
|
|
20793
20809
|
"tree-hierarchy",
|
|
20794
20810
|
"gantt-timeline",
|
|
20795
|
-
"funnel-stages"
|
|
20811
|
+
"funnel-stages",
|
|
20812
|
+
"chart-gauge",
|
|
20813
|
+
"chart-radial",
|
|
20814
|
+
"chart-stacked-bar"
|
|
20796
20815
|
]);
|
|
20797
20816
|
var KINDS = new Set(NODE_KINDS);
|
|
20798
20817
|
var ENG_BANNED = /\b(FUNCTION|STORAGE|EVENT LOG|BALANCES MAPPING|READ|WRITE|EMIT|CALL)\b/;
|
|
@@ -24338,6 +24357,15 @@ function interpolateColor(template, stateValues, fallback) {
|
|
|
24338
24357
|
if (!template) return fallback;
|
|
24339
24358
|
return interpolate(template, stateValues);
|
|
24340
24359
|
}
|
|
24360
|
+
function \u6247\u5F62\u306E\u5207\u308A\u629C\u304D(cx, cy, r, \u958B\u304D, \u8D77\u70B9 = -Math.PI / 2, \u5168\u5468 = Math.PI * 2) {
|
|
24361
|
+
if (\u958B\u304D <= 0) return null;
|
|
24362
|
+
if (\u958B\u304D >= 1 && \u5168\u5468 >= Math.PI * 2) return /* @__PURE__ */ jsxRuntime.jsx("circle", { cx, cy, r });
|
|
24363
|
+
const a0 = \u8D77\u70B9;
|
|
24364
|
+
const a1 = a0 + Math.min(1, \u958B\u304D) * \u5168\u5468;
|
|
24365
|
+
const large = a1 - a0 > Math.PI ? 1 : 0;
|
|
24366
|
+
const d = `M ${cx} ${cy} L ${cx + r * Math.cos(a0)} ${cy + r * Math.sin(a0)} A ${r} ${r} 0 ${large} 1 ${cx + r * Math.cos(a1)} ${cy + r * Math.sin(a1)} Z`;
|
|
24367
|
+
return /* @__PURE__ */ jsxRuntime.jsx("path", { d });
|
|
24368
|
+
}
|
|
24341
24369
|
|
|
24342
24370
|
// src/kinds/chart-number.ts
|
|
24343
24371
|
function \u5B9F\u5024\u8868\u8A18(v) {
|
|
@@ -24785,15 +24813,6 @@ function \u8F2A\u306E\u9053(cx, cy, R, r, a0, a1) {
|
|
|
24785
24813
|
const large = a1 - a0 > Math.PI ? 1 : 0;
|
|
24786
24814
|
return `M ${cx + R * Math.cos(a0)} ${cy + R * Math.sin(a0)} A ${R} ${R} 0 ${large} 1 ${cx + R * Math.cos(a1)} ${cy + R * Math.sin(a1)} L ${cx + r * Math.cos(a1)} ${cy + r * Math.sin(a1)} A ${r} ${r} 0 ${large} 0 ${cx + r * Math.cos(a0)} ${cy + r * Math.sin(a0)} Z`;
|
|
24787
24815
|
}
|
|
24788
|
-
function \u6247\u5F62\u306E\u5207\u308A\u629C\u304D(cx, cy, r, \u958B\u304D) {
|
|
24789
|
-
if (\u958B\u304D <= 0) return null;
|
|
24790
|
-
if (\u958B\u304D >= 1) return /* @__PURE__ */ jsxRuntime.jsx("circle", { cx, cy, r });
|
|
24791
|
-
const a0 = -Math.PI / 2;
|
|
24792
|
-
const a1 = a0 + \u958B\u304D * Math.PI * 2;
|
|
24793
|
-
const large = \u958B\u304D > 0.5 ? 1 : 0;
|
|
24794
|
-
const d = `M ${cx} ${cy} L ${cx + r * Math.cos(a0)} ${cy + r * Math.sin(a0)} A ${r} ${r} 0 ${large} 1 ${cx + r * Math.cos(a1)} ${cy + r * Math.sin(a1)} Z`;
|
|
24795
|
-
return /* @__PURE__ */ jsxRuntime.jsx("path", { d });
|
|
24796
|
-
}
|
|
24797
24816
|
function sliceColor(tone, idx) {
|
|
24798
24817
|
if (tone) return TONE[tone];
|
|
24799
24818
|
return chartSeriesColor(idx);
|
|
@@ -24801,7 +24820,9 @@ function sliceColor(tone, idx) {
|
|
|
24801
24820
|
function ChartGaugeNode({
|
|
24802
24821
|
node,
|
|
24803
24822
|
active,
|
|
24804
|
-
stateValues = {}
|
|
24823
|
+
stateValues = {},
|
|
24824
|
+
drawing = false,
|
|
24825
|
+
progress = 1
|
|
24805
24826
|
}) {
|
|
24806
24827
|
const x0 = node.cx - node.w / 2;
|
|
24807
24828
|
const y0 = node.cy - node.h / 2;
|
|
@@ -24846,6 +24867,21 @@ function ChartGaugeNode({
|
|
|
24846
24867
|
const \u898B\u51FA\u3057\u306E\u7D1A = Math.max(9, Math.round(\u5408\u8A08\u306E\u7D1A * 0.38));
|
|
24847
24868
|
const \u5185\u8A33\u306E\u5E45 = \u4F7F\u3048\u308B\u5E452 / Math.max(data.length, 1);
|
|
24848
24869
|
const \u5185\u8A33\u306Ey = cy + \u5F27\u3068\u5185\u8A33\u306E\u9593;
|
|
24870
|
+
const \u4F38\u3073 = \u9032\u307F\u3092\u7573\u3080(drawing, progress);
|
|
24871
|
+
const \u5207\u308A\u629C\u304Did = `cdl-gauge-draw-${react.useId().replace(/[^A-Za-z0-9_-]/g, "")}`;
|
|
24872
|
+
const \u5F27\u305F\u3061 = slices.map((s, idx) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
24873
|
+
"path",
|
|
24874
|
+
{
|
|
24875
|
+
"data-cdl-role": "chart-gauge-arc",
|
|
24876
|
+
"data-cdl-unresolved": s.d.unresolved ? "true" : void 0,
|
|
24877
|
+
d: s.path,
|
|
24878
|
+
fill: arcColor(s.d.tone, idx),
|
|
24879
|
+
stroke: "var(--cdl-node-fill, #ffffff)",
|
|
24880
|
+
strokeWidth: 3,
|
|
24881
|
+
strokeLinejoin: "round"
|
|
24882
|
+
},
|
|
24883
|
+
`arc-${idx}`
|
|
24884
|
+
));
|
|
24849
24885
|
return /* @__PURE__ */ jsxRuntime.jsxs("g", { transform: `translate(${x0} ${y0})`, children: [
|
|
24850
24886
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
24851
24887
|
"rect",
|
|
@@ -24861,19 +24897,8 @@ function ChartGaugeNode({
|
|
|
24861
24897
|
strokeWidth: active ? 3 : 1.25
|
|
24862
24898
|
}
|
|
24863
24899
|
),
|
|
24864
|
-
|
|
24865
|
-
|
|
24866
|
-
{
|
|
24867
|
-
"data-cdl-role": "chart-gauge-arc",
|
|
24868
|
-
"data-cdl-unresolved": s.d.unresolved ? "true" : void 0,
|
|
24869
|
-
d: s.path,
|
|
24870
|
-
fill: arcColor(s.d.tone, idx),
|
|
24871
|
-
stroke: "var(--cdl-node-fill, #ffffff)",
|
|
24872
|
-
strokeWidth: 3,
|
|
24873
|
-
strokeLinejoin: "round"
|
|
24874
|
-
},
|
|
24875
|
-
`arc-${idx}`
|
|
24876
|
-
)),
|
|
24900
|
+
drawing && /* @__PURE__ */ jsxRuntime.jsx("defs", { children: /* @__PURE__ */ jsxRuntime.jsx("clipPath", { id: \u5207\u308A\u629C\u304Did, children: \u6247\u5F62\u306E\u5207\u308A\u629C\u304D(cx, cy, radius + 2, \u4F38\u3073, Math.PI, Math.PI) }) }),
|
|
24901
|
+
drawing ? /* @__PURE__ */ jsxRuntime.jsx("g", { clipPath: `url(#${\u5207\u308A\u629C\u304Did})`, children: \u5F27\u305F\u3061 }) : \u5F27\u305F\u3061,
|
|
24877
24902
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
24878
24903
|
"text",
|
|
24879
24904
|
{
|
|
@@ -24938,7 +24963,9 @@ function arcColor(tone, idx) {
|
|
|
24938
24963
|
function ChartRadialNode({
|
|
24939
24964
|
node,
|
|
24940
24965
|
active,
|
|
24941
|
-
stateValues = {}
|
|
24966
|
+
stateValues = {},
|
|
24967
|
+
drawing = false,
|
|
24968
|
+
progress = 1
|
|
24942
24969
|
}) {
|
|
24943
24970
|
const x0 = node.cx - node.w / 2;
|
|
24944
24971
|
const y0 = node.cy - node.h / 2;
|
|
@@ -24977,6 +25004,20 @@ function ChartRadialNode({
|
|
|
24977
25004
|
};
|
|
24978
25005
|
});
|
|
24979
25006
|
const \u4E00\u89A7\u306E\u59CB\u307E\u308A = PAD + (\u4F7F\u3048\u308B\u9AD8\u3055 - \u884C\u306E\u9AD8\u3055 * data.length) / 2 + \u884C\u306E\u9AD8\u3055 / 2;
|
|
25007
|
+
const \u958B\u304D = \u9032\u307F\u3092\u7573\u3080(drawing, progress);
|
|
25008
|
+
const \u5207\u308A\u629C\u304Did = `cdl-radial-draw-${react.useId().replace(/[^A-Za-z0-9_-]/g, "")}`;
|
|
25009
|
+
const \u53D6\u308A\u5206\u305F\u3061 = rings.map(
|
|
25010
|
+
(r, idx) => r.\u53D6\u308A\u5206 === null ? null : /* @__PURE__ */ jsxRuntime.jsx(
|
|
25011
|
+
"path",
|
|
25012
|
+
{
|
|
25013
|
+
"data-cdl-role": "chart-radial-arc",
|
|
25014
|
+
"data-cdl-unresolved": r.d.unresolved ? "true" : void 0,
|
|
25015
|
+
d: r.\u53D6\u308A\u5206,
|
|
25016
|
+
fill: arcColor2(r.d.tone, idx)
|
|
25017
|
+
},
|
|
25018
|
+
`arc-${idx}`
|
|
25019
|
+
)
|
|
25020
|
+
);
|
|
24980
25021
|
return /* @__PURE__ */ jsxRuntime.jsxs("g", { transform: `translate(${x0} ${y0})`, children: [
|
|
24981
25022
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
24982
25023
|
"rect",
|
|
@@ -25002,18 +25043,8 @@ function ChartRadialNode({
|
|
|
25002
25043
|
},
|
|
25003
25044
|
`track-${idx}`
|
|
25004
25045
|
)),
|
|
25005
|
-
|
|
25006
|
-
|
|
25007
|
-
"path",
|
|
25008
|
-
{
|
|
25009
|
-
"data-cdl-role": "chart-radial-arc",
|
|
25010
|
-
"data-cdl-unresolved": r.d.unresolved ? "true" : void 0,
|
|
25011
|
-
d: r.\u53D6\u308A\u5206,
|
|
25012
|
-
fill: arcColor2(r.d.tone, idx)
|
|
25013
|
-
},
|
|
25014
|
-
`arc-${idx}`
|
|
25015
|
-
)
|
|
25016
|
-
),
|
|
25046
|
+
drawing && /* @__PURE__ */ jsxRuntime.jsx("defs", { children: /* @__PURE__ */ jsxRuntime.jsx("clipPath", { id: \u5207\u308A\u629C\u304Did, children: \u6247\u5F62\u306E\u5207\u308A\u629C\u304D(\u5F27\u306Ecx, cy, \u5916\u534A\u5F84 + \u5E2F\u306E\u5E45, \u958B\u304D) }) }),
|
|
25047
|
+
drawing ? /* @__PURE__ */ jsxRuntime.jsx("g", { clipPath: `url(#${\u5207\u308A\u629C\u304Did})`, children: \u53D6\u308A\u5206\u305F\u3061 }) : \u53D6\u308A\u5206\u305F\u3061,
|
|
25017
25048
|
data.map((d, idx) => {
|
|
25018
25049
|
const y = \u4E00\u89A7\u306E\u59CB\u307E\u308A + \u884C\u306E\u9AD8\u3055 * idx;
|
|
25019
25050
|
return /* @__PURE__ */ jsxRuntime.jsxs("g", { "data-cdl-role": "chart-radial-item", children: [
|
|
@@ -25336,7 +25367,9 @@ var SLICE_MIN_W_FOR_VALUE = 84;
|
|
|
25336
25367
|
function ChartStackedBarNode({
|
|
25337
25368
|
node,
|
|
25338
25369
|
active,
|
|
25339
|
-
stateValues = {}
|
|
25370
|
+
stateValues = {},
|
|
25371
|
+
drawing = false,
|
|
25372
|
+
progress = 1
|
|
25340
25373
|
}) {
|
|
25341
25374
|
const x0 = node.cx - node.w / 2;
|
|
25342
25375
|
const y0 = node.cy - node.h / 2;
|
|
@@ -25354,6 +25387,8 @@ function ChartStackedBarNode({
|
|
|
25354
25387
|
const \u4E00\u89A7\u306E\u9AD8\u3055 = 26;
|
|
25355
25388
|
const \u5168\u4F53\u306E\u9AD8\u3055 = \u5E2F\u305F\u3061.length * \u5E2F\u306E\u9AD8\u3055 + (\u5E2F\u305F\u3061.length - 1) * \u5E2F\u306E\u9593 + 16 + \u4E00\u89A7\u306E\u9AD8\u3055;
|
|
25356
25389
|
const \u4E0A\u7AEF = Math.max(PAD, (node.h - \u5168\u4F53\u306E\u9AD8\u3055) / 2);
|
|
25390
|
+
const \u4F38\u3073 = \u9032\u307F\u3092\u7573\u3080(drawing, progress);
|
|
25391
|
+
const \u5207\u308A\u629C\u304Did = `cdl-stacked-bar-draw-${react.useId().replace(/[^A-Za-z0-9_-]/g, "")}`;
|
|
25357
25392
|
return /* @__PURE__ */ jsxRuntime.jsxs("g", { transform: `translate(${x0} ${y0})`, children: [
|
|
25358
25393
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
25359
25394
|
"rect",
|
|
@@ -25369,6 +25404,7 @@ function ChartStackedBarNode({
|
|
|
25369
25404
|
strokeWidth: active ? 3 : 1.25
|
|
25370
25405
|
}
|
|
25371
25406
|
),
|
|
25407
|
+
drawing && /* @__PURE__ */ jsxRuntime.jsx("defs", { children: /* @__PURE__ */ jsxRuntime.jsx("clipPath", { id: \u5207\u308A\u629C\u304Did, children: /* @__PURE__ */ jsxRuntime.jsx("rect", { x: 0, y: 0, width: \u5E2F\u306E\u5DE6 + \u5E2F\u306E\u5E45 * \u4F38\u3073, height: node.h }) }) }),
|
|
25372
25408
|
\u5E2F\u305F\u3061.map((\u5E2F, \u6BB5) => {
|
|
25373
25409
|
const y = \u4E0A\u7AEF + \u6BB5 * (\u5E2F\u306E\u9AD8\u3055 + \u5E2F\u306E\u9593);
|
|
25374
25410
|
let \u5DE6 = \u5E2F\u306E\u5DE6;
|
|
@@ -25385,68 +25421,62 @@ function ChartStackedBarNode({
|
|
|
25385
25421
|
children: \u5E2F.\u540D\u524D
|
|
25386
25422
|
}
|
|
25387
25423
|
),
|
|
25388
|
-
|
|
25389
|
-
const
|
|
25390
|
-
|
|
25391
|
-
|
|
25392
|
-
|
|
25393
|
-
|
|
25394
|
-
/* @__PURE__ */ jsxRuntime.
|
|
25395
|
-
|
|
25396
|
-
|
|
25397
|
-
|
|
25398
|
-
|
|
25399
|
-
|
|
25400
|
-
|
|
25401
|
-
|
|
25402
|
-
|
|
25403
|
-
|
|
25404
|
-
|
|
25405
|
-
|
|
25406
|
-
|
|
25407
|
-
|
|
25408
|
-
|
|
25409
|
-
|
|
25410
|
-
|
|
25411
|
-
|
|
25412
|
-
|
|
25413
|
-
|
|
25414
|
-
|
|
25415
|
-
|
|
25416
|
-
|
|
25417
|
-
|
|
25418
|
-
|
|
25419
|
-
|
|
25420
|
-
|
|
25421
|
-
|
|
25422
|
-
|
|
25423
|
-
|
|
25424
|
-
|
|
25425
|
-
|
|
25426
|
-
|
|
25427
|
-
|
|
25428
|
-
|
|
25429
|
-
|
|
25430
|
-
|
|
25431
|
-
|
|
25432
|
-
|
|
25433
|
-
|
|
25424
|
+
(() => {
|
|
25425
|
+
const \u533A\u753B\u305F\u3061 = \u5E2F.\u533A\u753B.map((s, idx) => {
|
|
25426
|
+
const w = \u5E2F\u306E\u5E45 * s.\u5272\u5408;
|
|
25427
|
+
const x = \u5DE6;
|
|
25428
|
+
\u5DE6 += w;
|
|
25429
|
+
const \u8272 = \u5370\u306E\u82723(s.tone, idx);
|
|
25430
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
|
|
25431
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
25432
|
+
"rect",
|
|
25433
|
+
{
|
|
25434
|
+
"data-cdl-role": "chart-stacked-bar-slice",
|
|
25435
|
+
"data-cdl-unresolved": s.unresolved ? "true" : void 0,
|
|
25436
|
+
x,
|
|
25437
|
+
y,
|
|
25438
|
+
width: Math.max(0, w),
|
|
25439
|
+
height: \u5E2F\u306E\u9AD8\u3055,
|
|
25440
|
+
fill: \u8272
|
|
25441
|
+
}
|
|
25442
|
+
),
|
|
25443
|
+
w >= SLICE_MIN_W_FOR_TEXT && /* @__PURE__ */ jsxRuntime.jsx(
|
|
25444
|
+
"text",
|
|
25445
|
+
{
|
|
25446
|
+
"data-cdl-role": "chart-stacked-bar-slice-text",
|
|
25447
|
+
x: x + w / 2,
|
|
25448
|
+
y: y + \u5E2F\u306E\u9AD8\u3055 / 2 + (w >= SLICE_MIN_W_FOR_VALUE ? -2 : 4),
|
|
25449
|
+
fontSize: \u533A\u753B\u306E\u7D1A,
|
|
25450
|
+
fontWeight: 700,
|
|
25451
|
+
textAnchor: "middle",
|
|
25452
|
+
fill: "#ffffff",
|
|
25453
|
+
children: \u5272\u5408\u8868\u8A18(s.\u5272\u5408)
|
|
25454
|
+
}
|
|
25455
|
+
),
|
|
25456
|
+
w >= SLICE_MIN_W_FOR_VALUE && /* @__PURE__ */ jsxRuntime.jsx(
|
|
25457
|
+
"text",
|
|
25458
|
+
{
|
|
25459
|
+
"data-cdl-role": "chart-stacked-bar-slice-value",
|
|
25460
|
+
x: x + w / 2,
|
|
25461
|
+
y: y + \u5E2F\u306E\u9AD8\u3055 / 2 + 13,
|
|
25462
|
+
fontSize: \u533A\u753B\u306E\u7D1A - 1,
|
|
25463
|
+
textAnchor: "middle",
|
|
25464
|
+
fill: "#ffffff",
|
|
25465
|
+
fillOpacity: 0.85,
|
|
25466
|
+
children: \u5B9F\u5024\u8868\u8A18(s.\u5B9F\u5024)
|
|
25467
|
+
}
|
|
25468
|
+
)
|
|
25469
|
+
] }, `slice-${idx}`);
|
|
25470
|
+
});
|
|
25471
|
+
return drawing ? /* @__PURE__ */ jsxRuntime.jsx("g", { clipPath: `url(#${\u5207\u308A\u629C\u304Did})`, children: \u533A\u753B\u305F\u3061 }) : \u533A\u753B\u305F\u3061;
|
|
25472
|
+
})()
|
|
25434
25473
|
] }, `bar-${\u6BB5}`);
|
|
25435
25474
|
}),
|
|
25436
25475
|
\u4E00\u89A7\u306E\u4E26\u3073(data, \u5E2F\u306E\u5DE6, node.w - PAD, \u540D\u524D\u306E\u7D1A).map(({ d, idx, x, \u884C }) => {
|
|
25437
25476
|
const y = \u4E0A\u7AEF + \u5E2F\u305F\u3061.length * (\u5E2F\u306E\u9AD8\u3055 + \u5E2F\u306E\u9593) - \u5E2F\u306E\u9593 + 16 + \u4E00\u89A7\u306E\u9AD8\u3055 / 2 + \u884C * \u4E00\u89A7\u306E\u9AD8\u3055;
|
|
25438
25477
|
return /* @__PURE__ */ jsxRuntime.jsxs("g", { "data-cdl-role": "chart-stacked-bar-legend", children: [
|
|
25439
25478
|
/* @__PURE__ */ jsxRuntime.jsx("rect", { x, y: y - 5, width: 10, height: 10, rx: 2, fill: \u5370\u306E\u82723(d.tone, idx) }),
|
|
25440
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
25441
|
-
"text",
|
|
25442
|
-
{
|
|
25443
|
-
x: x + 16,
|
|
25444
|
-
y: y + 4,
|
|
25445
|
-
fontSize: \u540D\u524D\u306E\u7D1A,
|
|
25446
|
-
fill: "var(--cdl-text, #1a1f2a)",
|
|
25447
|
-
children: d.label
|
|
25448
|
-
}
|
|
25449
|
-
)
|
|
25479
|
+
/* @__PURE__ */ jsxRuntime.jsx("text", { x: x + 16, y: y + 4, fontSize: \u540D\u524D\u306E\u7D1A, fill: "var(--cdl-text, #1a1f2a)", children: d.label })
|
|
25450
25480
|
] }, `legend-${idx}`);
|
|
25451
25481
|
})
|
|
25452
25482
|
] });
|
|
@@ -30407,9 +30437,27 @@ function CdlNodeView({
|
|
|
30407
30437
|
}
|
|
30408
30438
|
);
|
|
30409
30439
|
case "chart-gauge":
|
|
30410
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
30440
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
30441
|
+
ChartGaugeNode,
|
|
30442
|
+
{
|
|
30443
|
+
node: resolvedNode,
|
|
30444
|
+
active,
|
|
30445
|
+
stateValues,
|
|
30446
|
+
drawing,
|
|
30447
|
+
progress
|
|
30448
|
+
}
|
|
30449
|
+
);
|
|
30411
30450
|
case "chart-stacked-bar":
|
|
30412
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
30451
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
30452
|
+
ChartStackedBarNode,
|
|
30453
|
+
{
|
|
30454
|
+
node: resolvedNode,
|
|
30455
|
+
active,
|
|
30456
|
+
stateValues,
|
|
30457
|
+
drawing,
|
|
30458
|
+
progress
|
|
30459
|
+
}
|
|
30460
|
+
);
|
|
30413
30461
|
case "chart-slope":
|
|
30414
30462
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
30415
30463
|
ChartSlopeNode,
|
|
@@ -30426,7 +30474,16 @@ function CdlNodeView({
|
|
|
30426
30474
|
case "chart-stat":
|
|
30427
30475
|
return /* @__PURE__ */ jsxRuntime.jsx(ChartStatNode, { node: resolvedNode, active, stateValues });
|
|
30428
30476
|
case "chart-radial":
|
|
30429
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
30477
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
30478
|
+
ChartRadialNode,
|
|
30479
|
+
{
|
|
30480
|
+
node: resolvedNode,
|
|
30481
|
+
active,
|
|
30482
|
+
stateValues,
|
|
30483
|
+
drawing,
|
|
30484
|
+
progress
|
|
30485
|
+
}
|
|
30486
|
+
);
|
|
30430
30487
|
case "chart-bar":
|
|
30431
30488
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
30432
30489
|
ChartBarNode,
|
|
@@ -30647,6 +30704,7 @@ function CdlStage({
|
|
|
30647
30704
|
laid,
|
|
30648
30705
|
currentPhase,
|
|
30649
30706
|
progress,
|
|
30707
|
+
drawProgress,
|
|
30650
30708
|
stateValues,
|
|
30651
30709
|
debug,
|
|
30652
30710
|
compact = false,
|
|
@@ -30704,7 +30762,8 @@ function CdlStage({
|
|
|
30704
30762
|
}
|
|
30705
30763
|
return scales;
|
|
30706
30764
|
}, [laid]);
|
|
30707
|
-
const \u63CF\u304F\u9032\u307F =
|
|
30765
|
+
const \u63CF\u304F\u7D20\u306E\u9032\u307F = drawProgress ?? progress;
|
|
30766
|
+
const \u63CF\u304F\u9032\u307F = \u63CF\u304F\u9032\u307F\u306B\u76F4\u3059(\u63CF\u304F\u7D20\u306E\u9032\u307F, currentPhase?.drawRatio);
|
|
30708
30767
|
const { lifelineStarts, uniformFooterTop } = react.useMemo(() => {
|
|
30709
30768
|
const starts = lifelineStartYs(laid.nodes);
|
|
30710
30769
|
return {
|
|
@@ -30883,7 +30942,7 @@ function CdlStage({
|
|
|
30883
30942
|
edge,
|
|
30884
30943
|
active: activeSet.has(edge.id),
|
|
30885
30944
|
drawing: \u77E2\u5370\u306E\u51FA\u756A.\u4F38\u3070\u3059\u304B(edge.id),
|
|
30886
|
-
progress,
|
|
30945
|
+
progress: \u77E2\u5370\u306E\u51FA\u756A.\u4F38\u3070\u3059\u304B(edge.id) ? \u63CF\u304F\u9032\u307F : progress,
|
|
30887
30946
|
stateValues
|
|
30888
30947
|
},
|
|
30889
30948
|
edge.id
|
|
@@ -31114,6 +31173,7 @@ function CdlDiagramView({ diagram: diagram2, laid: laidProp, hideHeader = false,
|
|
|
31114
31173
|
const phaseIdx = focusPhaseId ? laid.phases.findIndex((p) => p.id === focusPhaseId) : state.phaseIndex;
|
|
31115
31174
|
const currentPhase = laid.phases[Math.max(0, phaseIdx)] ?? laid.phases[0];
|
|
31116
31175
|
const progress = reduced ? 1 : state.phaseProgress;
|
|
31176
|
+
const drawProgress = reduced ? 1 : state.phaseLinearProgress;
|
|
31117
31177
|
const baseStateValues = computeStateValues(laid, phaseIdx, progress);
|
|
31118
31178
|
const isInteractive = hasInteractivePrimitives(diagram2);
|
|
31119
31179
|
const interactive = useInteractiveIntegration(
|
|
@@ -31155,7 +31215,7 @@ function CdlDiagramView({ diagram: diagram2, laid: laidProp, hideHeader = false,
|
|
|
31155
31215
|
}
|
|
31156
31216
|
),
|
|
31157
31217
|
isInteractive && interactive.panel,
|
|
31158
|
-
/* @__PURE__ */ jsxRuntime.jsx(CdlStage, { laid, currentPhase, progress, stateValues, debug, compact: hideHeader, svgRef: isInteractive ? interactive.svgRef : void 0 }),
|
|
31218
|
+
/* @__PURE__ */ jsxRuntime.jsx(CdlStage, { laid, currentPhase, progress, drawProgress, stateValues, debug, compact: hideHeader, svgRef: isInteractive ? interactive.svgRef : void 0 }),
|
|
31159
31219
|
hideHeader && !hideMiniPhaseIndicator && currentPhase && laid.phases.length > 1 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-3 border-t border-[var(--cdl-divider,#d4d4d8)]/40 bg-[var(--cdl-stage-bg,#f1f5f9)]/50 px-3 py-2 text-xs", children: [
|
|
31160
31220
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1.5", children: [
|
|
31161
31221
|
laid.phases.map((p, i) => /* @__PURE__ */ jsxRuntime.jsx(
|