@cardenelabs/cdl 0.33.0 → 0.34.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 +17 -1
- package/README.md +10 -3
- package/dist/index.cjs +5 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/react.cjs +5 -5
- package/dist/react.cjs.map +1 -1
- package/dist/react.js +5 -5
- package/dist/react.js.map +1 -1
- package/package.json +1 -1
- package/src/kinds/chart-slope.tsx +9 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cardenelabs/cdl",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.34.0",
|
|
4
4
|
"description": "CDL (Chainome Diagram Language). Mermaid-like declarative DSL that compiles to animated SVG diagrams. Built for blockchain / Solidity flows, generic enough for sequence / flow / state / ER / topology diagrams.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "cardene777",
|
|
@@ -38,6 +38,10 @@ import { 進みを畳む, 伸ばすdash } from "./draw-progress";
|
|
|
38
38
|
*
|
|
39
39
|
* 左は 名前 → 値、右は 値 → 名前 の順で軸から外へ並べる。 値を軸に近い側へ置くと、
|
|
40
40
|
* 左右とも値の列が縦に揃って読み比べられる。
|
|
41
|
+
*
|
|
42
|
+
* 値と名前は **別の役割** で出す (`chart-slope-value` / `chart-slope-name`、cdl#693)。
|
|
43
|
+
* 1 つにまとめると使う側が値だけに字体を当てられず、寸法を記録する側も 2 つの大きさを
|
|
44
|
+
* 1 行に潰す。 他の図表 (`chart-stat` / `chart-stacked-bar`) も字を役割で分けている。
|
|
41
45
|
*/
|
|
42
46
|
|
|
43
47
|
/** 線を引くのに最低限要る横幅。 名札が長い図でもこれだけは残す */
|
|
@@ -237,7 +241,7 @@ export function ChartSlopeNode({
|
|
|
237
241
|
{前あり ? (
|
|
238
242
|
<>
|
|
239
243
|
<text
|
|
240
|
-
data-cdl-role="chart-slope-
|
|
244
|
+
data-cdl-role="chart-slope-value"
|
|
241
245
|
x={左軸x - 軸から値まで}
|
|
242
246
|
y={左y + 5}
|
|
243
247
|
textAnchor="end"
|
|
@@ -248,7 +252,7 @@ export function ChartSlopeNode({
|
|
|
248
252
|
{左の字[i]}
|
|
249
253
|
</text>
|
|
250
254
|
<text
|
|
251
|
-
data-cdl-role="chart-slope-
|
|
255
|
+
data-cdl-role="chart-slope-name"
|
|
252
256
|
x={左軸x - 軸から値まで - 左値幅 - 値から名前まで}
|
|
253
257
|
y={左y + 5}
|
|
254
258
|
textAnchor="end"
|
|
@@ -260,7 +264,7 @@ export function ChartSlopeNode({
|
|
|
260
264
|
</>
|
|
261
265
|
) : (
|
|
262
266
|
<text
|
|
263
|
-
data-cdl-role="chart-slope-
|
|
267
|
+
data-cdl-role="chart-slope-name"
|
|
264
268
|
x={左軸x - 軸から値まで}
|
|
265
269
|
y={右y + 5}
|
|
266
270
|
textAnchor="end"
|
|
@@ -274,7 +278,7 @@ export function ChartSlopeNode({
|
|
|
274
278
|
{右を出す && (
|
|
275
279
|
<>
|
|
276
280
|
<text
|
|
277
|
-
data-cdl-role="chart-slope-
|
|
281
|
+
data-cdl-role="chart-slope-value"
|
|
278
282
|
x={右軸x + 軸から値まで}
|
|
279
283
|
y={右y + 5}
|
|
280
284
|
fontSize={値の級}
|
|
@@ -285,7 +289,7 @@ export function ChartSlopeNode({
|
|
|
285
289
|
</text>
|
|
286
290
|
{前あり && (
|
|
287
291
|
<text
|
|
288
|
-
data-cdl-role="chart-slope-
|
|
292
|
+
data-cdl-role="chart-slope-name"
|
|
289
293
|
x={右軸x + 軸から値まで + 右値幅 + 値から名前まで}
|
|
290
294
|
y={右y + 5}
|
|
291
295
|
fontSize={名前の級}
|