@cardenelabs/cdl 0.35.0 → 0.36.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 +21 -1
- package/README.md +24 -0
- package/dist/index.cjs +9 -2
- 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 +9 -2
- package/dist/index.js.map +1 -1
- package/dist/react.cjs +9 -2
- 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 +9 -2
- package/dist/react.js.map +1 -1
- package/dist/{render-C2rcAsgk.d.cts → render-R7v2bfyz.d.cts} +18 -1
- package/dist/{render-C2rcAsgk.d.ts → render-R7v2bfyz.d.ts} +18 -1
- package/package.json +1 -1
- package/src/index.ts +1 -0
- package/src/kinds/chart-slope.tsx +29 -3
- package/src/render/template-fields.ts +2 -0
- package/src/types.ts +18 -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-R7v2bfyz.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-R7v2bfyz.js';
|
package/dist/react.js
CHANGED
|
@@ -13026,8 +13026,15 @@ function ChartSlopeNode({
|
|
|
13026
13026
|
const \u4E0A\u7AEF = PAD + (\u524D\u3042\u308A ? \u6642\u70B9\u306E\u7D1A + 12 : 0) + 6;
|
|
13027
13027
|
const \u4E0B\u7AEF = Math.max(\u4E0A\u7AEF + 10, node.h - PAD - 6);
|
|
13028
13028
|
const y\u3092\u53D6\u308B = (v) => \u5C3A\u306E\u5E45 > 0 ? \u4E0B\u7AEF - (v - \u6700\u5C0F) / \u5C3A\u306E\u5E45 * (\u4E0B\u7AEF - \u4E0A\u7AEF) : (\u4E0A\u7AEF + \u4E0B\u7AEF) / 2;
|
|
13029
|
+
const \u5F62 = \u524D\u3042\u308A && node.chartSlopeForm === "delta" ? "delta" : "values";
|
|
13030
|
+
const \u5897\u6E1B\u8868\u8A18 = (\u524D, \u4ECA) => {
|
|
13031
|
+
const \u5DEE = \u4ECA - \u524D;
|
|
13032
|
+
return \u5DEE > 0 ? `+${\u5B9F\u5024\u8868\u8A18(\u5DEE)}` : \u5B9F\u5024\u8868\u8A18(\u5DEE);
|
|
13033
|
+
};
|
|
13029
13034
|
const \u5DE6\u306E\u5B57 = \u7CFB\u5217\u305F\u3061.map((s) => \u5B9F\u5024\u8868\u8A18(s.\u524D));
|
|
13030
|
-
const \u53F3\u306E\u5B57 = \u7CFB\u5217\u305F\u3061.map(
|
|
13035
|
+
const \u53F3\u306E\u5B57 = \u7CFB\u5217\u305F\u3061.map(
|
|
13036
|
+
(s) => \u5F62 === "delta" ? \u5897\u6E1B\u8868\u8A18(s.\u524D, s.\u4ECA) : \u5B9F\u5024\u8868\u8A18(s.\u4ECA)
|
|
13037
|
+
);
|
|
13031
13038
|
const \u5DE6\u5024\u5E45 = Math.max(0, ...\u5DE6\u306E\u5B57.map((t) => textWidth(t, \u5024\u306E\u7D1A)));
|
|
13032
13039
|
const \u53F3\u5024\u5E45 = Math.max(0, ...\u53F3\u306E\u5B57.map((t) => textWidth(t, \u5024\u306E\u7D1A)));
|
|
13033
13040
|
const \u540D\u524D\u306B\u4F7F\u3048\u308B = Math.max(
|
|
@@ -13183,7 +13190,7 @@ function ChartSlopeNode({
|
|
|
13183
13190
|
/* @__PURE__ */ jsx(
|
|
13184
13191
|
"text",
|
|
13185
13192
|
{
|
|
13186
|
-
"data-cdl-role": "chart-slope-value",
|
|
13193
|
+
"data-cdl-role": \u5F62 === "delta" ? "chart-slope-delta" : "chart-slope-value",
|
|
13187
13194
|
x: \u53F3\u8EF8x + \u8EF8\u304B\u3089\u5024\u307E\u3067,
|
|
13188
13195
|
y: \u53F3y + 5,
|
|
13189
13196
|
fontSize: \u5024\u306E\u7D1A,
|