pace-chart-lib 1.0.14 → 1.0.15

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.
Files changed (49) hide show
  1. package/dist/pace-chart-lib.es.js +88 -45
  2. package/dist/pace-chart-lib.umd.js +88 -45
  3. package/package.json +1 -1
  4. package/dist/Components/Charts/ChartsWithAxis/AreaFamily/AreaChart.d.ts +0 -4
  5. package/dist/Components/Charts/ChartsWithAxis/AreaFamily/NormalizedStackAreaChart.d.ts +0 -4
  6. package/dist/Components/Charts/ChartsWithAxis/AreaFamily/StackAreaChart.d.ts +0 -4
  7. package/dist/Components/Charts/ChartsWithAxis/ChartsWithAxisFunctions.d.ts +0 -667
  8. package/dist/Components/Charts/ChartsWithAxis/ChartsWithAxisTypes.types.d.ts +0 -171
  9. package/dist/Components/Charts/ChartsWithAxis/ColumnFamily/ColumnChart.d.ts +0 -4
  10. package/dist/Components/Charts/ChartsWithAxis/ColumnFamily/ColumnHistogramChart.d.ts +0 -4
  11. package/dist/Components/Charts/ChartsWithAxis/ColumnFamily/CustomColumnChart.d.ts +0 -4
  12. package/dist/Components/Charts/ChartsWithAxis/ColumnFamily/LayeredColumnChart.d.ts +0 -4
  13. package/dist/Components/Charts/ChartsWithAxis/ColumnFamily/NormalizedStackColumnChart.d.ts +0 -4
  14. package/dist/Components/Charts/ChartsWithAxis/ColumnFamily/StackColumnChart.d.ts +0 -4
  15. package/dist/Components/Charts/ChartsWithAxis/HorizontalBarFamily/HorizontalBarChart.d.ts +0 -4
  16. package/dist/Components/Charts/ChartsWithAxis/HorizontalBarFamily/HorizontalHistogramChart.d.ts +0 -4
  17. package/dist/Components/Charts/ChartsWithAxis/HorizontalBarFamily/LayeredHorizontalBarChart.d.ts +0 -4
  18. package/dist/Components/Charts/ChartsWithAxis/HorizontalBarFamily/NormalizedStackHorizontalBarChart.d.ts +0 -4
  19. package/dist/Components/Charts/ChartsWithAxis/HorizontalBarFamily/StackHorizontalBarChart.d.ts +0 -4
  20. package/dist/Components/Charts/ChartsWithAxis/LineFamily/LineChart.d.ts +0 -4
  21. package/dist/Components/Charts/ChartsWithAxis/LineFamily/NormalizedStackLineChart.d.ts +0 -4
  22. package/dist/Components/Charts/ChartsWithAxis/LineFamily/StackLineChart.d.ts +0 -4
  23. package/dist/Components/Charts/ChartsWithAxis/MiscellaneousChartFamily/TornadoChart.d.ts +0 -4
  24. package/dist/Components/Charts/ChartsWithAxis/MiscellaneousChartFamily/WaterfallChart.d.ts +0 -4
  25. package/dist/Components/Charts/ChartsWithoutAxis/ChartsWithoutAxisFunctions.d.ts +0 -92
  26. package/dist/Components/Charts/ChartsWithoutAxis/ChartsWithoutAxisTypes.types.d.ts +0 -111
  27. package/dist/Components/Charts/ChartsWithoutAxis/Maps/Cordinates.d.ts +0 -26
  28. package/dist/Components/Charts/ChartsWithoutAxis/Maps/Maps.d.ts +0 -4
  29. package/dist/Components/Charts/ChartsWithoutAxis/OtherCharts/BubbleChart.d.ts +0 -4
  30. package/dist/Components/Charts/ChartsWithoutAxis/OtherCharts/OrganizationChart.d.ts +0 -4
  31. package/dist/Components/Charts/ChartsWithoutAxis/OtherCharts/ProgressChart.d.ts +0 -3
  32. package/dist/Components/Charts/ChartsWithoutAxis/OtherCharts/PyramidChart.d.ts +0 -3
  33. package/dist/Components/Charts/ChartsWithoutAxis/OtherCharts/RadialBarChart.d.ts +0 -4
  34. package/dist/Components/Charts/ChartsWithoutAxis/OtherCharts/SankeyChart.d.ts +0 -4
  35. package/dist/Components/Charts/ChartsWithoutAxis/OtherCharts/ScatterChart.d.ts +0 -4
  36. package/dist/Components/Charts/ChartsWithoutAxis/OtherCharts/Speedometer.d.ts +0 -3
  37. package/dist/Components/Charts/ChartsWithoutAxis/OtherCharts/VennChart.d.ts +0 -4
  38. package/dist/Components/Charts/ChartsWithoutAxis/OtherCharts/WordCloud.d.ts +0 -4
  39. package/dist/Components/Charts/ChartsWithoutAxis/PieFamily/DonutChart.d.ts +0 -4
  40. package/dist/Components/Charts/ChartsWithoutAxis/PieFamily/PieChart.d.ts +0 -4
  41. package/dist/Components/Charts/ChartsWithoutAxis/PieFamily/PieFamilyCommonFunctions.d.ts +0 -10
  42. package/dist/Components/Charts/ChartsWithoutAxis/PieFamily/PieofPieChart.d.ts +0 -3
  43. package/dist/Components/Charts/ChartsWithoutAxis/PieFamily/TreemapChart.d.ts +0 -3
  44. package/dist/Components/Charts/Core/Common.types.d.ts +0 -370
  45. package/dist/Components/Charts/Core/CommonFunctions.d.ts +0 -239
  46. package/dist/Components/Charts/Core/DefaultChartDataProperties.d.ts +0 -65
  47. package/dist/Components/Charts/Core/DefaultProperties.types.d.ts +0 -595
  48. package/dist/Services/ErrorLog.d.ts +0 -1
  49. package/dist/index.d.ts +0 -35
