@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/chat.cjs
CHANGED
|
@@ -1404,11 +1404,6 @@ function coerceNumericColumns(rows, numericKeys) {
|
|
|
1404
1404
|
|
|
1405
1405
|
// src/components/chart/bar-chart/bar-chart.tsx
|
|
1406
1406
|
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1407
|
-
var STACK_TOTAL_KEY = "__stackTotal";
|
|
1408
|
-
var VALUE_LABEL_HEADROOM = 20;
|
|
1409
|
-
function sumSeries(row, keys) {
|
|
1410
|
-
return keys.reduce((sum, key) => sum + (Number(row[key]) || 0), 0);
|
|
1411
|
-
}
|
|
1412
1407
|
function BarChart({
|
|
1413
1408
|
data,
|
|
1414
1409
|
xKey,
|
|
@@ -1423,7 +1418,6 @@ function BarChart({
|
|
|
1423
1418
|
showGrid = true,
|
|
1424
1419
|
showXAxis = true,
|
|
1425
1420
|
showYAxis = true,
|
|
1426
|
-
showValueLabels,
|
|
1427
1421
|
xAxisInterval = 0,
|
|
1428
1422
|
xAxisAngle,
|
|
1429
1423
|
xAxisTickFormatter
|
|
@@ -1434,24 +1428,14 @@ function BarChart({
|
|
|
1434
1428
|
[data, seriesKeys]
|
|
1435
1429
|
);
|
|
1436
1430
|
const resolvedShowLegend = showLegend ?? series.length > 1;
|
|
1437
|
-
const resolvedShowValueLabels = showValueLabels ?? true;
|
|
1438
|
-
const plotData = (0, import_react9.useMemo)(() => {
|
|
1439
|
-
if (!stacked || !resolvedShowValueLabels) return coercedData;
|
|
1440
|
-
return coercedData.map((row) => ({ ...row, [STACK_TOTAL_KEY]: sumSeries(row, seriesKeys) }));
|
|
1441
|
-
}, [coercedData, stacked, resolvedShowValueLabels, seriesKeys]);
|
|
1442
1431
|
const resolvedAngle = xAxisAngle ?? (coercedData.length >= 8 ? -30 : 0);
|
|
1443
1432
|
const resolvedTickFormatter = (0, import_react9.useMemo)(
|
|
1444
1433
|
() => xAxisTickFormatter ?? defaultBarTickFormatter(coercedData.length),
|
|
1445
1434
|
[xAxisTickFormatter, coercedData.length]
|
|
1446
1435
|
);
|
|
1447
1436
|
const angledLabelPad = resolvedAngle === 0 ? 0 : Math.min(Math.abs(resolvedAngle) * 0.7, 40);
|
|
1448
|
-
const
|
|
1449
|
-
|
|
1450
|
-
...CHART_MARGIN,
|
|
1451
|
-
top: CHART_MARGIN.top + valueLabelHeadroom,
|
|
1452
|
-
bottom: CHART_MARGIN.bottom + angledLabelPad
|
|
1453
|
-
};
|
|
1454
|
-
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: [
|
|
1437
|
+
const chartMargin = { ...CHART_MARGIN, bottom: CHART_MARGIN.bottom + angledLabelPad };
|
|
1438
|
+
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: [
|
|
1455
1439
|
showGrid ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_recharts2.CartesianGrid, { ...CHART_GRID_PROPS }) : null,
|
|
1456
1440
|
showXAxis ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1457
1441
|
import_recharts2.XAxis,
|
|
@@ -1478,23 +1462,17 @@ function BarChart({
|
|
|
1478
1462
|
content: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ChartLegendContent, { iconType: "square" })
|
|
1479
1463
|
}
|
|
1480
1464
|
) : null,
|
|
1481
|
-
series.map((s, i) =>
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
radius: barRadius(stacked, i, series.length),
|
|
1493
|
-
children: showLabel ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_recharts2.LabelList, { dataKey: labelDataKey, position: "top", style: CHART_VALUE_LABEL_STYLE }) : null
|
|
1494
|
-
},
|
|
1495
|
-
s.key
|
|
1496
|
-
);
|
|
1497
|
-
})
|
|
1465
|
+
series.map((s, i) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1466
|
+
import_recharts2.Bar,
|
|
1467
|
+
{
|
|
1468
|
+
dataKey: s.key,
|
|
1469
|
+
name: s.label,
|
|
1470
|
+
fill: colorForSeriesIndex(i, palette),
|
|
1471
|
+
stackId: stacked ? "default" : s.key,
|
|
1472
|
+
radius: barRadius(stacked, i, series.length)
|
|
1473
|
+
},
|
|
1474
|
+
s.key
|
|
1475
|
+
))
|
|
1498
1476
|
] }) });
|
|
1499
1477
|
}
|
|
1500
1478
|
function barRadius(stacked, seriesIndex, seriesCount) {
|