@cardenelabs/cdl 0.66.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 +40 -1
- package/dist/index.cjs +48 -48
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +48 -48
- package/dist/index.js.map +1 -1
- package/dist/react.cjs +48 -48
- package/dist/react.cjs.map +1 -1
- package/dist/react.js +48 -48
- package/dist/react.js.map +1 -1
- package/package.json +1 -1
- package/src/kinds/gantt.tsx +57 -24
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,44 @@ 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
|
+
|
|
8
46
|
## [0.66.0] - 2026-09-15
|
|
9
47
|
|
|
10
48
|
### Fixed
|
|
@@ -2813,7 +2851,8 @@ Initial OSS release.
|
|
|
2813
2851
|
使わない = annotated tag を push しても GitHub Release は作られず、 Release を作っていない版で
|
|
2814
2852
|
行き止まりになる。
|
|
2815
2853
|
|
|
2816
|
-
[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
|
|
2817
2856
|
[0.66.0]: https://github.com/cardene777/cdl/compare/v0.65.0...v0.66.0
|
|
2818
2857
|
[0.65.0]: https://github.com/cardene777/cdl/compare/v0.64.1...v0.65.0
|
|
2819
2858
|
[0.64.1]: https://github.com/cardene777/cdl/compare/v0.64.0...v0.64.1
|
package/dist/index.cjs
CHANGED
|
@@ -27029,6 +27029,7 @@ function GanttNode({
|
|
|
27029
27029
|
const \u5E2F\u306E\u5DE6 = (idx) => xAt(idx) + \u5E2F\u306E\u4F59\u767D / 2;
|
|
27030
27030
|
const \u5E2F\u306E\u53F3 = (idx) => xAt(idx) + cellW - \u5E2F\u306E\u4F59\u767D / 2;
|
|
27031
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);
|
|
27032
27033
|
const taskById = new Map(\u6574\u3048\u305F.map((t) => [t.id, t]));
|
|
27033
27034
|
const rowOf = new Map(\u6574\u3048\u305F.map((t, i) => [t.id, i]));
|
|
27034
27035
|
return /* @__PURE__ */ jsxRuntime.jsxs("g", { transform: `translate(${x0} ${y0})`, children: [
|
|
@@ -27103,12 +27104,13 @@ function GanttNode({
|
|
|
27103
27104
|
const bx = \u5E2F\u306E\u5DE6(t.startIdx);
|
|
27104
27105
|
const by = yAt(row);
|
|
27105
27106
|
const bw = Math.max(0, \u5E2F\u306E\u53F3(t.endIdx) - bx);
|
|
27106
|
-
|
|
27107
|
-
|
|
27108
|
-
|
|
27109
|
-
|
|
27110
|
-
|
|
27111
|
-
|
|
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(
|
|
27112
27114
|
"rect",
|
|
27113
27115
|
{
|
|
27114
27116
|
"data-cdl-role": "gantt-bar",
|
|
@@ -27122,22 +27124,23 @@ function GanttNode({
|
|
|
27122
27124
|
fill: toneColor4(t.tone),
|
|
27123
27125
|
fillOpacity: 0.9
|
|
27124
27126
|
}
|
|
27125
|
-
),
|
|
27126
|
-
t.owner && rowH >= 22 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
27127
|
-
"text",
|
|
27128
|
-
{
|
|
27129
|
-
x: bx + 8,
|
|
27130
|
-
y: by + rowH / 2 + 4,
|
|
27131
|
-
fontSize: 11,
|
|
27132
|
-
fill: "var(--cdl-node-fill, #ffffff)",
|
|
27133
|
-
fontWeight: 600,
|
|
27134
|
-
children: t.owner
|
|
27135
|
-
}
|
|
27136
27127
|
)
|
|
27137
|
-
|
|
27138
|
-
|
|
27139
|
-
|
|
27140
|
-
|
|
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}`);
|
|
27141
27144
|
}),
|
|
27142
27145
|
\u6574\u3048\u305F.filter((t) => t.dependsOn && taskById.has(t.dependsOn)).map((t) => {
|
|
27143
27146
|
const parent = taskById.get(t.dependsOn);
|
|
@@ -27157,33 +27160,30 @@ function GanttNode({
|
|
|
27157
27160
|
const hasRoom = enterX - startX >= elbowGap;
|
|
27158
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}`;
|
|
27159
27162
|
const arrowHeadPath = `M ${tipX + arrowHeadSize} ${tipY} L ${tipX} ${tipY - arrowHeadSize / 2} L ${tipX} ${tipY + arrowHeadSize / 2} Z`;
|
|
27160
|
-
|
|
27161
|
-
|
|
27162
|
-
|
|
27163
|
-
|
|
27164
|
-
|
|
27165
|
-
|
|
27166
|
-
|
|
27167
|
-
|
|
27168
|
-
|
|
27169
|
-
|
|
27170
|
-
|
|
27171
|
-
|
|
27172
|
-
|
|
27173
|
-
|
|
27174
|
-
|
|
27175
|
-
|
|
27176
|
-
|
|
27177
|
-
|
|
27178
|
-
|
|
27179
|
-
|
|
27180
|
-
|
|
27181
|
-
|
|
27182
|
-
|
|
27183
|
-
|
|
27184
|
-
)
|
|
27185
|
-
] }, `dep-${parent.id}-${t.id}`)
|
|
27186
|
-
);
|
|
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}`);
|
|
27187
27187
|
})
|
|
27188
27188
|
] });
|
|
27189
27189
|
}
|