@cardenelabs/cdl 0.35.0 → 0.37.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/dist/react.cjs CHANGED
@@ -13028,8 +13028,20 @@ function ChartSlopeNode({
13028
13028
  const \u4E0A\u7AEF = PAD + (\u524D\u3042\u308A ? \u6642\u70B9\u306E\u7D1A + 12 : 0) + 6;
13029
13029
  const \u4E0B\u7AEF = Math.max(\u4E0A\u7AEF + 10, node.h - PAD - 6);
13030
13030
  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;
13031
+ const \u66F8\u3044\u305F\u5F62 = node.chartSlopeForm;
13032
+ const \u5F62 = \u524D\u3042\u308A && (\u66F8\u3044\u305F\u5F62 === "delta" || \u66F8\u3044\u305F\u5F62 === "rank") ? \u66F8\u3044\u305F\u5F62 : "values";
13033
+ const \u9806\u4F4D\u3092\u53D6\u308B = (v, \u5168\u90E8) => \u5168\u90E8.filter((x) => x > v).length + 1;
13034
+ const \u524D\u306E\u9806\u4F4D = \u7CFB\u5217\u305F\u3061.map((s) => \u9806\u4F4D\u3092\u53D6\u308B(s.\u524D, \u7CFB\u5217\u305F\u3061.map((x) => x.\u524D)));
13035
+ const \u4ECA\u306E\u9806\u4F4D = \u7CFB\u5217\u305F\u3061.map((s) => \u9806\u4F4D\u3092\u53D6\u308B(s.\u4ECA, \u7CFB\u5217\u305F\u3061.map((x) => x.\u4ECA)));
13036
+ const \u6BB5\u306Ey\u3092\u53D6\u308B = (\u9806\u4F4D) => \u7CFB\u5217\u305F\u3061.length > 1 ? \u4E0A\u7AEF + (\u9806\u4F4D - 1) / (\u7CFB\u5217\u305F\u3061.length - 1) * (\u4E0B\u7AEF - \u4E0A\u7AEF) : (\u4E0A\u7AEF + \u4E0B\u7AEF) / 2;
13037
+ const \u5897\u6E1B\u8868\u8A18 = (\u524D, \u4ECA) => {
13038
+ const \u5DEE = \u4ECA - \u524D;
13039
+ return \u5DEE > 0 ? `+${\u5B9F\u5024\u8868\u8A18(\u5DEE)}` : \u5B9F\u5024\u8868\u8A18(\u5DEE);
13040
+ };
13031
13041
  const \u5DE6\u306E\u5B57 = \u7CFB\u5217\u305F\u3061.map((s) => \u5B9F\u5024\u8868\u8A18(s.\u524D));
13032
- const \u53F3\u306E\u5B57 = \u7CFB\u5217\u305F\u3061.map((s) => \u5B9F\u5024\u8868\u8A18(s.\u4ECA));
13042
+ const \u53F3\u306E\u5B57 = \u7CFB\u5217\u305F\u3061.map(
13043
+ (s) => \u5F62 === "delta" ? \u5897\u6E1B\u8868\u8A18(s.\u524D, s.\u4ECA) : \u5B9F\u5024\u8868\u8A18(s.\u4ECA)
13044
+ );
13033
13045
  const \u5DE6\u5024\u5E45 = Math.max(0, ...\u5DE6\u306E\u5B57.map((t) => textWidth(t, \u5024\u306E\u7D1A)));
13034
13046
  const \u53F3\u5024\u5E45 = Math.max(0, ...\u53F3\u306E\u5B57.map((t) => textWidth(t, \u5024\u306E\u7D1A)));
13035
13047
  const \u540D\u524D\u306B\u4F7F\u3048\u308B = Math.max(
@@ -13104,8 +13116,8 @@ function ChartSlopeNode({
13104
13116
  )
13105
13117
  ] }),
13106
13118
  \u7CFB\u5217\u305F\u3061.map((s, i) => {
13107
- const \u5DE6y = y\u3092\u53D6\u308B(s.\u524D);
13108
- const \u53F3y = y\u3092\u53D6\u308B(s.\u4ECA);
13119
+ const \u5DE6y = \u5F62 === "rank" ? \u6BB5\u306Ey\u3092\u53D6\u308B(\u524D\u306E\u9806\u4F4D[i]) : y\u3092\u53D6\u308B(s.\u524D);
13120
+ const \u53F3y = \u5F62 === "rank" ? \u6BB5\u306Ey\u3092\u53D6\u308B(\u4ECA\u306E\u9806\u4F4D[i]) : y\u3092\u53D6\u308B(s.\u4ECA);
13109
13121
  const \u672A\u89E3\u6C7A = s.\u672A\u89E3\u6C7A ? "true" : void 0;
13110
13122
  return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
13111
13123
  \u524D\u3042\u308A && /* @__PURE__ */ jsxRuntime.jsx(
@@ -13185,7 +13197,7 @@ function ChartSlopeNode({
13185
13197
  /* @__PURE__ */ jsxRuntime.jsx(
13186
13198
  "text",
13187
13199
  {
13188
- "data-cdl-role": "chart-slope-value",
13200
+ "data-cdl-role": \u5F62 === "delta" ? "chart-slope-delta" : "chart-slope-value",
13189
13201
  x: \u53F3\u8EF8x + \u8EF8\u304B\u3089\u5024\u307E\u3067,
13190
13202
  y: \u53F3y + 5,
13191
13203
  fontSize: \u5024\u306E\u7D1A,