pxengine 0.1.57 → 0.1.58
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/index.cjs +8 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +8 -7
- package/dist/index.mjs.map +1 -1
- package/dist/registry.json +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -33395,6 +33395,7 @@ var ChartAtom = ({
|
|
|
33395
33395
|
// Chart color customization props
|
|
33396
33396
|
seriesColors
|
|
33397
33397
|
}) => {
|
|
33398
|
+
const safeData = Array.isArray(data) ? data : [];
|
|
33398
33399
|
const buildConfigWithColors = (baseConfig) => {
|
|
33399
33400
|
if (!seriesColors) return baseConfig;
|
|
33400
33401
|
const coloredConfig = {};
|
|
@@ -33411,7 +33412,7 @@ var ChartAtom = ({
|
|
|
33411
33412
|
const renderChart = () => {
|
|
33412
33413
|
switch (chartType) {
|
|
33413
33414
|
case "bar":
|
|
33414
|
-
return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(import_recharts.BarChart, { data, children: [
|
|
33415
|
+
return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(import_recharts.BarChart, { data: safeData, children: [
|
|
33415
33416
|
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_recharts.CartesianGrid, { vertical: false }),
|
|
33416
33417
|
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
33417
33418
|
import_recharts.XAxis,
|
|
@@ -33437,7 +33438,7 @@ var ChartAtom = ({
|
|
|
33437
33438
|
))
|
|
33438
33439
|
] });
|
|
33439
33440
|
case "line":
|
|
33440
|
-
return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(import_recharts.LineChart, { data, children: [
|
|
33441
|
+
return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(import_recharts.LineChart, { data: safeData, children: [
|
|
33441
33442
|
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_recharts.CartesianGrid, { vertical: false }),
|
|
33442
33443
|
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
33443
33444
|
import_recharts.XAxis,
|
|
@@ -33463,7 +33464,7 @@ var ChartAtom = ({
|
|
|
33463
33464
|
))
|
|
33464
33465
|
] });
|
|
33465
33466
|
case "area":
|
|
33466
|
-
return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(import_recharts.AreaChart, { data, children: [
|
|
33467
|
+
return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(import_recharts.AreaChart, { data: safeData, children: [
|
|
33467
33468
|
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_recharts.CartesianGrid, { vertical: false }),
|
|
33468
33469
|
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
33469
33470
|
import_recharts.XAxis,
|
|
@@ -33495,12 +33496,12 @@ var ChartAtom = ({
|
|
|
33495
33496
|
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
33496
33497
|
import_recharts.Pie,
|
|
33497
33498
|
{
|
|
33498
|
-
data,
|
|
33499
|
+
data: safeData,
|
|
33499
33500
|
dataKey: YAxisKey || "value",
|
|
33500
33501
|
nameKey: XAxisKey || "name",
|
|
33501
33502
|
innerRadius: 60,
|
|
33502
33503
|
strokeWidth: 5,
|
|
33503
|
-
children:
|
|
33504
|
+
children: safeData.map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
33504
33505
|
import_recharts.Cell,
|
|
33505
33506
|
{
|
|
33506
33507
|
fill: seriesColors?.[index] || `var(--color-${Object.keys(safeConfig)[index] || "default"})`
|
|
@@ -33511,7 +33512,7 @@ var ChartAtom = ({
|
|
|
33511
33512
|
)
|
|
33512
33513
|
] });
|
|
33513
33514
|
case "radar":
|
|
33514
|
-
return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(import_recharts.RadarChart, { data, children: [
|
|
33515
|
+
return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(import_recharts.RadarChart, { data: safeData, children: [
|
|
33515
33516
|
showTooltip && /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(ChartTooltip, { cursor: false, content: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(ChartTooltipContent, {}) }),
|
|
33516
33517
|
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_recharts.PolarGrid, {}),
|
|
33517
33518
|
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_recharts.PolarAngleAxis, { dataKey: XAxisKey }),
|
|
@@ -33529,7 +33530,7 @@ var ChartAtom = ({
|
|
|
33529
33530
|
return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(
|
|
33530
33531
|
import_recharts.RadialBarChart,
|
|
33531
33532
|
{
|
|
33532
|
-
data,
|
|
33533
|
+
data: safeData,
|
|
33533
33534
|
innerRadius: 30,
|
|
33534
33535
|
outerRadius: 110,
|
|
33535
33536
|
barSize: 10,
|