impaktapps-design 0.2.993-alpha.252 → 0.2.993-alpha.254

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.
@@ -18147,7 +18147,7 @@ function Legend({
18147
18147
  theme,
18148
18148
  style: style2
18149
18149
  }) {
18150
- var _a, _b;
18150
+ var _a, _b, _c, _d;
18151
18151
  const legendGlyphSize = 16;
18152
18152
  const defaultColour = (_b = (_a = theme == null ? void 0 : theme.palette) == null ? void 0 : _a.primary) == null ? void 0 : _b.main;
18153
18153
  const ordinalColorScale = createOrdinalScale$1({
@@ -18171,7 +18171,7 @@ function Legend({
18171
18171
  },
18172
18172
  children: [/* @__PURE__ */ jsx$1("div", {
18173
18173
  className: "title",
18174
- children: value.main.legend.legendTitle
18174
+ children: (_d = (_c = value.main) == null ? void 0 : _c.legend) == null ? void 0 : _d.legendTitle
18175
18175
  }), /* @__PURE__ */ jsx$1(Ordinal, {
18176
18176
  scale: ordinalColorScale,
18177
18177
  labelFormat: (label) => `${label}`,
@@ -18185,41 +18185,44 @@ function Legend({
18185
18185
  paddingLeft: smallScreen ? "25px" : void 0,
18186
18186
  ...style2
18187
18187
  },
18188
- children: labels.map((label, i) => /* @__PURE__ */ jsxs(LegendItem, {
18189
- margin: "0 5px",
18190
- ...value.main.legendDirection === "column" && !smallScreen ? {
18191
- style: {
18192
- display: "flex",
18193
- flexDirection: "row"
18194
- }
18195
- } : {},
18196
- children: [/* @__PURE__ */ jsx$1("div", {
18197
- style: {
18198
- minWidth: smallScreen ? 20 : void 0
18199
- },
18200
- children: /* @__PURE__ */ jsx$1("svg", {
18201
- width: legendGlyphSize,
18202
- height: legendGlyphSize,
18203
- children: /* @__PURE__ */ jsx$1("rect", {
18204
- fill: label.value,
18188
+ children: labels.map((label, i) => {
18189
+ var _a2, _b2;
18190
+ return /* @__PURE__ */ jsxs(LegendItem, {
18191
+ margin: "0 5px",
18192
+ ...value.main.legendDirection === "column" && !smallScreen ? {
18193
+ style: {
18194
+ display: "flex",
18195
+ flexDirection: "row"
18196
+ }
18197
+ } : {},
18198
+ children: [/* @__PURE__ */ jsx$1("div", {
18199
+ style: {
18200
+ minWidth: smallScreen ? 20 : void 0
18201
+ },
18202
+ children: /* @__PURE__ */ jsx$1("svg", {
18205
18203
  width: legendGlyphSize,
18206
18204
  height: legendGlyphSize,
18207
- rx: legendGlyphSize / 2,
18208
- ry: legendGlyphSize / 2
18205
+ children: /* @__PURE__ */ jsx$1("rect", {
18206
+ fill: label.value,
18207
+ width: legendGlyphSize,
18208
+ height: legendGlyphSize,
18209
+ rx: legendGlyphSize / 2,
18210
+ ry: legendGlyphSize / 2
18211
+ })
18209
18212
  })
18210
- })
18211
- }), /* @__PURE__ */ jsx$1(LegendLabel, {
18212
- align: `${value.main.legend.align || "left"}`,
18213
- margin: "0 0 0 4px",
18214
- style: {
18215
- fontSize: "13px",
18216
- marginLeft: "5px",
18217
- color: label.value,
18218
- marginBottom: smallScreen ? "5px" : void 0
18219
- },
18220
- children: label.text
18221
- })]
18222
- }, `legend-quantile-${i}`))
18213
+ }), /* @__PURE__ */ jsx$1(LegendLabel, {
18214
+ align: `${((_b2 = (_a2 = value.main) == null ? void 0 : _a2.legend) == null ? void 0 : _b2.align) || "left"}`,
18215
+ margin: "0 0 0 4px",
18216
+ style: {
18217
+ fontSize: "13px",
18218
+ marginLeft: "5px",
18219
+ color: label.value,
18220
+ marginBottom: smallScreen ? "5px" : void 0
18221
+ },
18222
+ children: label.text
18223
+ })]
18224
+ }, `legend-quantile-${i}`);
18225
+ })
18223
18226
  })
18224
18227
  })]
18225
18228
  });
@@ -18658,7 +18661,7 @@ function DrawBarGraph({
18658
18661
  value
18659
18662
  }) {
18660
18663
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
18661
- const graphData = ((_b = (_a = value.main) == null ? void 0 : _a.data) == null ? void 0 : _b.length) ? value.main.data : [];
18664
+ const graphData = ((_b = (_a = value.main) == null ? void 0 : _a.data) == null ? void 0 : _b.length) ? value.main.data : [{}];
18662
18665
  const disableLeftLabel = (_c = value.main) == null ? void 0 : _c.disableLeftLabel;
18663
18666
  const xAxisValue = ((_d = value.main) == null ? void 0 : _d.xAxisValue) || "label";
18664
18667
  const labelsArray = Object.keys(graphData[0]).filter((d2) => d2 !== xAxisValue);
@@ -22775,10 +22778,10 @@ var DrawHorizontalBarGraph = ({
22775
22778
  }) => {
22776
22779
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
22777
22780
  const [hoveredBar, setHoveredBar] = useState({});
22778
- const graphData = ((_b = (_a = barValue.main) == null ? void 0 : _a.data) == null ? void 0 : _b.length) ? barValue.main.data : [];
22781
+ const graphData = ((_b = (_a = barValue.main) == null ? void 0 : _a.data) == null ? void 0 : _b.length) ? barValue.main.data : [{}];
22779
22782
  const disableLeftLabel = (_c = barValue.main) == null ? void 0 : _c.disableLeftLabel;
22780
22783
  const xAxisValue = ((_d = barValue.main) == null ? void 0 : _d.xAxisValue) || "label";
22781
- const labelsArray = Object.keys(graphData[0]).filter((d2) => d2 !== xAxisValue);
22784
+ const labelsArray = graphData.length ? Object.keys(graphData[0]).filter((d2) => d2 !== xAxisValue) : [];
22782
22785
  const legendAvailable = (_f = (_e = barValue == null ? void 0 : barValue.main) == null ? void 0 : _e.legendAvailable) != null ? _f : true;
22783
22786
  const colorMap = (_g = barValue.style) == null ? void 0 : _g.colorMap;
22784
22787
  const legendLabels = (_h = barValue.main) == null ? void 0 : _h.legendLabels;