@shapesos/clay 0.16.0 → 0.17.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/artifacts.cjs +13 -35
- package/dist/artifacts.cjs.map +1 -1
- package/dist/artifacts.js +2 -2
- package/dist/blocks.cjs +13 -35
- package/dist/blocks.cjs.map +1 -1
- package/dist/blocks.js +3 -3
- package/dist/chart.cjs +13 -35
- package/dist/chart.cjs.map +1 -1
- package/dist/chart.d.cts +3 -11
- package/dist/chart.d.ts +3 -11
- package/dist/chart.js +1 -1
- package/dist/chat.cjs +13 -35
- package/dist/chat.cjs.map +1 -1
- package/dist/chat.js +4 -4
- package/dist/{chunk-UZKNSAAD.js → chunk-46ZYTBX5.js} +2 -2
- package/dist/{chunk-2YCBDSPK.js → chunk-6YZ65KPW.js} +2 -2
- package/dist/{chunk-GAZRZZRF.js → chunk-B6GAPZ2R.js} +3 -3
- package/dist/{chunk-U3IXCSV6.js → chunk-PUVZ2S3F.js} +17 -39
- package/dist/chunk-PUVZ2S3F.js.map +1 -0
- package/dist/index.cjs +13 -35
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +4 -4
- package/package.json +1 -1
- package/dist/chunk-U3IXCSV6.js.map +0 -1
- /package/dist/{chunk-UZKNSAAD.js.map → chunk-46ZYTBX5.js.map} +0 -0
- /package/dist/{chunk-2YCBDSPK.js.map → chunk-6YZ65KPW.js.map} +0 -0
- /package/dist/{chunk-GAZRZZRF.js.map → chunk-B6GAPZ2R.js.map} +0 -0
package/dist/artifacts.cjs
CHANGED
|
@@ -1087,11 +1087,6 @@ function coerceNumericColumns(rows, numericKeys) {
|
|
|
1087
1087
|
|
|
1088
1088
|
// src/components/chart/bar-chart/bar-chart.tsx
|
|
1089
1089
|
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1090
|
-
var STACK_TOTAL_KEY = "__stackTotal";
|
|
1091
|
-
var VALUE_LABEL_HEADROOM = 20;
|
|
1092
|
-
function sumSeries(row, keys) {
|
|
1093
|
-
return keys.reduce((sum, key) => sum + (Number(row[key]) || 0), 0);
|
|
1094
|
-
}
|
|
1095
1090
|
function BarChart({
|
|
1096
1091
|
data,
|
|
1097
1092
|
xKey,
|
|
@@ -1106,7 +1101,6 @@ function BarChart({
|
|
|
1106
1101
|
showGrid = true,
|
|
1107
1102
|
showXAxis = true,
|
|
1108
1103
|
showYAxis = true,
|
|
1109
|
-
showValueLabels,
|
|
1110
1104
|
xAxisInterval = 0,
|
|
1111
1105
|
xAxisAngle,
|
|
1112
1106
|
xAxisTickFormatter
|
|
@@ -1117,24 +1111,14 @@ function BarChart({
|
|
|
1117
1111
|
[data, seriesKeys]
|
|
1118
1112
|
);
|
|
1119
1113
|
const resolvedShowLegend = showLegend ?? series.length > 1;
|
|
1120
|
-
const resolvedShowValueLabels = showValueLabels ?? true;
|
|
1121
|
-
const plotData = (0, import_react9.useMemo)(() => {
|
|
1122
|
-
if (!stacked || !resolvedShowValueLabels) return coercedData;
|
|
1123
|
-
return coercedData.map((row) => ({ ...row, [STACK_TOTAL_KEY]: sumSeries(row, seriesKeys) }));
|
|
1124
|
-
}, [coercedData, stacked, resolvedShowValueLabels, seriesKeys]);
|
|
1125
1114
|
const resolvedAngle = xAxisAngle ?? (coercedData.length >= 8 ? -30 : 0);
|
|
1126
1115
|
const resolvedTickFormatter = (0, import_react9.useMemo)(
|
|
1127
1116
|
() => xAxisTickFormatter ?? defaultBarTickFormatter(coercedData.length),
|
|
1128
1117
|
[xAxisTickFormatter, coercedData.length]
|
|
1129
1118
|
);
|
|
1130
1119
|
const angledLabelPad = resolvedAngle === 0 ? 0 : Math.min(Math.abs(resolvedAngle) * 0.7, 40);
|
|
1131
|
-
const
|
|
1132
|
-
|
|
1133
|
-
...CHART_MARGIN,
|
|
1134
|
-
top: CHART_MARGIN.top + valueLabelHeadroom,
|
|
1135
|
-
bottom: CHART_MARGIN.bottom + angledLabelPad
|
|
1136
|
-
};
|
|
1137
|
-
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ChartContainer, { height, width, className, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_recharts2.BarChart, { data: plotData, margin: chartMargin, barCategoryGap: "22%", children: [
|
|
1120
|
+
const chartMargin = { ...CHART_MARGIN, bottom: CHART_MARGIN.bottom + angledLabelPad };
|
|
1121
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ChartContainer, { height, width, className, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_recharts2.BarChart, { data: coercedData, margin: chartMargin, barCategoryGap: "22%", children: [
|
|
1138
1122
|
showGrid ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_recharts2.CartesianGrid, { ...CHART_GRID_PROPS }) : null,
|
|
1139
1123
|
showXAxis ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1140
1124
|
import_recharts2.XAxis,
|
|
@@ -1161,23 +1145,17 @@ function BarChart({
|
|
|
1161
1145
|
content: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ChartLegendContent, { iconType: "square" })
|
|
1162
1146
|
}
|
|
1163
1147
|
) : null,
|
|
1164
|
-
series.map((s, i) =>
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
radius: barRadius(stacked, i, series.length),
|
|
1176
|
-
children: showLabel ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_recharts2.LabelList, { dataKey: labelDataKey, position: "top", style: CHART_VALUE_LABEL_STYLE }) : null
|
|
1177
|
-
},
|
|
1178
|
-
s.key
|
|
1179
|
-
);
|
|
1180
|
-
})
|
|
1148
|
+
series.map((s, i) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1149
|
+
import_recharts2.Bar,
|
|
1150
|
+
{
|
|
1151
|
+
dataKey: s.key,
|
|
1152
|
+
name: s.label,
|
|
1153
|
+
fill: colorForSeriesIndex(i, palette),
|
|
1154
|
+
stackId: stacked ? "default" : s.key,
|
|
1155
|
+
radius: barRadius(stacked, i, series.length)
|
|
1156
|
+
},
|
|
1157
|
+
s.key
|
|
1158
|
+
))
|
|
1181
1159
|
] }) });
|
|
1182
1160
|
}
|
|
1183
1161
|
function barRadius(stacked, seriesIndex, seriesCount) {
|