@cardenelabs/cdl 0.39.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 +23 -1
- package/SPEC.md +1 -0
- package/dist/index.cjs +19 -5
- 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 +19 -5
- package/dist/index.js.map +1 -1
- package/dist/react.cjs +19 -5
- 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 +19 -5
- package/dist/react.js.map +1 -1
- package/dist/{render-B1ArenZ7.d.cts → render-UGswDfAh.d.cts} +1 -0
- package/dist/{render-B1ArenZ7.d.ts → render-UGswDfAh.d.ts} +1 -0
- package/package.json +1 -1
- package/src/kinds/chart-waffle.tsx +32 -2
- package/src/render/nodes.tsx +10 -2
- package/src/types.ts +1 -0
- package/src/validate.ts +2 -0
package/dist/react.cjs
CHANGED
|
@@ -9529,7 +9529,8 @@ var DRAW_KINDS = /* @__PURE__ */ new Set([
|
|
|
9529
9529
|
"funnel-stages",
|
|
9530
9530
|
"chart-gauge",
|
|
9531
9531
|
"chart-radial",
|
|
9532
|
-
"chart-stacked-bar"
|
|
9532
|
+
"chart-stacked-bar",
|
|
9533
|
+
"chart-waffle"
|
|
9533
9534
|
]);
|
|
9534
9535
|
var KINDS = new Set(NODE_KINDS);
|
|
9535
9536
|
var ENG_BANNED = /\b(FUNCTION|STORAGE|EVENT LOG|BALANCES MAPPING|READ|WRITE|EMIT|CALL)\b/;
|
|
@@ -12763,7 +12764,9 @@ function \u5370\u306E\u5272\u4ED8(\u5024) {
|
|
|
12763
12764
|
function ChartWaffleNode({
|
|
12764
12765
|
node,
|
|
12765
12766
|
active,
|
|
12766
|
-
stateValues = {}
|
|
12767
|
+
stateValues = {},
|
|
12768
|
+
drawing = false,
|
|
12769
|
+
progress = 1
|
|
12767
12770
|
}) {
|
|
12768
12771
|
const x0 = node.cx - node.w / 2;
|
|
12769
12772
|
const y0 = node.cy - node.h / 2;
|
|
@@ -12792,6 +12795,7 @@ function ChartWaffleNode({
|
|
|
12792
12795
|
\u914D\u5206.forEach((n, idx) => {
|
|
12793
12796
|
for (let k = 0; k < n; k++) \u6301\u3061\u4E3B.push(idx);
|
|
12794
12797
|
});
|
|
12798
|
+
const \u57CB\u307E\u3063\u305F = Math.round(\u9032\u307F\u3092\u7573\u3080(drawing, progress) * WAFFLE_TOTAL);
|
|
12795
12799
|
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;
|
|
12796
12800
|
return /* @__PURE__ */ jsxRuntime.jsxs("g", { transform: `translate(${x0} ${y0})`, children: [
|
|
12797
12801
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -12812,6 +12816,7 @@ function ChartWaffleNode({
|
|
|
12812
12816
|
const \u884C = Math.floor(k / WAFFLE_COLS);
|
|
12813
12817
|
const \u5217 = k % WAFFLE_COLS;
|
|
12814
12818
|
const owner = \u6301\u3061\u4E3B[k];
|
|
12819
|
+
const \u57CB\u307E\u3063\u3066\u3044\u308B = owner !== void 0 && k < \u57CB\u307E\u3063\u305F;
|
|
12815
12820
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
12816
12821
|
"rect",
|
|
12817
12822
|
{
|
|
@@ -12822,8 +12827,8 @@ function ChartWaffleNode({
|
|
|
12822
12827
|
width: \u5370,
|
|
12823
12828
|
height: \u5370,
|
|
12824
12829
|
rx: 2,
|
|
12825
|
-
fill:
|
|
12826
|
-
fillOpacity:
|
|
12830
|
+
fill: \u57CB\u307E\u3063\u3066\u3044\u308B ? \u5370\u306E\u82722(data[owner].tone, owner) : "var(--cdl-divider, #d4d4d8)",
|
|
12831
|
+
fillOpacity: \u57CB\u307E\u3063\u3066\u3044\u308B ? 1 : 0.35
|
|
12827
12832
|
},
|
|
12828
12833
|
`cell-${k}`
|
|
12829
12834
|
);
|
|
@@ -17971,7 +17976,16 @@ function CdlNodeView({
|
|
|
17971
17976
|
}
|
|
17972
17977
|
);
|
|
17973
17978
|
case "chart-waffle":
|
|
17974
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
17979
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
17980
|
+
ChartWaffleNode,
|
|
17981
|
+
{
|
|
17982
|
+
node: resolvedNode,
|
|
17983
|
+
active,
|
|
17984
|
+
stateValues,
|
|
17985
|
+
drawing,
|
|
17986
|
+
progress
|
|
17987
|
+
}
|
|
17988
|
+
);
|
|
17975
17989
|
case "chart-stat":
|
|
17976
17990
|
return /* @__PURE__ */ jsxRuntime.jsx(ChartStatNode, { node: resolvedNode, active, stateValues });
|
|
17977
17991
|
case "chart-radial":
|