impaktapps-design 0.2.58-alpha.4 → 0.2.58-alpha.6

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.
@@ -10873,26 +10873,23 @@ function Legend({
10873
10873
  colorRange,
10874
10874
  dataKeyArray
10875
10875
  }) {
10876
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
10876
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
10877
10877
  const legendGlyphSize = ((_b = (_a = value == null ? void 0 : value.main) == null ? void 0 : _a.legend) == null ? void 0 : _b.colorRectWidth) || 15;
10878
- const xValues = (_c = value == null ? void 0 : value.main) == null ? void 0 : _c.data.map((item) => {
10879
- return item.x;
10880
- });
10881
10878
  const ordinalColorScale = createOrdinalScale$1({
10882
- domain: dataKeyArray || ((_d = value == null ? void 0 : value.main) == null ? void 0 : _d.tooltipDataKey),
10883
- range: colorRange || ((_f = (_e = value == null ? void 0 : value.style) == null ? void 0 : _e.pieStyle) == null ? void 0 : _f.colorRange)
10879
+ domain: dataKeyArray || ((_c = value == null ? void 0 : value.main) == null ? void 0 : _c.tooltipDataKey),
10880
+ range: colorRange || ((_e = (_d = value == null ? void 0 : value.style) == null ? void 0 : _d.pieStyle) == null ? void 0 : _e.colorRange)
10884
10881
  });
10885
10882
  return /* @__PURE__ */ jsxs("div", {
10886
10883
  className: "legend",
10887
10884
  style: {
10888
10885
  paddingLeft: "40px",
10889
10886
  paddingRight: "40px",
10890
- ...(_h = (_g = value == null ? void 0 : value.style) == null ? void 0 : _g.legendStyle) == null ? void 0 : _h.legend
10887
+ ...(_g = (_f = value == null ? void 0 : value.style) == null ? void 0 : _f.legendStyle) == null ? void 0 : _g.legend
10891
10888
  },
10892
10889
  children: [/* @__PURE__ */ jsx("div", {
10893
10890
  className: "title",
10894
- style: (_j = (_i = value == null ? void 0 : value.style) == null ? void 0 : _i.legendStyle) == null ? void 0 : _j.legendTitle,
10895
- children: (_l = (_k = value == null ? void 0 : value.main) == null ? void 0 : _k.legend) == null ? void 0 : _l.legendTitle
10891
+ style: (_i = (_h = value == null ? void 0 : value.style) == null ? void 0 : _h.legendStyle) == null ? void 0 : _i.legendTitle,
10892
+ children: (_k = (_j = value == null ? void 0 : value.main) == null ? void 0 : _j.legend) == null ? void 0 : _k.legendTitle
10896
10893
  }), /* @__PURE__ */ jsx(Ordinal, {
10897
10894
  scale: ordinalColorScale,
10898
10895
  labelFormat: (label) => `${label.toUpperCase()}`,
@@ -10903,7 +10900,7 @@ function Legend({
10903
10900
  display: "flex",
10904
10901
  flexDirection: ((_b2 = (_a2 = value == null ? void 0 : value.main) == null ? void 0 : _a2.legend) == null ? void 0 : _b2.direction) || "row"
10905
10902
  },
10906
- children: xValues.map((label, i) => {
10903
+ children: labels.map((label, i) => {
10907
10904
  var _a3, _b3;
10908
10905
  return /* @__PURE__ */ jsxs(LegendItem, {
10909
10906
  margin: "0 5px",
@@ -10915,14 +10912,14 @@ function Legend({
10915
10912
  width: legendGlyphSize,
10916
10913
  height: legendGlyphSize,
10917
10914
  children: /* @__PURE__ */ jsx("rect", {
10918
- fill: label,
10915
+ fill: label.value,
10919
10916
  width: legendGlyphSize,
10920
10917
  height: legendGlyphSize
10921
10918
  })
10922
- }), /* @__PURE__ */ jsx(LegendLabel, {
10919
+ }), /* @__PURE__ */ jsxs(LegendLabel, {
10923
10920
  align: `${((_b3 = (_a3 = value == null ? void 0 : value.main) == null ? void 0 : _a3.legend) == null ? void 0 : _b3.align) || "left"}`,
10924
10921
  margin: "0 0 0 4px",
10925
- children: label
10922
+ children: ["", label.text]
10926
10923
  })]
10927
10924
  }, `legend-quantile-${i}`);
10928
10925
  })
@@ -19784,9 +19781,13 @@ const DrawGraph = ({
19784
19781
  xAccessor: (d2) => d2[arr[0]],
19785
19782
  yAccessor: (d2) => d2[arr[1]]
19786
19783
  };
19784
+ const dataKeyArray = data.map((ele) => {
19785
+ return ele.key;
19786
+ });
19787
19787
  return /* @__PURE__ */ jsxs(Fragment, {
19788
19788
  children: [value.main.legendAvailable && /* @__PURE__ */ jsx(Legend, {
19789
- value
19789
+ value,
19790
+ dataKeyArray
19790
19791
  }), /* @__PURE__ */ jsxs(XYChart, {
19791
19792
  height: parseInt((_c = (_b = value.style) == null ? void 0 : _b.containerStyle) == null ? void 0 : _c.height),
19792
19793
  xScale: {
@@ -19831,16 +19832,19 @@ const DrawGraph = ({
19831
19832
  numTicks: value.main.numHidden ? 0 : ((_r = value.main) == null ? void 0 : _r.data[0].length) - 1
19832
19833
  }), (_s = value.main) == null ? void 0 : _s.data.map((elem, i) => {
19833
19834
  var _a2, _b2, _c2, _d2, _e2, _f2;
19834
- return /* @__PURE__ */ jsx(AnimatedLineSeries, {
19835
- dataKey: value.main.tooltipDataKey[i],
19836
- data: elem,
19837
- fill: (_b2 = (_a2 = value.style) == null ? void 0 : _a2.lineStyle) == null ? void 0 : _b2.lineAreaColor,
19838
- fillOpacity: (_d2 = (_c2 = value.style) == null ? void 0 : _c2.lineStyle) == null ? void 0 : _d2.lineAreaOpacity,
19839
- floodColor: "green",
19840
- floodOpacity: 1,
19841
- stroke: (_f2 = (_e2 = value.style) == null ? void 0 : _e2.lineStyle) == null ? void 0 : _f2.colorRange[i],
19842
- ...accessors
19843
- });
19835
+ return /* @__PURE__ */ jsx(
19836
+ AnimatedLineSeries,
19837
+ {
19838
+ dataKey: elem.key,
19839
+ data: elem.value,
19840
+ fill: (_b2 = (_a2 = value.style) == null ? void 0 : _a2.lineStyle) == null ? void 0 : _b2.lineAreaColor,
19841
+ fillOpacity: (_d2 = (_c2 = value.style) == null ? void 0 : _c2.lineStyle) == null ? void 0 : _d2.lineAreaOpacity,
19842
+ floodColor: "green",
19843
+ floodOpacity: 1,
19844
+ stroke: (_f2 = (_e2 = value.style) == null ? void 0 : _e2.lineStyle) == null ? void 0 : _f2.colorRange[i],
19845
+ ...accessors
19846
+ }
19847
+ );
19844
19848
  }), /* @__PURE__ */ jsx(Tooltip, {
19845
19849
  snapTooltipToDatumX: true,
19846
19850
  snapTooltipToDatumY: true,
@@ -43977,3 +43981,4 @@ const CustomTimer = ({
43977
43981
  });
43978
43982
  };
43979
43983
  export { BarGraph, ImpaktAppsCard as Card, HorizontalBarGraph, LineGraph, PieGraph, ProgressBar, SpeedoMeter, CustomTimer as Timer };
43984
+ //# sourceMappingURL=impaktapps-design.es.js.map