@cardenelabs/cdl 0.18.0 → 0.18.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/CHANGELOG.md +21 -1
- package/dist/index.cjs +42 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +42 -11
- package/dist/index.js.map +1 -1
- package/dist/react.cjs +42 -11
- package/dist/react.cjs.map +1 -1
- package/dist/react.js +42 -11
- package/dist/react.js.map +1 -1
- package/package.json +1 -1
- package/src/render/edges.tsx +18 -2
- package/src/render/stage.tsx +36 -12
package/dist/react.js
CHANGED
|
@@ -5574,6 +5574,7 @@ function labelTextOpacity(line) {
|
|
|
5574
5574
|
function CdlEdgeView({
|
|
5575
5575
|
edge,
|
|
5576
5576
|
active,
|
|
5577
|
+
drawing,
|
|
5577
5578
|
progress,
|
|
5578
5579
|
stateValues
|
|
5579
5580
|
}) {
|
|
@@ -5598,6 +5599,7 @@ function CdlEdgeView({
|
|
|
5598
5599
|
"data-cdl-from": edge.from,
|
|
5599
5600
|
"data-cdl-to": edge.to,
|
|
5600
5601
|
"data-cdl-active": active ? "true" : "false",
|
|
5602
|
+
"data-cdl-drawing": drawing ? "true" : "false",
|
|
5601
5603
|
"data-cdl-path-d": edge.d,
|
|
5602
5604
|
"data-cdl-label-x": edge.labelX,
|
|
5603
5605
|
"data-cdl-label-y": edge.labelY,
|
|
@@ -5629,6 +5631,7 @@ function CdlEdgeView({
|
|
|
5629
5631
|
{
|
|
5630
5632
|
edge,
|
|
5631
5633
|
active,
|
|
5634
|
+
drawing,
|
|
5632
5635
|
progress,
|
|
5633
5636
|
color,
|
|
5634
5637
|
marker,
|
|
@@ -5656,6 +5659,7 @@ function CdlEdgeView({
|
|
|
5656
5659
|
function SolidEdgePath({
|
|
5657
5660
|
edge,
|
|
5658
5661
|
active,
|
|
5662
|
+
drawing,
|
|
5659
5663
|
progress,
|
|
5660
5664
|
color,
|
|
5661
5665
|
marker,
|
|
@@ -5663,7 +5667,7 @@ function SolidEdgePath({
|
|
|
5663
5667
|
dashed,
|
|
5664
5668
|
stateValues
|
|
5665
5669
|
}) {
|
|
5666
|
-
const visibleD =
|
|
5670
|
+
const visibleD = drawing ? pathSubpath(edge.d, progress) : edge.d;
|
|
5667
5671
|
const defaultWidth = active ? 5 : 2.5;
|
|
5668
5672
|
const boundWidth = edge.widthBind && stateValues ? resolveNumericAttr(edge.widthBind, stateValues, defaultWidth) : defaultWidth;
|
|
5669
5673
|
const boundStroke = edge.strokeBind && stateValues ? interpolate(edge.strokeBind, stateValues) : color;
|
|
@@ -14198,19 +14202,36 @@ function CdlStage({
|
|
|
14198
14202
|
svgRef
|
|
14199
14203
|
}) {
|
|
14200
14204
|
const activeSet = new Set(currentPhase?.activate ?? []);
|
|
14201
|
-
const \
|
|
14202
|
-
if ((laid.edgeReveal ?? EDGE_REVEAL_DEFAULT) === "all") return () => true;
|
|
14205
|
+
const \u77E2\u5370\u306E\u51FA\u756A = useMemo(() => {
|
|
14203
14206
|
const \u521D\u51FA = /* @__PURE__ */ new Map();
|
|
14204
14207
|
laid.phases.forEach((p, i) => {
|
|
14205
14208
|
for (const id of p.activate ?? []) if (!\u521D\u51FA.has(id)) \u521D\u51FA.set(id, i);
|
|
14206
14209
|
});
|
|
14207
14210
|
const \u4ECA = currentPhase === void 0 ? -1 : laid.phases.findIndex((p) => p.id === currentPhase.id);
|
|
14208
|
-
|
|
14209
|
-
|
|
14210
|
-
|
|
14211
|
-
|
|
14211
|
+
const \u96A0\u3059 = (laid.edgeReveal ?? EDGE_REVEAL_DEFAULT) !== "all";
|
|
14212
|
+
return {
|
|
14213
|
+
\u51FA\u308B\u304B: (edgeId) => {
|
|
14214
|
+
if (!\u96A0\u3059) return true;
|
|
14215
|
+
const first = \u521D\u51FA.get(edgeId);
|
|
14216
|
+
if (first === void 0) return true;
|
|
14217
|
+
return \u4ECA < 0 || \u4ECA >= first;
|
|
14218
|
+
},
|
|
14219
|
+
/*
|
|
14220
|
+
* この段で初めて出るか (#584)。
|
|
14221
|
+
*
|
|
14222
|
+
* 起点から伸ばすのはこの段だけ。 光っているかで引くと、段をまたいで光り続ける図で
|
|
14223
|
+
* 既に見えている線が毎段引き直される (実測 = 表の図で 3 本とも段が変わるたびに伸び直した)。
|
|
14224
|
+
*
|
|
14225
|
+
* **隠さない図でも初出は数える**。 `all` は「最初から見せる」 だけの指定で、
|
|
14226
|
+
* 伸びる動きまで毎段繰り返してよいという意味ではない。
|
|
14227
|
+
*/
|
|
14228
|
+
\u4F38\u3070\u3059\u304B: (edgeId) => {
|
|
14229
|
+
const first = \u521D\u51FA.get(edgeId);
|
|
14230
|
+
if (first === void 0) return false;
|
|
14231
|
+
return \u4ECA === first;
|
|
14232
|
+
}
|
|
14212
14233
|
};
|
|
14213
|
-
}, [laid.phases, currentPhase]);
|
|
14234
|
+
}, [laid.phases, currentPhase, laid.edgeReveal]);
|
|
14214
14235
|
const drawSet = new Set(currentPhase?.draw ?? []);
|
|
14215
14236
|
const \u63CF\u304F\u9032\u307F = \u63CF\u304F\u9032\u307F\u306B\u76F4\u3059(progress, currentPhase?.drawRatio);
|
|
14216
14237
|
const { lifelineStarts, uniformFooterTop } = useMemo(() => {
|
|
@@ -14370,7 +14391,17 @@ function CdlStage({
|
|
|
14370
14391
|
},
|
|
14371
14392
|
lane.id
|
|
14372
14393
|
)),
|
|
14373
|
-
laid.edges.filter((edge) => \
|
|
14394
|
+
laid.edges.filter((edge) => \u77E2\u5370\u306E\u51FA\u756A.\u51FA\u308B\u304B(edge.id)).map((edge) => /* @__PURE__ */ jsx(
|
|
14395
|
+
CdlEdgeView,
|
|
14396
|
+
{
|
|
14397
|
+
edge,
|
|
14398
|
+
active: activeSet.has(edge.id),
|
|
14399
|
+
drawing: \u77E2\u5370\u306E\u51FA\u756A.\u4F38\u3070\u3059\u304B(edge.id),
|
|
14400
|
+
progress,
|
|
14401
|
+
stateValues
|
|
14402
|
+
},
|
|
14403
|
+
edge.id
|
|
14404
|
+
)),
|
|
14374
14405
|
laid.nodes.map((node) => {
|
|
14375
14406
|
const \u63CF\u304F = drawSet.has(node.id);
|
|
14376
14407
|
const view = /* @__PURE__ */ jsx(
|
|
@@ -14386,8 +14417,8 @@ function CdlStage({
|
|
|
14386
14417
|
);
|
|
14387
14418
|
return /* @__PURE__ */ jsx("g", { children: view }, node.id);
|
|
14388
14419
|
}),
|
|
14389
|
-
laid.edges.filter((edge) => Boolean(edge.dThrough) && \
|
|
14390
|
-
laid.edges.filter((edge) => \
|
|
14420
|
+
laid.edges.filter((edge) => Boolean(edge.dThrough) && \u77E2\u5370\u306E\u51FA\u756A.\u51FA\u308B\u304B(edge.id)).map((edge) => /* @__PURE__ */ jsx(CdlEdgeGlowView, { edge, active: activeSet.has(edge.id) }, `glow-${edge.id}`)),
|
|
14421
|
+
laid.edges.filter((edge) => \u77E2\u5370\u306E\u51FA\u756A.\u51FA\u308B\u304B(edge.id)).map((edge) => /* @__PURE__ */ jsx(
|
|
14391
14422
|
CdlEdgeLabelView,
|
|
14392
14423
|
{
|
|
14393
14424
|
edge,
|