@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/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,25 @@ CDL (Chainome Diagram Language) の主要変更履歴。
|
|
|
5
5
|
|
|
6
6
|
## [Unreleased]
|
|
7
7
|
|
|
8
|
+
## [0.18.1] - 2026-08-29
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- **矢印を伸ばすのは初めて出る段だけにした** (#584)
|
|
13
|
+
|
|
14
|
+
伸ばすかを「その矢印が光っているか」 で引いていたため、段をまたいで光り続ける図で
|
|
15
|
+
**既に見えている線が段の変わるたびに引き直されて** いた (実測 = 表の図で 3 本とも毎段伸び直す)。
|
|
16
|
+
|
|
17
|
+
「増えた」 のは 1 度だけなので、動くのも 1 度にする。 段の並びから矢印ごとの初出を求め、
|
|
18
|
+
その段でだけ起点から伸ばす。
|
|
19
|
+
|
|
20
|
+
**隠さない図 (`edgeReveal: "all"`) でも初出は数える**。 `all` は「最初から見せる」 だけの
|
|
21
|
+
指定で、伸びる動きまで毎段繰り返してよいという意味ではない。
|
|
22
|
+
|
|
23
|
+
段が矢印を 1 度も名指ししない図では伸ばさない = 初出が無く、いつ伸ばすか決められない。
|
|
24
|
+
|
|
25
|
+
検査が実際の描画から読めるよう、`data-cdl-drawing` を矢印に出す。
|
|
26
|
+
|
|
8
27
|
## [0.18.0] - 2026-08-29
|
|
9
28
|
|
|
10
29
|
### Added
|
|
@@ -945,7 +964,8 @@ Initial OSS release.
|
|
|
945
964
|
使わない = annotated tag を push しても GitHub Release は作られず、 Release を作っていない版で
|
|
946
965
|
行き止まりになる。
|
|
947
966
|
|
|
948
|
-
[Unreleased]: https://github.com/cardene777/cdl/compare/v0.18.
|
|
967
|
+
[Unreleased]: https://github.com/cardene777/cdl/compare/v0.18.1...HEAD
|
|
968
|
+
[0.18.1]: https://github.com/cardene777/cdl/compare/v0.18.0...v0.18.1
|
|
949
969
|
[0.18.0]: https://github.com/cardene777/cdl/compare/v0.17.1...v0.18.0
|
|
950
970
|
[0.17.1]: https://github.com/cardene777/cdl/compare/v0.17.0...v0.17.1
|
|
951
971
|
[0.17.0]: https://github.com/cardene777/cdl/compare/v0.16.0...v0.17.0
|
package/dist/index.cjs
CHANGED
|
@@ -21274,6 +21274,7 @@ function labelTextOpacity(line) {
|
|
|
21274
21274
|
function CdlEdgeView({
|
|
21275
21275
|
edge,
|
|
21276
21276
|
active,
|
|
21277
|
+
drawing,
|
|
21277
21278
|
progress,
|
|
21278
21279
|
stateValues
|
|
21279
21280
|
}) {
|
|
@@ -21298,6 +21299,7 @@ function CdlEdgeView({
|
|
|
21298
21299
|
"data-cdl-from": edge.from,
|
|
21299
21300
|
"data-cdl-to": edge.to,
|
|
21300
21301
|
"data-cdl-active": active ? "true" : "false",
|
|
21302
|
+
"data-cdl-drawing": drawing ? "true" : "false",
|
|
21301
21303
|
"data-cdl-path-d": edge.d,
|
|
21302
21304
|
"data-cdl-label-x": edge.labelX,
|
|
21303
21305
|
"data-cdl-label-y": edge.labelY,
|
|
@@ -21329,6 +21331,7 @@ function CdlEdgeView({
|
|
|
21329
21331
|
{
|
|
21330
21332
|
edge,
|
|
21331
21333
|
active,
|
|
21334
|
+
drawing,
|
|
21332
21335
|
progress,
|
|
21333
21336
|
color,
|
|
21334
21337
|
marker,
|
|
@@ -21356,6 +21359,7 @@ function CdlEdgeView({
|
|
|
21356
21359
|
function SolidEdgePath({
|
|
21357
21360
|
edge,
|
|
21358
21361
|
active,
|
|
21362
|
+
drawing,
|
|
21359
21363
|
progress,
|
|
21360
21364
|
color,
|
|
21361
21365
|
marker,
|
|
@@ -21363,7 +21367,7 @@ function SolidEdgePath({
|
|
|
21363
21367
|
dashed,
|
|
21364
21368
|
stateValues
|
|
21365
21369
|
}) {
|
|
21366
|
-
const visibleD =
|
|
21370
|
+
const visibleD = drawing ? pathSubpath(edge.d, progress) : edge.d;
|
|
21367
21371
|
const defaultWidth = active ? 5 : 2.5;
|
|
21368
21372
|
const boundWidth = edge.widthBind && stateValues ? resolveNumericAttr(edge.widthBind, stateValues, defaultWidth) : defaultWidth;
|
|
21369
21373
|
const boundStroke = edge.strokeBind && stateValues ? interpolate(edge.strokeBind, stateValues) : color;
|
|
@@ -28807,19 +28811,36 @@ function CdlStage({
|
|
|
28807
28811
|
svgRef
|
|
28808
28812
|
}) {
|
|
28809
28813
|
const activeSet = new Set(currentPhase?.activate ?? []);
|
|
28810
|
-
const \
|
|
28811
|
-
if ((laid.edgeReveal ?? EDGE_REVEAL_DEFAULT) === "all") return () => true;
|
|
28814
|
+
const \u77E2\u5370\u306E\u51FA\u756A = react.useMemo(() => {
|
|
28812
28815
|
const \u521D\u51FA = /* @__PURE__ */ new Map();
|
|
28813
28816
|
laid.phases.forEach((p, i) => {
|
|
28814
28817
|
for (const id of p.activate ?? []) if (!\u521D\u51FA.has(id)) \u521D\u51FA.set(id, i);
|
|
28815
28818
|
});
|
|
28816
28819
|
const \u4ECA = currentPhase === void 0 ? -1 : laid.phases.findIndex((p) => p.id === currentPhase.id);
|
|
28817
|
-
|
|
28818
|
-
|
|
28819
|
-
|
|
28820
|
-
|
|
28820
|
+
const \u96A0\u3059 = (laid.edgeReveal ?? EDGE_REVEAL_DEFAULT) !== "all";
|
|
28821
|
+
return {
|
|
28822
|
+
\u51FA\u308B\u304B: (edgeId) => {
|
|
28823
|
+
if (!\u96A0\u3059) return true;
|
|
28824
|
+
const first = \u521D\u51FA.get(edgeId);
|
|
28825
|
+
if (first === void 0) return true;
|
|
28826
|
+
return \u4ECA < 0 || \u4ECA >= first;
|
|
28827
|
+
},
|
|
28828
|
+
/*
|
|
28829
|
+
* この段で初めて出るか (#584)。
|
|
28830
|
+
*
|
|
28831
|
+
* 起点から伸ばすのはこの段だけ。 光っているかで引くと、段をまたいで光り続ける図で
|
|
28832
|
+
* 既に見えている線が毎段引き直される (実測 = 表の図で 3 本とも段が変わるたびに伸び直した)。
|
|
28833
|
+
*
|
|
28834
|
+
* **隠さない図でも初出は数える**。 `all` は「最初から見せる」 だけの指定で、
|
|
28835
|
+
* 伸びる動きまで毎段繰り返してよいという意味ではない。
|
|
28836
|
+
*/
|
|
28837
|
+
\u4F38\u3070\u3059\u304B: (edgeId) => {
|
|
28838
|
+
const first = \u521D\u51FA.get(edgeId);
|
|
28839
|
+
if (first === void 0) return false;
|
|
28840
|
+
return \u4ECA === first;
|
|
28841
|
+
}
|
|
28821
28842
|
};
|
|
28822
|
-
}, [laid.phases, currentPhase]);
|
|
28843
|
+
}, [laid.phases, currentPhase, laid.edgeReveal]);
|
|
28823
28844
|
const drawSet = new Set(currentPhase?.draw ?? []);
|
|
28824
28845
|
const \u63CF\u304F\u9032\u307F = \u63CF\u304F\u9032\u307F\u306B\u76F4\u3059(progress, currentPhase?.drawRatio);
|
|
28825
28846
|
const { lifelineStarts, uniformFooterTop } = react.useMemo(() => {
|
|
@@ -28979,7 +29000,17 @@ function CdlStage({
|
|
|
28979
29000
|
},
|
|
28980
29001
|
lane.id
|
|
28981
29002
|
)),
|
|
28982
|
-
laid.edges.filter((edge) => \
|
|
29003
|
+
laid.edges.filter((edge) => \u77E2\u5370\u306E\u51FA\u756A.\u51FA\u308B\u304B(edge.id)).map((edge) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
29004
|
+
CdlEdgeView,
|
|
29005
|
+
{
|
|
29006
|
+
edge,
|
|
29007
|
+
active: activeSet.has(edge.id),
|
|
29008
|
+
drawing: \u77E2\u5370\u306E\u51FA\u756A.\u4F38\u3070\u3059\u304B(edge.id),
|
|
29009
|
+
progress,
|
|
29010
|
+
stateValues
|
|
29011
|
+
},
|
|
29012
|
+
edge.id
|
|
29013
|
+
)),
|
|
28983
29014
|
laid.nodes.map((node) => {
|
|
28984
29015
|
const \u63CF\u304F = drawSet.has(node.id);
|
|
28985
29016
|
const view = /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -28995,8 +29026,8 @@ function CdlStage({
|
|
|
28995
29026
|
);
|
|
28996
29027
|
return /* @__PURE__ */ jsxRuntime.jsx("g", { children: view }, node.id);
|
|
28997
29028
|
}),
|
|
28998
|
-
laid.edges.filter((edge) => Boolean(edge.dThrough) && \
|
|
28999
|
-
laid.edges.filter((edge) => \
|
|
29029
|
+
laid.edges.filter((edge) => Boolean(edge.dThrough) && \u77E2\u5370\u306E\u51FA\u756A.\u51FA\u308B\u304B(edge.id)).map((edge) => /* @__PURE__ */ jsxRuntime.jsx(CdlEdgeGlowView, { edge, active: activeSet.has(edge.id) }, `glow-${edge.id}`)),
|
|
29030
|
+
laid.edges.filter((edge) => \u77E2\u5370\u306E\u51FA\u756A.\u51FA\u308B\u304B(edge.id)).map((edge) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
29000
29031
|
CdlEdgeLabelView,
|
|
29001
29032
|
{
|
|
29002
29033
|
edge,
|