@cardenelabs/cdl 0.38.0 → 0.40.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 +44 -1
- package/SPEC.md +7 -1
- package/dist/index.cjs +156 -101
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +156 -101
- package/dist/index.js.map +1 -1
- package/dist/react.cjs +156 -101
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +1 -1
- package/dist/react.d.ts +1 -1
- package/dist/react.js +156 -101
- package/dist/react.js.map +1 -1
- package/dist/{render-BYdmSviQ.d.cts → render-UGswDfAh.d.cts} +5 -0
- package/dist/{render-BYdmSviQ.d.ts → render-UGswDfAh.d.ts} +5 -0
- package/package.json +1 -1
- package/src/kinds/chart-gauge.tsx +49 -14
- package/src/kinds/chart-pie.tsx +1 -16
- package/src/kinds/chart-radial.tsx +45 -11
- package/src/kinds/chart-stacked-bar.tsx +96 -54
- package/src/kinds/chart-waffle.tsx +32 -2
- package/src/kinds/draw-arc.tsx +42 -0
- package/src/render/nodes.tsx +41 -8
- package/src/types.ts +5 -0
- package/src/validate.ts +8 -0
package/dist/react.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import 'react';
|
|
2
|
-
export { q as CdlDiagramView, m as CdlDiagramViewProps } from './render-
|
|
2
|
+
export { q as CdlDiagramView, m as CdlDiagramViewProps } from './render-UGswDfAh.cjs';
|
package/dist/react.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import 'react';
|
|
2
|
-
export { q as CdlDiagramView, m as CdlDiagramViewProps } from './render-
|
|
2
|
+
export { q as CdlDiagramView, m as CdlDiagramViewProps } from './render-UGswDfAh.js';
|
package/dist/react.js
CHANGED
|
@@ -9524,7 +9524,11 @@ var DRAW_KINDS = /* @__PURE__ */ new Set([
|
|
|
9524
9524
|
"mind-map",
|
|
9525
9525
|
"tree-hierarchy",
|
|
9526
9526
|
"gantt-timeline",
|
|
9527
|
-
"funnel-stages"
|
|
9527
|
+
"funnel-stages",
|
|
9528
|
+
"chart-gauge",
|
|
9529
|
+
"chart-radial",
|
|
9530
|
+
"chart-stacked-bar",
|
|
9531
|
+
"chart-waffle"
|
|
9528
9532
|
]);
|
|
9529
9533
|
var KINDS = new Set(NODE_KINDS);
|
|
9530
9534
|
var ENG_BANNED = /\b(FUNCTION|STORAGE|EVENT LOG|BALANCES MAPPING|READ|WRITE|EMIT|CALL)\b/;
|
|
@@ -11853,6 +11857,15 @@ function interpolateColor(template, stateValues, fallback) {
|
|
|
11853
11857
|
if (!template) return fallback;
|
|
11854
11858
|
return interpolate(template, stateValues);
|
|
11855
11859
|
}
|
|
11860
|
+
function \u6247\u5F62\u306E\u5207\u308A\u629C\u304D(cx, cy, r, \u958B\u304D, \u8D77\u70B9 = -Math.PI / 2, \u5168\u5468 = Math.PI * 2) {
|
|
11861
|
+
if (\u958B\u304D <= 0) return null;
|
|
11862
|
+
if (\u958B\u304D >= 1 && \u5168\u5468 >= Math.PI * 2) return /* @__PURE__ */ jsx("circle", { cx, cy, r });
|
|
11863
|
+
const a0 = \u8D77\u70B9;
|
|
11864
|
+
const a1 = a0 + Math.min(1, \u958B\u304D) * \u5168\u5468;
|
|
11865
|
+
const large = a1 - a0 > Math.PI ? 1 : 0;
|
|
11866
|
+
const d = `M ${cx} ${cy} L ${cx + r * Math.cos(a0)} ${cy + r * Math.sin(a0)} A ${r} ${r} 0 ${large} 1 ${cx + r * Math.cos(a1)} ${cy + r * Math.sin(a1)} Z`;
|
|
11867
|
+
return /* @__PURE__ */ jsx("path", { d });
|
|
11868
|
+
}
|
|
11856
11869
|
|
|
11857
11870
|
// src/kinds/chart-number.ts
|
|
11858
11871
|
function \u5B9F\u5024\u8868\u8A18(v) {
|
|
@@ -12300,15 +12313,6 @@ function \u8F2A\u306E\u9053(cx, cy, R, r, a0, a1) {
|
|
|
12300
12313
|
const large = a1 - a0 > Math.PI ? 1 : 0;
|
|
12301
12314
|
return `M ${cx + R * Math.cos(a0)} ${cy + R * Math.sin(a0)} A ${R} ${R} 0 ${large} 1 ${cx + R * Math.cos(a1)} ${cy + R * Math.sin(a1)} L ${cx + r * Math.cos(a1)} ${cy + r * Math.sin(a1)} A ${r} ${r} 0 ${large} 0 ${cx + r * Math.cos(a0)} ${cy + r * Math.sin(a0)} Z`;
|
|
12302
12315
|
}
|
|
12303
|
-
function \u6247\u5F62\u306E\u5207\u308A\u629C\u304D(cx, cy, r, \u958B\u304D) {
|
|
12304
|
-
if (\u958B\u304D <= 0) return null;
|
|
12305
|
-
if (\u958B\u304D >= 1) return /* @__PURE__ */ jsx("circle", { cx, cy, r });
|
|
12306
|
-
const a0 = -Math.PI / 2;
|
|
12307
|
-
const a1 = a0 + \u958B\u304D * Math.PI * 2;
|
|
12308
|
-
const large = \u958B\u304D > 0.5 ? 1 : 0;
|
|
12309
|
-
const d = `M ${cx} ${cy} L ${cx + r * Math.cos(a0)} ${cy + r * Math.sin(a0)} A ${r} ${r} 0 ${large} 1 ${cx + r * Math.cos(a1)} ${cy + r * Math.sin(a1)} Z`;
|
|
12310
|
-
return /* @__PURE__ */ jsx("path", { d });
|
|
12311
|
-
}
|
|
12312
12316
|
function sliceColor(tone, idx) {
|
|
12313
12317
|
if (tone) return TONE[tone];
|
|
12314
12318
|
return chartSeriesColor(idx);
|
|
@@ -12316,7 +12320,9 @@ function sliceColor(tone, idx) {
|
|
|
12316
12320
|
function ChartGaugeNode({
|
|
12317
12321
|
node,
|
|
12318
12322
|
active,
|
|
12319
|
-
stateValues = {}
|
|
12323
|
+
stateValues = {},
|
|
12324
|
+
drawing = false,
|
|
12325
|
+
progress = 1
|
|
12320
12326
|
}) {
|
|
12321
12327
|
const x0 = node.cx - node.w / 2;
|
|
12322
12328
|
const y0 = node.cy - node.h / 2;
|
|
@@ -12361,6 +12367,21 @@ function ChartGaugeNode({
|
|
|
12361
12367
|
const \u898B\u51FA\u3057\u306E\u7D1A = Math.max(9, Math.round(\u5408\u8A08\u306E\u7D1A * 0.38));
|
|
12362
12368
|
const \u5185\u8A33\u306E\u5E45 = \u4F7F\u3048\u308B\u5E452 / Math.max(data.length, 1);
|
|
12363
12369
|
const \u5185\u8A33\u306Ey = cy + \u5F27\u3068\u5185\u8A33\u306E\u9593;
|
|
12370
|
+
const \u4F38\u3073 = \u9032\u307F\u3092\u7573\u3080(drawing, progress);
|
|
12371
|
+
const \u5207\u308A\u629C\u304Did = `cdl-gauge-draw-${useId().replace(/[^A-Za-z0-9_-]/g, "")}`;
|
|
12372
|
+
const \u5F27\u305F\u3061 = slices.map((s, idx) => /* @__PURE__ */ jsx(
|
|
12373
|
+
"path",
|
|
12374
|
+
{
|
|
12375
|
+
"data-cdl-role": "chart-gauge-arc",
|
|
12376
|
+
"data-cdl-unresolved": s.d.unresolved ? "true" : void 0,
|
|
12377
|
+
d: s.path,
|
|
12378
|
+
fill: arcColor(s.d.tone, idx),
|
|
12379
|
+
stroke: "var(--cdl-node-fill, #ffffff)",
|
|
12380
|
+
strokeWidth: 3,
|
|
12381
|
+
strokeLinejoin: "round"
|
|
12382
|
+
},
|
|
12383
|
+
`arc-${idx}`
|
|
12384
|
+
));
|
|
12364
12385
|
return /* @__PURE__ */ jsxs("g", { transform: `translate(${x0} ${y0})`, children: [
|
|
12365
12386
|
/* @__PURE__ */ jsx(
|
|
12366
12387
|
"rect",
|
|
@@ -12376,19 +12397,8 @@ function ChartGaugeNode({
|
|
|
12376
12397
|
strokeWidth: active ? 3 : 1.25
|
|
12377
12398
|
}
|
|
12378
12399
|
),
|
|
12379
|
-
|
|
12380
|
-
|
|
12381
|
-
{
|
|
12382
|
-
"data-cdl-role": "chart-gauge-arc",
|
|
12383
|
-
"data-cdl-unresolved": s.d.unresolved ? "true" : void 0,
|
|
12384
|
-
d: s.path,
|
|
12385
|
-
fill: arcColor(s.d.tone, idx),
|
|
12386
|
-
stroke: "var(--cdl-node-fill, #ffffff)",
|
|
12387
|
-
strokeWidth: 3,
|
|
12388
|
-
strokeLinejoin: "round"
|
|
12389
|
-
},
|
|
12390
|
-
`arc-${idx}`
|
|
12391
|
-
)),
|
|
12400
|
+
drawing && /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx("clipPath", { id: \u5207\u308A\u629C\u304Did, children: \u6247\u5F62\u306E\u5207\u308A\u629C\u304D(cx, cy, radius + 2, \u4F38\u3073, Math.PI, Math.PI) }) }),
|
|
12401
|
+
drawing ? /* @__PURE__ */ jsx("g", { clipPath: `url(#${\u5207\u308A\u629C\u304Did})`, children: \u5F27\u305F\u3061 }) : \u5F27\u305F\u3061,
|
|
12392
12402
|
/* @__PURE__ */ jsx(
|
|
12393
12403
|
"text",
|
|
12394
12404
|
{
|
|
@@ -12453,7 +12463,9 @@ function arcColor(tone, idx) {
|
|
|
12453
12463
|
function ChartRadialNode({
|
|
12454
12464
|
node,
|
|
12455
12465
|
active,
|
|
12456
|
-
stateValues = {}
|
|
12466
|
+
stateValues = {},
|
|
12467
|
+
drawing = false,
|
|
12468
|
+
progress = 1
|
|
12457
12469
|
}) {
|
|
12458
12470
|
const x0 = node.cx - node.w / 2;
|
|
12459
12471
|
const y0 = node.cy - node.h / 2;
|
|
@@ -12492,6 +12504,20 @@ function ChartRadialNode({
|
|
|
12492
12504
|
};
|
|
12493
12505
|
});
|
|
12494
12506
|
const \u4E00\u89A7\u306E\u59CB\u307E\u308A = PAD + (\u4F7F\u3048\u308B\u9AD8\u3055 - \u884C\u306E\u9AD8\u3055 * data.length) / 2 + \u884C\u306E\u9AD8\u3055 / 2;
|
|
12507
|
+
const \u958B\u304D = \u9032\u307F\u3092\u7573\u3080(drawing, progress);
|
|
12508
|
+
const \u5207\u308A\u629C\u304Did = `cdl-radial-draw-${useId().replace(/[^A-Za-z0-9_-]/g, "")}`;
|
|
12509
|
+
const \u53D6\u308A\u5206\u305F\u3061 = rings.map(
|
|
12510
|
+
(r, idx) => r.\u53D6\u308A\u5206 === null ? null : /* @__PURE__ */ jsx(
|
|
12511
|
+
"path",
|
|
12512
|
+
{
|
|
12513
|
+
"data-cdl-role": "chart-radial-arc",
|
|
12514
|
+
"data-cdl-unresolved": r.d.unresolved ? "true" : void 0,
|
|
12515
|
+
d: r.\u53D6\u308A\u5206,
|
|
12516
|
+
fill: arcColor2(r.d.tone, idx)
|
|
12517
|
+
},
|
|
12518
|
+
`arc-${idx}`
|
|
12519
|
+
)
|
|
12520
|
+
);
|
|
12495
12521
|
return /* @__PURE__ */ jsxs("g", { transform: `translate(${x0} ${y0})`, children: [
|
|
12496
12522
|
/* @__PURE__ */ jsx(
|
|
12497
12523
|
"rect",
|
|
@@ -12517,18 +12543,8 @@ function ChartRadialNode({
|
|
|
12517
12543
|
},
|
|
12518
12544
|
`track-${idx}`
|
|
12519
12545
|
)),
|
|
12520
|
-
|
|
12521
|
-
|
|
12522
|
-
"path",
|
|
12523
|
-
{
|
|
12524
|
-
"data-cdl-role": "chart-radial-arc",
|
|
12525
|
-
"data-cdl-unresolved": r.d.unresolved ? "true" : void 0,
|
|
12526
|
-
d: r.\u53D6\u308A\u5206,
|
|
12527
|
-
fill: arcColor2(r.d.tone, idx)
|
|
12528
|
-
},
|
|
12529
|
-
`arc-${idx}`
|
|
12530
|
-
)
|
|
12531
|
-
),
|
|
12546
|
+
drawing && /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx("clipPath", { id: \u5207\u308A\u629C\u304Did, children: \u6247\u5F62\u306E\u5207\u308A\u629C\u304D(\u5F27\u306Ecx, cy, \u5916\u534A\u5F84 + \u5E2F\u306E\u5E45, \u958B\u304D) }) }),
|
|
12547
|
+
drawing ? /* @__PURE__ */ jsx("g", { clipPath: `url(#${\u5207\u308A\u629C\u304Did})`, children: \u53D6\u308A\u5206\u305F\u3061 }) : \u53D6\u308A\u5206\u305F\u3061,
|
|
12532
12548
|
data.map((d, idx) => {
|
|
12533
12549
|
const y = \u4E00\u89A7\u306E\u59CB\u307E\u308A + \u884C\u306E\u9AD8\u3055 * idx;
|
|
12534
12550
|
return /* @__PURE__ */ jsxs("g", { "data-cdl-role": "chart-radial-item", children: [
|
|
@@ -12746,7 +12762,9 @@ function \u5370\u306E\u5272\u4ED8(\u5024) {
|
|
|
12746
12762
|
function ChartWaffleNode({
|
|
12747
12763
|
node,
|
|
12748
12764
|
active,
|
|
12749
|
-
stateValues = {}
|
|
12765
|
+
stateValues = {},
|
|
12766
|
+
drawing = false,
|
|
12767
|
+
progress = 1
|
|
12750
12768
|
}) {
|
|
12751
12769
|
const x0 = node.cx - node.w / 2;
|
|
12752
12770
|
const y0 = node.cy - node.h / 2;
|
|
@@ -12775,6 +12793,7 @@ function ChartWaffleNode({
|
|
|
12775
12793
|
\u914D\u5206.forEach((n, idx) => {
|
|
12776
12794
|
for (let k = 0; k < n; k++) \u6301\u3061\u4E3B.push(idx);
|
|
12777
12795
|
});
|
|
12796
|
+
const \u57CB\u307E\u3063\u305F = Math.round(\u9032\u307F\u3092\u7573\u3080(drawing, progress) * WAFFLE_TOTAL);
|
|
12778
12797
|
const \u4E00\u89A7\u306E\u59CB\u307E\u308A = PAD + (\u4F7F\u3048\u308B\u9AD8\u3055 - \u884C\u306E\u9AD8\u3055 * data.length) / 2 + \u884C\u306E\u9AD8\u3055 / 2;
|
|
12779
12798
|
return /* @__PURE__ */ jsxs("g", { transform: `translate(${x0} ${y0})`, children: [
|
|
12780
12799
|
/* @__PURE__ */ jsx(
|
|
@@ -12795,6 +12814,7 @@ function ChartWaffleNode({
|
|
|
12795
12814
|
const \u884C = Math.floor(k / WAFFLE_COLS);
|
|
12796
12815
|
const \u5217 = k % WAFFLE_COLS;
|
|
12797
12816
|
const owner = \u6301\u3061\u4E3B[k];
|
|
12817
|
+
const \u57CB\u307E\u3063\u3066\u3044\u308B = owner !== void 0 && k < \u57CB\u307E\u3063\u305F;
|
|
12798
12818
|
return /* @__PURE__ */ jsx(
|
|
12799
12819
|
"rect",
|
|
12800
12820
|
{
|
|
@@ -12805,8 +12825,8 @@ function ChartWaffleNode({
|
|
|
12805
12825
|
width: \u5370,
|
|
12806
12826
|
height: \u5370,
|
|
12807
12827
|
rx: 2,
|
|
12808
|
-
fill:
|
|
12809
|
-
fillOpacity:
|
|
12828
|
+
fill: \u57CB\u307E\u3063\u3066\u3044\u308B ? \u5370\u306E\u82722(data[owner].tone, owner) : "var(--cdl-divider, #d4d4d8)",
|
|
12829
|
+
fillOpacity: \u57CB\u307E\u3063\u3066\u3044\u308B ? 1 : 0.35
|
|
12810
12830
|
},
|
|
12811
12831
|
`cell-${k}`
|
|
12812
12832
|
);
|
|
@@ -12851,7 +12871,9 @@ var SLICE_MIN_W_FOR_VALUE = 84;
|
|
|
12851
12871
|
function ChartStackedBarNode({
|
|
12852
12872
|
node,
|
|
12853
12873
|
active,
|
|
12854
|
-
stateValues = {}
|
|
12874
|
+
stateValues = {},
|
|
12875
|
+
drawing = false,
|
|
12876
|
+
progress = 1
|
|
12855
12877
|
}) {
|
|
12856
12878
|
const x0 = node.cx - node.w / 2;
|
|
12857
12879
|
const y0 = node.cy - node.h / 2;
|
|
@@ -12869,6 +12891,8 @@ function ChartStackedBarNode({
|
|
|
12869
12891
|
const \u4E00\u89A7\u306E\u9AD8\u3055 = 26;
|
|
12870
12892
|
const \u5168\u4F53\u306E\u9AD8\u3055 = \u5E2F\u305F\u3061.length * \u5E2F\u306E\u9AD8\u3055 + (\u5E2F\u305F\u3061.length - 1) * \u5E2F\u306E\u9593 + 16 + \u4E00\u89A7\u306E\u9AD8\u3055;
|
|
12871
12893
|
const \u4E0A\u7AEF = Math.max(PAD, (node.h - \u5168\u4F53\u306E\u9AD8\u3055) / 2);
|
|
12894
|
+
const \u4F38\u3073 = \u9032\u307F\u3092\u7573\u3080(drawing, progress);
|
|
12895
|
+
const \u5207\u308A\u629C\u304Did = `cdl-stacked-bar-draw-${useId().replace(/[^A-Za-z0-9_-]/g, "")}`;
|
|
12872
12896
|
return /* @__PURE__ */ jsxs("g", { transform: `translate(${x0} ${y0})`, children: [
|
|
12873
12897
|
/* @__PURE__ */ jsx(
|
|
12874
12898
|
"rect",
|
|
@@ -12884,6 +12908,7 @@ function ChartStackedBarNode({
|
|
|
12884
12908
|
strokeWidth: active ? 3 : 1.25
|
|
12885
12909
|
}
|
|
12886
12910
|
),
|
|
12911
|
+
drawing && /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx("clipPath", { id: \u5207\u308A\u629C\u304Did, children: /* @__PURE__ */ jsx("rect", { x: 0, y: 0, width: \u5E2F\u306E\u5DE6 + \u5E2F\u306E\u5E45 * \u4F38\u3073, height: node.h }) }) }),
|
|
12887
12912
|
\u5E2F\u305F\u3061.map((\u5E2F, \u6BB5) => {
|
|
12888
12913
|
const y = \u4E0A\u7AEF + \u6BB5 * (\u5E2F\u306E\u9AD8\u3055 + \u5E2F\u306E\u9593);
|
|
12889
12914
|
let \u5DE6 = \u5E2F\u306E\u5DE6;
|
|
@@ -12900,68 +12925,62 @@ function ChartStackedBarNode({
|
|
|
12900
12925
|
children: \u5E2F.\u540D\u524D
|
|
12901
12926
|
}
|
|
12902
12927
|
),
|
|
12903
|
-
|
|
12904
|
-
const
|
|
12905
|
-
|
|
12906
|
-
|
|
12907
|
-
|
|
12908
|
-
|
|
12909
|
-
/* @__PURE__ */
|
|
12910
|
-
|
|
12911
|
-
|
|
12912
|
-
|
|
12913
|
-
|
|
12914
|
-
|
|
12915
|
-
|
|
12916
|
-
|
|
12917
|
-
|
|
12918
|
-
|
|
12919
|
-
|
|
12920
|
-
|
|
12921
|
-
|
|
12922
|
-
|
|
12923
|
-
|
|
12924
|
-
|
|
12925
|
-
|
|
12926
|
-
|
|
12927
|
-
|
|
12928
|
-
|
|
12929
|
-
|
|
12930
|
-
|
|
12931
|
-
|
|
12932
|
-
|
|
12933
|
-
|
|
12934
|
-
|
|
12935
|
-
|
|
12936
|
-
|
|
12937
|
-
|
|
12938
|
-
|
|
12939
|
-
|
|
12940
|
-
|
|
12941
|
-
|
|
12942
|
-
|
|
12943
|
-
|
|
12944
|
-
|
|
12945
|
-
|
|
12946
|
-
|
|
12947
|
-
|
|
12948
|
-
|
|
12928
|
+
(() => {
|
|
12929
|
+
const \u533A\u753B\u305F\u3061 = \u5E2F.\u533A\u753B.map((s, idx) => {
|
|
12930
|
+
const w = \u5E2F\u306E\u5E45 * s.\u5272\u5408;
|
|
12931
|
+
const x = \u5DE6;
|
|
12932
|
+
\u5DE6 += w;
|
|
12933
|
+
const \u8272 = \u5370\u306E\u82723(s.tone, idx);
|
|
12934
|
+
return /* @__PURE__ */ jsxs("g", { children: [
|
|
12935
|
+
/* @__PURE__ */ jsx(
|
|
12936
|
+
"rect",
|
|
12937
|
+
{
|
|
12938
|
+
"data-cdl-role": "chart-stacked-bar-slice",
|
|
12939
|
+
"data-cdl-unresolved": s.unresolved ? "true" : void 0,
|
|
12940
|
+
x,
|
|
12941
|
+
y,
|
|
12942
|
+
width: Math.max(0, w),
|
|
12943
|
+
height: \u5E2F\u306E\u9AD8\u3055,
|
|
12944
|
+
fill: \u8272
|
|
12945
|
+
}
|
|
12946
|
+
),
|
|
12947
|
+
w >= SLICE_MIN_W_FOR_TEXT && /* @__PURE__ */ jsx(
|
|
12948
|
+
"text",
|
|
12949
|
+
{
|
|
12950
|
+
"data-cdl-role": "chart-stacked-bar-slice-text",
|
|
12951
|
+
x: x + w / 2,
|
|
12952
|
+
y: y + \u5E2F\u306E\u9AD8\u3055 / 2 + (w >= SLICE_MIN_W_FOR_VALUE ? -2 : 4),
|
|
12953
|
+
fontSize: \u533A\u753B\u306E\u7D1A,
|
|
12954
|
+
fontWeight: 700,
|
|
12955
|
+
textAnchor: "middle",
|
|
12956
|
+
fill: "#ffffff",
|
|
12957
|
+
children: \u5272\u5408\u8868\u8A18(s.\u5272\u5408)
|
|
12958
|
+
}
|
|
12959
|
+
),
|
|
12960
|
+
w >= SLICE_MIN_W_FOR_VALUE && /* @__PURE__ */ jsx(
|
|
12961
|
+
"text",
|
|
12962
|
+
{
|
|
12963
|
+
"data-cdl-role": "chart-stacked-bar-slice-value",
|
|
12964
|
+
x: x + w / 2,
|
|
12965
|
+
y: y + \u5E2F\u306E\u9AD8\u3055 / 2 + 13,
|
|
12966
|
+
fontSize: \u533A\u753B\u306E\u7D1A - 1,
|
|
12967
|
+
textAnchor: "middle",
|
|
12968
|
+
fill: "#ffffff",
|
|
12969
|
+
fillOpacity: 0.85,
|
|
12970
|
+
children: \u5B9F\u5024\u8868\u8A18(s.\u5B9F\u5024)
|
|
12971
|
+
}
|
|
12972
|
+
)
|
|
12973
|
+
] }, `slice-${idx}`);
|
|
12974
|
+
});
|
|
12975
|
+
return drawing ? /* @__PURE__ */ jsx("g", { clipPath: `url(#${\u5207\u308A\u629C\u304Did})`, children: \u533A\u753B\u305F\u3061 }) : \u533A\u753B\u305F\u3061;
|
|
12976
|
+
})()
|
|
12949
12977
|
] }, `bar-${\u6BB5}`);
|
|
12950
12978
|
}),
|
|
12951
12979
|
\u4E00\u89A7\u306E\u4E26\u3073(data, \u5E2F\u306E\u5DE6, node.w - PAD, \u540D\u524D\u306E\u7D1A).map(({ d, idx, x, \u884C }) => {
|
|
12952
12980
|
const y = \u4E0A\u7AEF + \u5E2F\u305F\u3061.length * (\u5E2F\u306E\u9AD8\u3055 + \u5E2F\u306E\u9593) - \u5E2F\u306E\u9593 + 16 + \u4E00\u89A7\u306E\u9AD8\u3055 / 2 + \u884C * \u4E00\u89A7\u306E\u9AD8\u3055;
|
|
12953
12981
|
return /* @__PURE__ */ jsxs("g", { "data-cdl-role": "chart-stacked-bar-legend", children: [
|
|
12954
12982
|
/* @__PURE__ */ jsx("rect", { x, y: y - 5, width: 10, height: 10, rx: 2, fill: \u5370\u306E\u82723(d.tone, idx) }),
|
|
12955
|
-
/* @__PURE__ */ jsx(
|
|
12956
|
-
"text",
|
|
12957
|
-
{
|
|
12958
|
-
x: x + 16,
|
|
12959
|
-
y: y + 4,
|
|
12960
|
-
fontSize: \u540D\u524D\u306E\u7D1A,
|
|
12961
|
-
fill: "var(--cdl-text, #1a1f2a)",
|
|
12962
|
-
children: d.label
|
|
12963
|
-
}
|
|
12964
|
-
)
|
|
12983
|
+
/* @__PURE__ */ jsx("text", { x: x + 16, y: y + 4, fontSize: \u540D\u524D\u306E\u7D1A, fill: "var(--cdl-text, #1a1f2a)", children: d.label })
|
|
12965
12984
|
] }, `legend-${idx}`);
|
|
12966
12985
|
})
|
|
12967
12986
|
] });
|
|
@@ -17922,9 +17941,27 @@ function CdlNodeView({
|
|
|
17922
17941
|
}
|
|
17923
17942
|
);
|
|
17924
17943
|
case "chart-gauge":
|
|
17925
|
-
return /* @__PURE__ */ jsx(
|
|
17944
|
+
return /* @__PURE__ */ jsx(
|
|
17945
|
+
ChartGaugeNode,
|
|
17946
|
+
{
|
|
17947
|
+
node: resolvedNode,
|
|
17948
|
+
active,
|
|
17949
|
+
stateValues,
|
|
17950
|
+
drawing,
|
|
17951
|
+
progress
|
|
17952
|
+
}
|
|
17953
|
+
);
|
|
17926
17954
|
case "chart-stacked-bar":
|
|
17927
|
-
return /* @__PURE__ */ jsx(
|
|
17955
|
+
return /* @__PURE__ */ jsx(
|
|
17956
|
+
ChartStackedBarNode,
|
|
17957
|
+
{
|
|
17958
|
+
node: resolvedNode,
|
|
17959
|
+
active,
|
|
17960
|
+
stateValues,
|
|
17961
|
+
drawing,
|
|
17962
|
+
progress
|
|
17963
|
+
}
|
|
17964
|
+
);
|
|
17928
17965
|
case "chart-slope":
|
|
17929
17966
|
return /* @__PURE__ */ jsx(
|
|
17930
17967
|
ChartSlopeNode,
|
|
@@ -17937,11 +17974,29 @@ function CdlNodeView({
|
|
|
17937
17974
|
}
|
|
17938
17975
|
);
|
|
17939
17976
|
case "chart-waffle":
|
|
17940
|
-
return /* @__PURE__ */ jsx(
|
|
17977
|
+
return /* @__PURE__ */ jsx(
|
|
17978
|
+
ChartWaffleNode,
|
|
17979
|
+
{
|
|
17980
|
+
node: resolvedNode,
|
|
17981
|
+
active,
|
|
17982
|
+
stateValues,
|
|
17983
|
+
drawing,
|
|
17984
|
+
progress
|
|
17985
|
+
}
|
|
17986
|
+
);
|
|
17941
17987
|
case "chart-stat":
|
|
17942
17988
|
return /* @__PURE__ */ jsx(ChartStatNode, { node: resolvedNode, active, stateValues });
|
|
17943
17989
|
case "chart-radial":
|
|
17944
|
-
return /* @__PURE__ */ jsx(
|
|
17990
|
+
return /* @__PURE__ */ jsx(
|
|
17991
|
+
ChartRadialNode,
|
|
17992
|
+
{
|
|
17993
|
+
node: resolvedNode,
|
|
17994
|
+
active,
|
|
17995
|
+
stateValues,
|
|
17996
|
+
drawing,
|
|
17997
|
+
progress
|
|
17998
|
+
}
|
|
17999
|
+
);
|
|
17945
18000
|
case "chart-bar":
|
|
17946
18001
|
return /* @__PURE__ */ jsx(
|
|
17947
18002
|
ChartBarNode,
|