@cardenelabs/cdl 0.65.0 → 0.67.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 +84 -1
- package/dist/index.cjs +64 -50
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +64 -50
- package/dist/index.js.map +1 -1
- package/dist/react.cjs +64 -50
- package/dist/react.cjs.map +1 -1
- package/dist/react.js +64 -50
- package/dist/react.js.map +1 -1
- package/package.json +1 -1
- package/src/kinds/gantt.tsx +57 -24
- package/src/layout/edges.ts +60 -3
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,87 @@ CDL (Chainome Diagram Language) の主要変更履歴。
|
|
|
5
5
|
|
|
6
6
|
## [Unreleased]
|
|
7
7
|
|
|
8
|
+
## [0.67.0] - 2026-09-25
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- **工程表の帯を上から順に伸ばし、担当者の字を伸ばさず帯の真ん中に置くようにした** (#873)
|
|
13
|
+
|
|
14
|
+
段の `draw` で帯を現す時、帯を包む `g` に横倍率をかけて伸ばしていた。 包みの中には帯の四角だけでなく
|
|
15
|
+
**担当者の字も入っていた** ため、倍率が字にもかかる。 進みが 0.6 の時点で字の横幅が 6 割に潰れ、
|
|
16
|
+
伸び切るまで字が横に引き伸ばされ続けていた。
|
|
17
|
+
|
|
18
|
+
さらに **全ての帯が同じ倍率で同時に伸びていた**。 工程表は「前の工程が終わってから次が始まる」 を示す図
|
|
19
|
+
なのに、4 本が横並びで一斉に伸びる。
|
|
20
|
+
|
|
21
|
+
直した点は 4 つ。
|
|
22
|
+
|
|
23
|
+
| 直した点 | 変更前 | 変更後 |
|
|
24
|
+
|---|---|---|
|
|
25
|
+
| 倍率のかかる範囲 | 帯の四角と担当者の字 | 帯の四角だけ |
|
|
26
|
+
| 担当者の字の位置 | 帯の左端から 8 | 帯の左端と右端の真ん中 (`text-anchor` は `middle`) |
|
|
27
|
+
| 帯の伸び方 | 全ての帯が図全体の進み | 行ごとに区切り、上の行から順に |
|
|
28
|
+
| 依存の矢印を出す条件 | 図全体の進みが 1 | 両端の行がどちらも伸び切った時 |
|
|
29
|
+
|
|
30
|
+
行ごとの区切りは発想の図と木の図が既に使っている `段の伸び` を行番号に当てる。 進みを行数で等分し、
|
|
31
|
+
その区間に入ってから出るまでを 0→1 で返す。 **行が増えるほど 1 本あたりは速くなる** = 図全体の時間は
|
|
32
|
+
段の `duration` が決めるので、本数で割る以外に配りようがない。
|
|
33
|
+
|
|
34
|
+
担当者の字は **その行が伸び切ってから出す**。 薄く出しながら伸ばす案は採らない = 中央は伸び切った後の
|
|
35
|
+
位置なので、伸びている間は帯の無い所に字が浮く。
|
|
36
|
+
|
|
37
|
+
矢印を出す条件も図全体の進みから両端の行の伸びへ変えた。 変えないと、帯が 4 本とも並んでから矢印が
|
|
38
|
+
まとめて出る。
|
|
39
|
+
|
|
40
|
+
担当者の字に `data-cdl-role="gantt-owner"` が付く (それまで役割を持っていなかった)。
|
|
41
|
+
|
|
42
|
+
描く指定の無い図は 1 要素も変わらない = 行ごとの伸びは進みが 1 の時どの行も 1 を返す。
|
|
43
|
+
|
|
44
|
+
dragon の見本帳で工程表の字が伸びて見えた原因 (dragon#2549)。
|
|
45
|
+
|
|
46
|
+
## [0.66.0] - 2026-09-15
|
|
47
|
+
|
|
48
|
+
### Fixed
|
|
49
|
+
|
|
50
|
+
- **段の違う箱を繋ぐ矢印が、間の箱を貫くのを直した** (#867)
|
|
51
|
+
|
|
52
|
+
段の違う箱を横に繋ぐ経路は「横に走る → 縦に折れる → 横に走る」 の L 字を描く。 折れる位置は箱を避けて左右に
|
|
53
|
+
退くが、**退いた後に横の走りが箱を横切るかを一度も見ていなかった**。 退けた分だけ横の走りが伸びるため、
|
|
54
|
+
避けたはずの同じ箱を横切る。
|
|
55
|
+
|
|
56
|
+
段 0 に 検査 (x 40-360) と 記録 (x 1864-2184)、段 1 に背の高い 成形機 (x 648-968) と 塗装機 (x 1256-1576) を
|
|
57
|
+
並べ、成形機から記録へ引いた形。
|
|
58
|
+
|
|
59
|
+
```
|
|
60
|
+
変更前 ... M 968 486 L 1630 486 Q 1644 486, 1644 472 L 1644 150 Q 1644 136, 1658 136 L 1864 136
|
|
61
|
+
変更後 ... M 968 486 L 1174 486 Q 1188 486, 1188 472 L 1188 150 Q 1188 136, 1202 136 L 1864 136
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
変更前は `y = 486` の横の走りが `x = 968` から `1644` まで伸び、その間の 塗装機 (x 1256-1576、y 296-676) を
|
|
65
|
+
横切っていた。 絵の検査の `edge-node-cross` が 1 件出る形。
|
|
66
|
+
|
|
67
|
+
退く向きは「折れる位置を動かす量が少ない側」 だけで決めていた。 この形は右へ 228 と左へ 228 で並び、
|
|
68
|
+
同点を右に倒す規則が塞がる側を選んでいた。
|
|
69
|
+
|
|
70
|
+
直した点は 2 つ。
|
|
71
|
+
|
|
72
|
+
| 直した点 | 変更前 | 変更後 |
|
|
73
|
+
|---|---|---|
|
|
74
|
+
| 退く向き | 動かす量が少ない側 | 横の走りが横切らない側を先に見る。 左右で同じ時だけ動かす量が少ない側 |
|
|
75
|
+
| 退く判定の起点 | 縦の走りと説明文の帯だけ | 横の走りが箱を通る形も数える |
|
|
76
|
+
|
|
77
|
+
起点を広げないと、最初の折れる位置で既に横の走りが箱を横切っている形は 1 度も退かない。 繋ぎ元と同じ段に
|
|
78
|
+
箱を置き、折れる位置より手前に来るように並べると出る (実測 = 受付 → 出荷 の矢印が、間の 控え を横切る)。
|
|
79
|
+
|
|
80
|
+
横切るかの判定は箱の矩形そのもので行い、余白を足さない。 絵の検査が箱の矩形で貫通を数えるため、余白を足すと
|
|
81
|
+
「検査は通るのに経路だけ動く」 図が出る。 端がちょうど箱の縁に載る形も通さない = 箱の縁から出る線は必ず縁に
|
|
82
|
+
載るので、閉じた側にすると自分の出入口を障害物と読む。
|
|
83
|
+
|
|
84
|
+
dragon の見本帳 505 枚の辺 472 本を並べ直して突き合わせた結果、**変わった道筋は 0 本**。 横切る箱が無い
|
|
85
|
+
図では折れる位置が 2 つの箱のちょうど中間に残る。
|
|
86
|
+
|
|
87
|
+
dragon の見本帳で合流する矢印が間の部品を貫いた原因 (dragon#2011)。
|
|
88
|
+
|
|
8
89
|
## [0.65.0] - 2026-09-15
|
|
9
90
|
|
|
10
91
|
### Fixed
|
|
@@ -2770,7 +2851,9 @@ Initial OSS release.
|
|
|
2770
2851
|
使わない = annotated tag を push しても GitHub Release は作られず、 Release を作っていない版で
|
|
2771
2852
|
行き止まりになる。
|
|
2772
2853
|
|
|
2773
|
-
[Unreleased]: https://github.com/cardene777/cdl/compare/v0.
|
|
2854
|
+
[Unreleased]: https://github.com/cardene777/cdl/compare/v0.67.0...HEAD
|
|
2855
|
+
[0.67.0]: https://github.com/cardene777/cdl/compare/v0.66.0...v0.67.0
|
|
2856
|
+
[0.66.0]: https://github.com/cardene777/cdl/compare/v0.65.0...v0.66.0
|
|
2774
2857
|
[0.65.0]: https://github.com/cardene777/cdl/compare/v0.64.1...v0.65.0
|
|
2775
2858
|
[0.64.1]: https://github.com/cardene777/cdl/compare/v0.64.0...v0.64.1
|
|
2776
2859
|
[0.64.0]: https://github.com/cardene777/cdl/compare/v0.63.0...v0.64.0
|
package/dist/index.cjs
CHANGED
|
@@ -18760,6 +18760,10 @@ function verticalCornerDir(from, to) {
|
|
|
18760
18760
|
function cornerRadiusFor(\u534A\u5F84, ...\u8D70\u308A) {
|
|
18761
18761
|
return Math.min(\u534A\u5F84, ...\u8D70\u308A.map((v) => Math.abs(v)));
|
|
18762
18762
|
}
|
|
18763
|
+
function runCrossesBox(\u8D70\u308A, \u7BB1) {
|
|
18764
|
+
if (\u8D70\u308A.y <= \u7BB1.cy - \u7BB1.h / 2 || \u8D70\u308A.y >= \u7BB1.cy + \u7BB1.h / 2) return false;
|
|
18765
|
+
return \u7BB1.cx + \u7BB1.w / 2 > Math.min(\u8D70\u308A.x1, \u8D70\u308A.x2) && \u7BB1.cx - \u7BB1.w / 2 < Math.max(\u8D70\u308A.x1, \u8D70\u308A.x2);
|
|
18766
|
+
}
|
|
18763
18767
|
var VERTICAL_DETOUR_EXIT = 45;
|
|
18764
18768
|
function nearestBoxDistance(anchorX, dir, verticalTop, verticalBottom, boxes) {
|
|
18765
18769
|
let nearest = Infinity;
|
|
@@ -19752,18 +19756,28 @@ function routePath(from, to, fromSide, toSide, obstacles = [], detourSide, _from
|
|
|
19752
19756
|
const labelIntersect = oTop < labelBottom && oBottom > labelTop;
|
|
19753
19757
|
return segIntersect || labelIntersect;
|
|
19754
19758
|
};
|
|
19759
|
+
const \u6A2A\u306E\u8D70\u308A\u304C\u585E\u304C\u308B = (mx) => labelObstacles.some((o) => {
|
|
19760
|
+
if (o.id === from.id || o.id === to.id) return false;
|
|
19761
|
+
return runCrossesBox({ y: A.y, x1: A.x, x2: mx }, o) || runCrossesBox({ y: B.y, x1: mx, x2: B.x }, o);
|
|
19762
|
+
});
|
|
19755
19763
|
let iter = 0;
|
|
19756
19764
|
while (iter < 12) {
|
|
19757
19765
|
const band = labelBand(midX2);
|
|
19758
|
-
const hit = labelObstacles.find((o) => intersects(o, band))
|
|
19766
|
+
const hit = labelObstacles.find((o) => intersects(o, band)) ?? labelObstacles.find(
|
|
19767
|
+
(o) => o.id !== from.id && o.id !== to.id && (runCrossesBox({ y: A.y, x1: A.x, x2: midX2 }, o) || runCrossesBox({ y: B.y, x1: midX2, x2: B.x }, o))
|
|
19768
|
+
);
|
|
19759
19769
|
if (!hit) break;
|
|
19760
19770
|
const hitLeft = hit.cx - hit.w / 2;
|
|
19761
19771
|
const hitRight = hit.cx + hit.w / 2;
|
|
19762
19772
|
const retreatRight = hitRight + labelHalfW + CLEARANCE_NODE_LABEL + 4;
|
|
19763
19773
|
const retreatLeft = hitLeft - labelHalfW - CLEARANCE_NODE_LABEL - 4;
|
|
19774
|
+
const \u53F3\u304C\u585E\u304C\u308B = \u6A2A\u306E\u8D70\u308A\u304C\u585E\u304C\u308B(retreatRight);
|
|
19775
|
+
const \u5DE6\u304C\u585E\u304C\u308B = \u6A2A\u306E\u8D70\u308A\u304C\u585E\u304C\u308B(retreatLeft);
|
|
19764
19776
|
const dRight = Math.abs(retreatRight - midX2);
|
|
19765
19777
|
const dLeft = Math.abs(retreatLeft - midX2);
|
|
19766
|
-
|
|
19778
|
+
const \u6B21 = \u53F3\u304C\u585E\u304C\u308B === \u5DE6\u304C\u585E\u304C\u308B ? dRight <= dLeft ? retreatRight : retreatLeft : \u53F3\u304C\u585E\u304C\u308B ? retreatLeft : retreatRight;
|
|
19779
|
+
if (\u6B21 === midX2) break;
|
|
19780
|
+
midX2 = \u6B21;
|
|
19767
19781
|
iter++;
|
|
19768
19782
|
}
|
|
19769
19783
|
}
|
|
@@ -27015,6 +27029,7 @@ function GanttNode({
|
|
|
27015
27029
|
const \u5E2F\u306E\u5DE6 = (idx) => xAt(idx) + \u5E2F\u306E\u4F59\u767D / 2;
|
|
27016
27030
|
const \u5E2F\u306E\u53F3 = (idx) => xAt(idx) + cellW - \u5E2F\u306E\u4F59\u767D / 2;
|
|
27017
27031
|
const \u4F38\u3073 = \u9032\u307F\u3092\u7573\u3080(drawing, progress);
|
|
27032
|
+
const \u884C\u306E\u4F38\u3073 = (row) => \u6BB5\u306E\u4F38\u3073(\u4F38\u3073, row + 1, rowCount);
|
|
27018
27033
|
const taskById = new Map(\u6574\u3048\u305F.map((t) => [t.id, t]));
|
|
27019
27034
|
const rowOf = new Map(\u6574\u3048\u305F.map((t, i) => [t.id, i]));
|
|
27020
27035
|
return /* @__PURE__ */ jsxRuntime.jsxs("g", { transform: `translate(${x0} ${y0})`, children: [
|
|
@@ -27089,12 +27104,13 @@ function GanttNode({
|
|
|
27089
27104
|
const bx = \u5E2F\u306E\u5DE6(t.startIdx);
|
|
27090
27105
|
const by = yAt(row);
|
|
27091
27106
|
const bw = Math.max(0, \u5E2F\u306E\u53F3(t.endIdx) - bx);
|
|
27092
|
-
|
|
27093
|
-
|
|
27094
|
-
|
|
27095
|
-
|
|
27096
|
-
|
|
27097
|
-
|
|
27107
|
+
const \u3053\u306E\u884C = \u884C\u306E\u4F38\u3073(row);
|
|
27108
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
|
|
27109
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
27110
|
+
"g",
|
|
27111
|
+
{
|
|
27112
|
+
...drawing ? { transform: `translate(${bx} 0) scale(${\u3053\u306E\u884C} 1) translate(${-bx} 0)` } : {},
|
|
27113
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
27098
27114
|
"rect",
|
|
27099
27115
|
{
|
|
27100
27116
|
"data-cdl-role": "gantt-bar",
|
|
@@ -27108,22 +27124,23 @@ function GanttNode({
|
|
|
27108
27124
|
fill: toneColor4(t.tone),
|
|
27109
27125
|
fillOpacity: 0.9
|
|
27110
27126
|
}
|
|
27111
|
-
),
|
|
27112
|
-
t.owner && rowH >= 22 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
27113
|
-
"text",
|
|
27114
|
-
{
|
|
27115
|
-
x: bx + 8,
|
|
27116
|
-
y: by + rowH / 2 + 4,
|
|
27117
|
-
fontSize: 11,
|
|
27118
|
-
fill: "var(--cdl-node-fill, #ffffff)",
|
|
27119
|
-
fontWeight: 600,
|
|
27120
|
-
children: t.owner
|
|
27121
|
-
}
|
|
27122
27127
|
)
|
|
27123
|
-
|
|
27124
|
-
|
|
27125
|
-
|
|
27126
|
-
|
|
27128
|
+
}
|
|
27129
|
+
),
|
|
27130
|
+
t.owner && rowH >= 22 && \u3053\u306E\u884C >= 1 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
27131
|
+
"text",
|
|
27132
|
+
{
|
|
27133
|
+
"data-cdl-role": "gantt-owner",
|
|
27134
|
+
x: bx + bw / 2,
|
|
27135
|
+
y: by + rowH / 2 + 4,
|
|
27136
|
+
fontSize: 11,
|
|
27137
|
+
textAnchor: "middle",
|
|
27138
|
+
fill: "var(--cdl-node-fill, #ffffff)",
|
|
27139
|
+
fontWeight: 600,
|
|
27140
|
+
children: t.owner
|
|
27141
|
+
}
|
|
27142
|
+
)
|
|
27143
|
+
] }, `bar-${t.id}`);
|
|
27127
27144
|
}),
|
|
27128
27145
|
\u6574\u3048\u305F.filter((t) => t.dependsOn && taskById.has(t.dependsOn)).map((t) => {
|
|
27129
27146
|
const parent = taskById.get(t.dependsOn);
|
|
@@ -27143,33 +27160,30 @@ function GanttNode({
|
|
|
27143
27160
|
const hasRoom = enterX - startX >= elbowGap;
|
|
27144
27161
|
const path = hasRoom ? `M ${startX} ${parentMidY} L ${enterX} ${parentMidY} L ${enterX} ${tipY} L ${tipX} ${tipY}` : `M ${startX} ${parentMidY} L ${startX + elbowGap} ${parentMidY} L ${startX + elbowGap} ${(parentMidY + tipY) / 2} L ${enterX} ${(parentMidY + tipY) / 2} L ${enterX} ${tipY} L ${tipX} ${tipY}`;
|
|
27145
27162
|
const arrowHeadPath = `M ${tipX + arrowHeadSize} ${tipY} L ${tipX} ${tipY - arrowHeadSize / 2} L ${tipX} ${tipY + arrowHeadSize / 2} Z`;
|
|
27146
|
-
|
|
27147
|
-
|
|
27148
|
-
|
|
27149
|
-
|
|
27150
|
-
|
|
27151
|
-
|
|
27152
|
-
|
|
27153
|
-
|
|
27154
|
-
|
|
27155
|
-
|
|
27156
|
-
|
|
27157
|
-
|
|
27158
|
-
|
|
27159
|
-
|
|
27160
|
-
|
|
27161
|
-
|
|
27162
|
-
|
|
27163
|
-
|
|
27164
|
-
|
|
27165
|
-
|
|
27166
|
-
|
|
27167
|
-
|
|
27168
|
-
|
|
27169
|
-
|
|
27170
|
-
)
|
|
27171
|
-
] }, `dep-${parent.id}-${t.id}`)
|
|
27172
|
-
);
|
|
27163
|
+
const \u4E21\u7AEF\u304C\u51FA\u305F = \u884C\u306E\u4F38\u3073(parentRow) >= 1 && \u884C\u306E\u4F38\u3073(childRow) >= 1;
|
|
27164
|
+
return drawing && !\u4E21\u7AEF\u304C\u51FA\u305F ? null : /* @__PURE__ */ jsxRuntime.jsxs("g", { "data-cdl-role": "gantt-arrow", children: [
|
|
27165
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
27166
|
+
"path",
|
|
27167
|
+
{
|
|
27168
|
+
d: path,
|
|
27169
|
+
fill: "none",
|
|
27170
|
+
stroke: "var(--cdl-text-mute, #8a8678)",
|
|
27171
|
+
strokeWidth: 1.75,
|
|
27172
|
+
strokeLinejoin: "round",
|
|
27173
|
+
strokeLinecap: "round"
|
|
27174
|
+
}
|
|
27175
|
+
),
|
|
27176
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
27177
|
+
"path",
|
|
27178
|
+
{
|
|
27179
|
+
d: arrowHeadPath,
|
|
27180
|
+
fill: "var(--cdl-text-mute, #8a8678)",
|
|
27181
|
+
stroke: "var(--cdl-text-mute, #8a8678)",
|
|
27182
|
+
strokeWidth: 0.5,
|
|
27183
|
+
strokeLinejoin: "round"
|
|
27184
|
+
}
|
|
27185
|
+
)
|
|
27186
|
+
] }, `dep-${parent.id}-${t.id}`);
|
|
27173
27187
|
})
|
|
27174
27188
|
] });
|
|
27175
27189
|
}
|