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.mjs CHANGED
@@ -33094,6 +33094,7 @@ var ChartAtom = ({
33094
33094
  // Chart color customization props
33095
33095
  seriesColors
33096
33096
  }) => {
33097
+ const safeData = Array.isArray(data) ? data : [];
33097
33098
  const buildConfigWithColors = (baseConfig) => {
33098
33099
  if (!seriesColors) return baseConfig;
33099
33100
  const coloredConfig = {};
@@ -33110,7 +33111,7 @@ var ChartAtom = ({
33110
33111
  const renderChart = () => {
33111
33112
  switch (chartType) {
33112
33113
  case "bar":
33113
- return /* @__PURE__ */ jsxs50(BarChart, { data, children: [
33114
+ return /* @__PURE__ */ jsxs50(BarChart, { data: safeData, children: [
33114
33115
  /* @__PURE__ */ jsx85(CartesianGrid, { vertical: false }),
33115
33116
  /* @__PURE__ */ jsx85(
33116
33117
  XAxis,
@@ -33136,7 +33137,7 @@ var ChartAtom = ({
33136
33137
  ))
33137
33138
  ] });
33138
33139
  case "line":
33139
- return /* @__PURE__ */ jsxs50(LineChart, { data, children: [
33140
+ return /* @__PURE__ */ jsxs50(LineChart, { data: safeData, children: [
33140
33141
  /* @__PURE__ */ jsx85(CartesianGrid, { vertical: false }),
33141
33142
  /* @__PURE__ */ jsx85(
33142
33143
  XAxis,
@@ -33162,7 +33163,7 @@ var ChartAtom = ({
33162
33163
  ))
33163
33164
  ] });
33164
33165
  case "area":
33165
- return /* @__PURE__ */ jsxs50(AreaChart, { data, children: [
33166
+ return /* @__PURE__ */ jsxs50(AreaChart, { data: safeData, children: [
33166
33167
  /* @__PURE__ */ jsx85(CartesianGrid, { vertical: false }),
33167
33168
  /* @__PURE__ */ jsx85(
33168
33169
  XAxis,
@@ -33194,12 +33195,12 @@ var ChartAtom = ({
33194
33195
  /* @__PURE__ */ jsx85(
33195
33196
  Pie,
33196
33197
  {
33197
- data,
33198
+ data: safeData,
33198
33199
  dataKey: YAxisKey || "value",
33199
33200
  nameKey: XAxisKey || "name",
33200
33201
  innerRadius: 60,
33201
33202
  strokeWidth: 5,
33202
- children: data.map((_, index) => /* @__PURE__ */ jsx85(
33203
+ children: safeData.map((_, index) => /* @__PURE__ */ jsx85(
33203
33204
  Cell,
33204
33205
  {
33205
33206
  fill: seriesColors?.[index] || `var(--color-${Object.keys(safeConfig)[index] || "default"})`
@@ -33210,7 +33211,7 @@ var ChartAtom = ({
33210
33211
  )
33211
33212
  ] });
33212
33213
  case "radar":
33213
- return /* @__PURE__ */ jsxs50(RadarChart, { data, children: [
33214
+ return /* @__PURE__ */ jsxs50(RadarChart, { data: safeData, children: [
33214
33215
  showTooltip && /* @__PURE__ */ jsx85(ChartTooltip, { cursor: false, content: /* @__PURE__ */ jsx85(ChartTooltipContent, {}) }),
33215
33216
  /* @__PURE__ */ jsx85(PolarGrid, {}),
33216
33217
  /* @__PURE__ */ jsx85(PolarAngleAxis, { dataKey: XAxisKey }),
@@ -33228,7 +33229,7 @@ var ChartAtom = ({
33228
33229
  return /* @__PURE__ */ jsxs50(
33229
33230
  RadialBarChart,
33230
33231
  {
33231
- data,
33232
+ data: safeData,
33232
33233
  innerRadius: 30,
33233
33234
  outerRadius: 110,
33234
33235
  barSize: 10,