@@ -12050,7 +12050,7 @@
12050
12050
  let decimalValues = decimalPrescision;
12051
12051
  let formatter;
12052
12052
  if (displayUnits === "Auto") {
12053
- return getAutoNumberWithFormat(measureValue);
12053
+ return getAutoNumberWithFormat$1(measureValue);
12054
12054
  } else if (displayUnits != staticDisplayUnits.none) {
12055
12055
  displayUnits == staticDisplayUnits.thousands ? (Unit = 1e3, displayUnitsPostFix = "K") : null;
12056
12056
  displayUnits == staticDisplayUnits.millions ? (Unit = 1e6, displayUnitsPostFix = "M") : null;
@@ -12099,7 +12099,7 @@
12099
12099
  throw error;
12100
12100
  }
12101
12101
  }
12102
- function getAutoNumberWithFormat(value2) {
12102
+ function getAutoNumberWithFormat$1(value2) {
12103
12103
  if (value2 === null || value2 === void 0 || isNaN(value2)) return "-";
12104
12104
  const absValue = Math.abs(value2);
12105
12105
  if (absValue >= 1e9) {
@@ -15349,16 +15349,29 @@
15349
15349
  }
15350
15350
  function getNumberWithFormatFunction(displayUnits, numberFormat, decimalPrecision) {
15351
15351
  try {
15352
- let Unit;
15352
+ let Unit = 1;
15353
15353
  let displayUnitsPostFix = "";
15354
15354
  let decimalValues = decimalPrecision;
15355
15355
  let formatter;
15356
- return function(d) {
15356
+ return function(value2) {
15357
15357
  try {
15358
- if (displayUnits != "None") {
15359
- displayUnits == "Thousands" ? (Unit = 1e3, displayUnitsPostFix = "K") : null;
15360
- displayUnits == "Millions" ? (Unit = 1e6, displayUnitsPostFix = "M") : null;
15361
- displayUnits == "Billions" ? (Unit = 1e9, displayUnitsPostFix = "B") : null;
15358
+ let d = value2 ?? 0;
15359
+ if (displayUnits === "Auto") {
15360
+ return getAutoNumberWithFormat(d);
15361
+ }
15362
+ if (displayUnits && displayUnits !== "None") {
15363
+ if (displayUnits === "Thousands") {
15364
+ Unit = 1e3;
15365
+ displayUnitsPostFix = "K";
15366
+ }
15367
+ if (displayUnits === "Millions") {
15368
+ Unit = 1e6;
15369
+ displayUnitsPostFix = "M";
15370
+ }
15371
+ if (displayUnits === "Billions") {
15372
+ Unit = 1e9;
15373
+ displayUnitsPostFix = "B";
15374
+ }
15362
15375
  d = d / Unit;
15363
15376
  }
15364
15377
  switch (numberFormat) {
@@ -15369,7 +15382,7 @@
15369
15382
  formatter = `.${decimalValues}f`;
15370
15383
  return format(formatter)(d) + displayUnitsPostFix;
15371
15384
  case ".2n":
15372
- formatter = `.${decimalValues == 0 ? 1 : (parseFloat(decimalValues) + 1).toString()}n`;
15385
+ formatter = `.${decimalValues == 0 ? 1 : parseFloat(decimalValues) + 1}n`;
15373
15386
  return format(formatter)(d) + displayUnitsPostFix;
15374
15387
  case ".2$":
15375
15388
  formatter = `,.${decimalValues}f`;
@@ -15404,6 +15417,14 @@
15404
15417
  logError$2(fileName$b, "getNumberWithFormatFunction", error);
15405
15418
  }
15406
15419
  }
15420
+ function getAutoNumberWithFormat(value2) {
15421
+ if (value2 === null || value2 === void 0) return "0";
15422
+ let abs2 = Math.abs(value2);
15423
+ if (abs2 >= 1e9) return (value2 / 1e9).toFixed(2) + "B";
15424
+ if (abs2 >= 1e6) return (value2 / 1e6).toFixed(2) + "M";
15425
+ if (abs2 >= 1e3) return (value2 / 1e3).toFixed(2) + "K";
15426
+ return value2.toFixed(2);
15427
+ }
15407
15428
  function showTooltipOnMouseMove(elements, chartFormatOptions, event2, prop) {
15408
15429
  try {
15409
15430
  const markerColor = prop?.markerColor ?? "blue";
@@ -15972,7 +15993,7 @@
15972
15993
  } else {
15973
15994
  properties = { ...chartProperties, ...item.properties };
15974
15995
  }
15975
- const normalizedData = dimensionList ? dimensionList.map((dim) => {
15996
+ const normalizedData = dimensionList && dimensionList.length !== 0 ? dimensionList.map((dim) => {
15976
15997
  const found = item.data.find((d) => d.dimension === dim);
15977
15998
  if (found) {
15978
15999
  return { ...found };
@@ -17761,7 +17782,9 @@
17761
17782
  chartJSON.yMaxRight,
17762
17783
  isSecondaryAxisDrawn,
17763
17784
  isNormalizedChart,
17764
- isDateType
17785
+ isDateType,
17786
+ false,
17787
+ chartJSON
17765
17788
  ));
17766
17789
  setSVGContainer(margin);
17767
17790
  ({ dataTable, dataTableHeight } = dataTablePreCalculation(
@@ -19741,7 +19764,7 @@
19741
19764
  }
19742
19765
  }
19743
19766
  } else {
19744
- customTickValue = innerHeight2 / 30;
19767
+ customTickValue = innerHeight2 / 60;
19745
19768
  }
19746
19769
  return { yAxisLabelArray, customTickValue };
19747
19770
  } catch (e) {
@@ -20345,7 +20368,7 @@
20345
20368
  )
20346
20369
  );
20347
20370
  getXAxis();
20348
- drawColumnChart();
20371
+ drawColumnHistogramChart();
20349
20372
  })
20350
20373
  );
20351
20374
  svg2.on("wheel", (event2) => {
@@ -20362,12 +20385,12 @@
20362
20385
  )
20363
20386
  );
20364
20387
  getXAxis();
20365
- drawColumnChart();
20388
+ drawColumnHistogramChart();
20366
20389
  });
20367
20390
  }
20368
- drawColumnChart();
20391
+ drawColumnHistogramChart();
20369
20392
  };
20370
- const drawColumnChart = () => {
20393
+ const drawColumnHistogramChart = () => {
20371
20394
  initXaxis$1(
20372
20395
  gTag,
20373
20396
  chartJSON,
@@ -28216,12 +28239,12 @@
28216
28239
  };
28217
28240
  const fileName$3 = "ProgressChart.tsx";
28218
28241
  const ProgressChart = ({
28219
- data,
28242
+ data: { ChartData },
28220
28243
  formatOptions,
28221
28244
  chartId
28222
28245
  }) => {
28223
28246
  const svgRef = require$$0$1.useRef();
28224
- let seriesData = generalizedChartData(data.ChartData);
28247
+ let seriesData = generalizedChartData(ChartData);
28225
28248
  let chartFormatOptions;
28226
28249
  let width;
28227
28250
  let height;
@@ -28296,22 +28319,22 @@
28296
28319
  const initProgressChartData = () => {
28297
28320
  try {
28298
28321
  seriesData = seriesData.sort((a2, b) => b.data[0].value - a2.data[0].value);
28299
- totalValue = data[0].data[0].value + data[1].data[0].value;
28322
+ totalValue = ChartData[0].data[0].value + ChartData[1].data[0].value;
28300
28323
  } catch (error) {
28301
28324
  logError$2(fileName$3, "initProgressChartData", error);
28302
28325
  }
28303
28326
  };
28304
28327
  const drawProgressChart = () => {
28305
28328
  try {
28306
- let maxValue = data[0].data[0].value;
28307
- let progressValue = data[1].data[0].value;
28329
+ let maxValue = ChartData[0].data[0].value;
28330
+ let progressValue = ChartData[1].data[0].value;
28308
28331
  let completeAngle = Math.PI * 2;
28309
28332
  let progressAngle = progressValue / maxValue * Math.PI * 2;
28310
28333
  let valuefontStyle = chartFormatOptions.plotArea.dataLabelValueFontStyle;
28311
28334
  const arc2 = arc$1().innerRadius(innerRadius).outerRadius(radius).startAngle(0).cornerRadius(
28312
28335
  convertStringToNumber(chartFormatOptions.plotArea.cornerRadius)
28313
28336
  );
28314
- chartAreaTagG.append("path").attr("class", "secondary-circle").attr("fill", data[0].properties.color).attr(
28337
+ chartAreaTagG.append("path").attr("class", "secondary-circle").attr("fill", ChartData[0].properties.color).attr(
28315
28338
  "fill-opacity",
28316
28339
  chartFormatOptions.plotArea.opacityforProgressScale
28317
28340
  ).attr("d", arc2({ endAngle: completeAngle })).on("mousemove", (d) => {
@@ -28319,7 +28342,7 @@
28319
28342
  showTooltipOnMouseMove(
28320
28343
  [
28321
28344
  {
28322
- key: data[0].properties.alias,
28345
+ key: ChartData[0].properties.alias,
28323
28346
  value: chartFormatOptions.toolTip.toolTipNumberFormatProgress == ",.0%" ? "100 %" : getNumberWithFormatFunction(
28324
28347
  "None",
28325
28348
  chartFormatOptions.toolTip.toolTipNumberFormatProgress,
@@ -28349,7 +28372,7 @@
28349
28372
  );
28350
28373
  }
28351
28374
  }).attr("transform", getTransformString());
28352
- chartAreaTagG.append("path").attr("class", "progress-circle").attr("fill", data[1].properties.color).attr(
28375
+ chartAreaTagG.append("path").attr("class", "progress-circle").attr("fill", ChartData[1].properties.color).attr(
28353
28376
  "fill-opacity",
28354
28377
  chartFormatOptions.plotArea.opacityforProgressGoal
28355
28378
  ).attr("d", arc2({ endAngle: progressAngle })).on("mousemove", (d) => {
@@ -28357,7 +28380,7 @@
28357
28380
  showTooltipOnMouseMove(
28358
28381
  [
28359
28382
  {
28360
- key: data[1].properties.alias,
28383
+ key: ChartData[1].properties.alias,
28361
28384
  value: chartFormatOptions.toolTip.toolTipNumberFormatProgress == ",.0%" ? Math.round(progressValue / maxValue * 100) + "%" : getNumberWithFormatFunction(
28362
28385
  "None",
28363
28386
  chartFormatOptions.toolTip.toolTipDecimalPrecision,
@@ -28365,7 +28388,7 @@
28365
28388
  )(maxValue)
28366
28389
  },
28367
28390
  {
28368
- key: data[0].properties.alias,
28391
+ key: ChartData[0].properties.alias,
28369
28392
  value: chartFormatOptions.toolTip.toolTipNumberFormatProgress == ",.0%" ? "100 %" : getNumberWithFormatFunction(
28370
28393
  "None",
28371
28394
  chartFormatOptions.toolTip.toolTipDecimalPrecision,
@@ -28459,12 +28482,12 @@
28459
28482
  ) });
28460
28483
  };
28461
28484
  const Speedometer = ({
28462
- data,
28485
+ data: { ChartData },
28463
28486
  formatOptions,
28464
28487
  chartId
28465
28488
  }) => {
28466
28489
  const svgRef = require$$0$1.useRef();
28467
- const seriesData = generalizedChartData(data.ChartData);
28490
+ const seriesData = generalizedChartData(ChartData);
28468
28491
  let chartFormatOptions;
28469
28492
  let width;
28470
28493
  let height;
@@ -28535,7 +28558,7 @@
28535
28558
  }
28536
28559
  const initSpeedometerData = () => {
28537
28560
  try {
28538
- let firstMeasureValue = data[0].data[0].value;
28561
+ let firstMeasureValue = ChartData[0].data[0].value;
28539
28562
  if (firstMeasureValue < 0) {
28540
28563
  gaugeMaxMeasure = 0;
28541
28564
  gaugeMinMeasure = firstMeasureValue;
@@ -28772,19 +28795,19 @@
28772
28795
  showTooltipOnMouseMove(
28773
28796
  [
28774
28797
  {
28775
- key: `${data[index2].data[0].legend}`,
28798
+ key: `${ChartData[index2].data[0].legend}`,
28776
28799
  value: chartFormatOptions.plotArea.dataLabelNumberFormat == ",.0%" ? Math.round(
28777
- data[index2].data[0].value / ticks2[ticks2.length - 1] * 100
28800
+ ChartData[index2].data[0].value / ticks2[ticks2.length - 1] * 100
28778
28801
  ) + "%" : getNumberWithFormatFunction(
28779
28802
  "None",
28780
28803
  chartFormatOptions.toolTip.toolTipNumberFormat,
28781
28804
  chartFormatOptions.toolTip.toolTipDecimalPrecision
28782
- )(data[index2].data[0].value)
28805
+ )(ChartData[index2].data[0].value)
28783
28806
  }
28784
28807
  ],
28785
28808
  chartFormatOptions,
28786
28809
  void 0,
28787
- d.currentTarget.__data__.data.properties
28810
+ { markerColor: "blue", markerShape: "circle" }
28788
28811
  );
28789
28812
  }).on("mouseout", () => {
28790
28813
  hideTooltipOnMouseOut();
@@ -28918,7 +28941,7 @@
28918
28941
  "None",
28919
28942
  chartFormatOptions.pointerValue.pointerValueNumberFormat,
28920
28943
  chartFormatOptions.pointerValue.pointerValueDecimalPrecision
28921
- )(data[1].data[0].value) : chartFormatOptions.pointerValue.pointerValueAliasText}`
28944
+ )(ChartData[1].data[0].value) : chartFormatOptions.pointerValue.pointerValueAliasText}`
28922
28945
  ).attr(
28923
28946
  "visibility",
28924
28947
  chartFormatOptions.plotArea.dataLabels ? "visible" : "hidden"
@@ -28941,12 +28964,12 @@
28941
28964
  console.error(`[${fileName2}][${functionName}]`, error);
28942
28965
  }
28943
28966
  const RadialBarChart = ({
28944
- data,
28967
+ data: { ChartData },
28945
28968
  formatOptions,
28946
28969
  chartId
28947
28970
  }) => {
28948
28971
  const svgRef = require$$0$1.useRef();
28949
- const seriesData = generalizedChartData(data.ChartData);
28972
+ const seriesData = generalizedChartData(ChartData);
28950
28973
  let chartFormatOptions;
28951
28974
  let width;
28952
28975
  let height;
@@ -29049,7 +29072,7 @@
29049
29072
  logError("RadialBarChart.tsx", "getOuterRadius", error);
29050
29073
  }
29051
29074
  };
29052
- let scaleMaxValue = seriesData.length > 1 ? max$2(seriesData, (d) => d.data[0].value) * 1.1 : data[0].data[0].value * 1.1;
29075
+ let scaleMaxValue = seriesData.length > 1 ? max$2(seriesData, (d) => d.data[0].value) * 1.1 : ChartData[0].data[0].value * 1.1;
29053
29076
  let valuefontStyle = chartFormatOptions.plotArea.dataLabelValueFontStyle;
29054
29077
  let maxDim = getNumberWithFormatFunction(
29055
29078
  chartFormatOptions.plotArea.plotAreaDisplayUnits,
@@ -29085,7 +29108,7 @@
29085
29108
  const arcWidth = (chartRadius - arcMinRadius - numArcs * arcPadding) / numArcs;
29086
29109
  let arc2 = arc$1().innerRadius((d, i) => getInnerRadius(i)).outerRadius((d, i) => getOuterRadius(i)).startAngle(0).endAngle((d) => scale2(Math.abs(d.data[0].value)));
29087
29110
  let dummyArc = arc$1().innerRadius((d, i) => getInnerRadius(i)).outerRadius((d, i) => getOuterRadius(i)).startAngle(0).endAngle(degToRad(360));
29088
- let radialAxis = svg2.append("g").attr("class", "r axis").selectAll("g").data(data).enter().append("g");
29111
+ let radialAxis = svg2.append("g").attr("class", "r axis").selectAll("g").data(ChartData).enter().append("g");
29089
29112
  if (chartFormatOptions.plotArea.axialGrid) {
29090
29113
  radialAxis.append("circle").attr("r", (d, i) => getOuterRadius(i) + arcPadding).attr("stroke", "#d3d3d3").attr("stroke-width", 1).attr("fill", "none");
29091
29114
  }
@@ -29133,7 +29156,7 @@
29133
29156
  "visibility",
29134
29157
  chartFormatOptions.plotArea.axialAxis ? "visible" : "hidden"
29135
29158
  );
29136
- let arcs = svg2.attr("class", "data").selectAll("path").data(data).enter().append("path").attr("class", "parentGroup").attr("hoverId", (d) => d.data[0].legend).style("fill", (d, i) => d.properties.color).on("mousemove", (event2, d) => {
29159
+ let arcs = svg2.attr("class", "data").selectAll("path").data(ChartData).enter().append("path").attr("class", "parentGroup").attr("hoverId", (d) => d.data[0].legend).style("fill", (d, i) => d.properties.color).on("mousemove", (event2, d) => {
29137
29160
  showTooltipOnMouseMove(
29138
29161
  [
29139
29162
  {
@@ -29161,7 +29184,7 @@
29161
29184
  (d, i) => chartFormatOptions.plotArea.arcTransition ? i * 200 : 0
29162
29185
  ).duration(chartFormatOptions.plotArea.arcTransition ? 500 : 0).attrTween("d", arcTween);
29163
29186
  if (chartFormatOptions.plotArea.dataLabels) {
29164
- svg2.selectAll(".arc-label-" + chartId).data(data).enter().append("text").attr("class", "arc-label-" + chartId).attr("class", "parentGroup").attr("text-anchor", "start").attr("dy", (d, i) => (getOuterRadius(i) - getInnerRadius(i)) / 1.75).append("textPath").attr("xlink:href", (d, i) => `#arc-path-${i}-` + chartId).style("startOffset", "50%").attr("hoverId", (d) => d.legend.replaceAll(" ", "-")).text(
29187
+ svg2.selectAll(".arc-label-" + chartId).data(ChartData).enter().append("text").attr("class", "arc-label-" + chartId).attr("class", "parentGroup").attr("text-anchor", "start").attr("dy", (d, i) => (getOuterRadius(i) - getInnerRadius(i)) / 1.75).append("textPath").attr("xlink:href", (d, i) => `#arc-path-${i}-` + chartId).style("startOffset", "50%").attr("hoverId", (d) => d.legend.replaceAll(" ", "-")).text(
29165
29188
  (d) => `  ${d.properties.alias}
29166
29189
   ${chartFormatOptions.plotArea.dataLabelValue ? getNumberWithFormatFunction(
29167
29190
  chartFormatOptions.plotArea.plotAreaDisplayUnits,
@@ -29602,9 +29625,9 @@
29602
29625
  var d3CloudExports = requireD3Cloud();
29603
29626
  const cloud = /* @__PURE__ */ getDefaultExportFromCjs(d3CloudExports);
29604
29627
  const fileName$2 = "WordCloud.tsx";
29605
- const WordCloud = ({ data, formatOptions, chartId }) => {
29628
+ const WordCloud = ({ data: { ChartData }, formatOptions, chartId }) => {
29606
29629
  const svgRef = require$$0$1.useRef();
29607
- let seriesData = generalizedChartData(data);
29630
+ let seriesData = generalizedChartData(ChartData);
29608
29631
  let chartFormatOptions;
29609
29632
  let width;
29610
29633
  let height;
@@ -52170,6 +52193,8 @@
52170
52193
  tempLegendEntries,
52171
52194
  "alias"
52172
52195
  );
52196
+ let convertedData = convertIncomingData(data);
52197
+ data = convertedData;
52173
52198
  iterateOverChartData();
52174
52199
  ({
52175
52200
  longestMeasure,
@@ -52514,6 +52539,24 @@
52514
52539
  logError$2("BubbleChart", "initLegendList", e);
52515
52540
  }
52516
52541
  };
52542
+ const convertIncomingData = (input) => {
52543
+ try {
52544
+ if (!input || !input.ChartData || !input.ChartData[0]) return [];
52545
+ const series = input.ChartData[0];
52546
+ return series.data.map((d) => ({
52547
+ dimension: parseFloat(d.dimension),
52548
+ dimensionName: series.legend ?? "Dimension",
52549
+ measure: d.value,
52550
+ measureName: series.legend ?? "Measure",
52551
+ legendName: series.legend,
52552
+ legendColor: series.properties?.color ?? "#000000",
52553
+ tooltip: ""
52554
+ }));
52555
+ } catch (e) {
52556
+ console.error("BubbleChart - Data conversion failed", e);
52557
+ return [];
52558
+ }
52559
+ };
52517
52560
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
52518
52561
  "svg",
52519
52562
  {
@@ -54022,7 +54065,7 @@
54022
54065
  const allChartData = [];
54023
54066
  const legendList = [];
54024
54067
  let formatedDimensionList = [];
54025
- let firstMeasure = "";
54068
+ let firstMeasure = seriesData[0]?.properties.currentMeasure;
54026
54069
  let yMaxLeft = 0;
54027
54070
  let yMaxRight = -Infinity;
54028
54071
  seriesData.forEach((series) => {
@@ -54150,7 +54193,7 @@
54150
54193
  gTag.append("g").attr("class", "parentGroup").selectAll("#scaling-svg" + chartId + " .rect").data(filteredData).enter().append("g").attr("class", (d) => d.data[0].legend.replace(/ /g, "-")).selectAll("rect").data((d) => d.data.map((child) => ({
54151
54194
  ...child,
54152
54195
  parentProperties: d.properties
54153
- }))).enter().append("rect").attr("class", "rect").attr("y", (d) => d.dimension ? yScaleLeft(d.dimension) : yScaleLeft("defaultEntry")).attr("x", (d) => xScale(Math.min(0, d.value))).attr("stroke-dasharray", (d) => d.stackBorderStyle == 2 ? "5,3" : "0").attr("stroke-width", (d) => d.stackBorderWidth + "px").attr("stroke", (d) => d.stackBorderStyle == 0 ? "none" : formatOptions.column.stackBorderVisibility ? d.stackBorderColor : "none").style("shape-rendering", "crispEdges").attr("width", (d) => d.value ? Math.abs(xScale(d.value) - xScale(0)) : 0).attr("height", yScaleLeft.bandwidth()).style("fill", (d) => d.parentProperties.color).attr("opacity", 1).on("mousemove", (event2, d) => {
54196
+ }))).enter().append("rect").attr("class", "rect").attr("y", (d) => d.dimension ? yScaleLeft(d.dimension) : yScaleLeft("defaultEntry")).attr("x", (d) => xScale(Math.max(0, d.value))).attr("stroke-dasharray", (d) => d.stackBorderStyle == 2 ? "5,3" : "0").attr("stroke-width", (d) => d.stackBorderWidth + "px").attr("stroke", (d) => d.stackBorderStyle == 0 ? "none" : formatOptions.column.stackBorderVisibility ? d.stackBorderColor : "none").style("shape-rendering", "crispEdges").attr("width", (d) => d.value ? Math.abs(xScale(d.value) - xScale(0)) : 0).attr("height", yScaleLeft.bandwidth()).style("fill", (d) => d.parentProperties.color).attr("opacity", 1).on("mousemove", (event2, d) => {
54154
54197
  showTooltipOnMouseMove(
54155
54198
  [
54156
54199
  { key: "Measure", value: d.legend },
@@ -54162,7 +54205,7 @@
54162
54205
  ],
54163
54206
  formatOptions,
54164
54207
  void 0,
54165
- d.currentTarget.__data__.data.properties
54208
+ d.parentProperties
54166
54209
  );
54167
54210
  }).on("mouseout", () => {
54168
54211
  hideTooltipOnMouseOut();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pace-chart-lib",
3
- "version": "1.0.14",
3
+ "version": "1.0.15",
4
4
  "description": "A simple React + Vite + TS UI library with a Button using custom fonts via SCSS",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -1,4 +0,0 @@
1
- import React from "react";
2
- import { type TChartProps } from "../ChartsWithAxisTypes.types";
3
- declare const AreaChart: React.FC<TChartProps>;
4
- export default AreaChart;
@@ -1,4 +0,0 @@
1
- import React from "react";
2
- import { type TChartProps } from "../ChartsWithAxisTypes.types";
3
- declare const NormalizedStackAreaChart: React.FC<TChartProps>;
4
- export default NormalizedStackAreaChart;
@@ -1,4 +0,0 @@
1
- import React from "react";
2
- import { type TChartProps } from "../ChartsWithAxisTypes.types";
3
- declare const StackAreaChart: React.FC<TChartProps>;
4
- export default StackAreaChart;