pace-chart-lib 1.0.20 → 1.0.22

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.
@@ -12500,7 +12500,7 @@ function initXaxis$1(gTag, chartJSON, xLabel, formatOptions, dataTableHeight, yS
12500
12500
  let formatedResponsiveDimList = [];
12501
12501
  let actualDimesionWidth = dimensionHeightWidthArray[0] + 5;
12502
12502
  let maxDimensionWidth = dimensionHeightWidthArray[3] + 10;
12503
- if (chartJSON.chartType != chartTypes.WaterfallChart && chartJSON.chartType != chartTypes.ColumnHistogramChart) {
12503
+ if (chartJSON.chartType != chartTypes.ColumnHistogramChart) {
12504
12504
  formatedResponsiveDimList = isDateType ? setDateFormats(
12505
12505
  formatOptions.xAxisLabel.xAxisNumberFormat,
12506
12506
  responsiveDimList.map((d) => d)
@@ -12512,7 +12512,7 @@ function initXaxis$1(gTag, chartJSON, xLabel, formatOptions, dataTableHeight, yS
12512
12512
  );
12513
12513
  });
12514
12514
  }
12515
- let isAreaTypeChartAndNotFitChart = !formatOptions.plotArea.fitChart && (chartJSON.chartType == "Area" || chartJSON.chartType == "StackArea" || chartJSON.chartType == "100StackArea");
12515
+ let isAreaTypeChartAndNotFitChart = !formatOptions.plotArea.fitChart && (chartJSON.chartType == chartTypes.AreaChart || chartJSON.chartType == chartTypes.StackAreaChart || chartJSON.chartType == chartTypes.NormalizedStackAreaChart);
12516
12516
  gTag ? "" : gTag = gTag;
12517
12517
  let fontStyle = formatOptions.xAxisLabel.xAxisLabelFontStyle;
12518
12518
  let Rotation = "rotate(" + -formatOptions.xAxisLabel.xAxisLabelRotation + ")";
@@ -12702,6 +12702,9 @@ function drawSeriesLabels(formatOptions, gTag, seriesLabels) {
12702
12702
  ).style("font-weight", fontStyle.includes("Bold") ? "bold" : "").style("color", "black").text((d) => d.seriesValue);
12703
12703
  }
12704
12704
  }
12705
+ function getTransformStringForXaxisLabelPosition(barChart, margin, formatOptions, innerHeight2, xLabel, yLabel) {
12706
+ return barChart ? `rotate(-90) translate(-${margin.top + innerHeight2},${margin.left - 15 - xLabel})` : `translate(${margin.left},${margin.top + innerHeight2 + (formatOptions?.xAxisLabel?.xAxisPosition == "1" ? 0 : barChart ? yLabel : xLabel)})`;
12707
+ }
12705
12708
  function setXaxistitle$1(formatOptions, barChart, svg, margin, xLabel, height, xTitle, chartType, yLabel, innerWidth2, innerHeight2) {
12706
12709
  try {
12707
12710
  let xAxisLabelPosition = formatOptions.xAxisLabel.xAxisPosition;
@@ -12709,29 +12712,11 @@ function setXaxistitle$1(formatOptions, barChart, svg, margin, xLabel, height, x
12709
12712
  let chartsWithYScrollFlag = false;
12710
12713
  let object2 = svg.append("foreignObject").attr(
12711
12714
  "visibility",
12712
- barChart ? formatOptions.yAxisTitle.yAxisTitleVisibility ? "visible" : "hidden" : formatOptions.xAxisTitle.xAxisTitleVisibility ? "visible" : "hidden"
12715
+ formatOptions.xAxisTitle.xAxisTitleVisibility ? "visible" : "hidden"
12713
12716
  ).attr(
12714
12717
  "transform",
12715
- // !formatOptions.plotArea.fitChart && chartsWithXScrollFlag
12716
- // ? `translate(${margin.left},${margin.top +
12717
- // innerHeight +
12718
- // (formatOptions?.xAxisLabel?.xAxisPosition == "1" ? 0 : barChart ? yLabel : xLabel)
12719
- // })`
12720
- // : !formatOptions.plotArea.fitChart && chartsWithYScrollFlag
12721
- // ? `translate(${margin.left},${height - xTitle - 5})`
12722
- // : `translate(${margin.left},${margin.top +
12723
- // innerHeight +
12724
- // (chartsWithXScrollFlag
12725
- // ? formatOptions?.xAxisLabel?.xAxisPosition == "1"
12726
- // ? 0
12727
- // : xLabel
12728
- // : chartType == chartTypes.tornadoChart
12729
- // ? xLabel + 5
12730
- // : yLabel + 5)
12731
- // })`
12732
- `translate(${margin.left},${margin.top + innerHeight2 + (formatOptions?.xAxisLabel?.xAxisPosition == "1" ? 0 : barChart ? yLabel : xLabel)})`
12733
- // `translate(${margin.left},${Margin.top + innerHeight + (chartsWithXScrollFlag ? (formatOptions?.xAxisLabel?.xAxisPosition == "1" ? 0 : Xlabel) : (attributes.type == chartTypes.TornadoChart) ? Xlabel + 5 : yLabel + 5) })`
12734
- ).attr("class", "xAxisTitle").attr("width", innerWidth2).attr("height", xTitle + "px").style("z-index", "9999");
12718
+ getTransformStringForXaxisLabelPosition(barChart, margin, formatOptions, innerHeight2, xLabel, yLabel)
12719
+ ).attr("class", "xAxisTitle").attr("width", barChart ? innerHeight2 : innerWidth2).attr("height", xTitle + "px").style("z-index", "9999");
12735
12720
  if (formatOptions.xAxisTitle.xAxisDynamicTitleText.length !== 0) {
12736
12721
  object2.append("xhtml:div").style("color", "rgba(119,119,119)").attr("title", formatOptions.xAxisTitle.xAxisTitleText).style("white-space", "pre").style("text-overflow", "ellipsis").html(
12737
12722
  formatOptions.xAxisTitle.xAxisTitleHTML ? formatOptions.xAxisTitle.xAxisTitleHTML : formatOptions.xAxisTitle.xAxisTitleText
@@ -12753,8 +12738,8 @@ function yAxistitle$1(innerHeight2, formatOptions, dataTableHeight, barChart, sv
12753
12738
  let currentInnerHeight = dataTableHeight > 0 ? innerHeight2 - dataTableHeight : innerHeight2 ? innerHeight2 : innerHeight2;
12754
12739
  let object2 = svg.append("foreignObject").attr(
12755
12740
  "visibility",
12756
- barChart ? formatOptions.xAxisTitle.xAxisTitleVisibility ? "visible" : "hidden" : formatOptions.yAxisTitle.yAxisTitleVisibility ? "visible" : "hidden"
12757
- ).attr("x", `-${margin.top + currentInnerHeight}`).attr("y", margin.left - (barChart ? xTitle + xLabel : yTitle + yLabel) + 5).attr("class", "yAxisTitle").attr("transform", "rotate(-90)").attr("width", currentInnerHeight).attr("height", yTitle + "px");
12741
+ formatOptions.yAxisTitle.yAxisTitleVisibility ? "visible" : "hidden"
12742
+ ).attr("x", barChart ? margin.left : `-${margin.top + currentInnerHeight}`).attr("y", barChart ? margin.top + currentInnerHeight + yLabel : margin.left - yTitle - yLabel).attr("class", "yAxisTitle").attr("transform", barChart ? "" : "rotate(-90)").attr("width", barChart ? width : currentInnerHeight).attr("height", yTitle + "px");
12758
12743
  if (formatOptions.yAxisTitle.yAxisDynamicTitleText.length !== 0) {
12759
12744
  object2.append("xhtml:div").style("color", "rgba(119,119,119)").attr("title", formatOptions.yAxisTitle.yAxisTitleText).style("white-space", "pre").style("text-overflow", "ellipsis").html(
12760
12745
  formatOptions.yAxisTitle.yAxisTitleHTML ? formatOptions.yAxisTitle.yAxisTitleHTML : formatOptions.yAxisTitle.yAxisTitleText
@@ -14635,31 +14620,36 @@ const initXaxisBar = (formatOptions, gTag, yLabel, innerHeight2, innerWidth2, xA
14635
14620
  throw error;
14636
14621
  }
14637
14622
  };
14623
+ function getTransformStringForYaxisLabels(isTornadoChart, xaxisLabelPosition, formatOptions, xScaleBottom, yMaxLeft, xLabelMargin, labelWidth) {
14624
+ return isTornadoChart ? `rotate(${90 - formatOptions.xAxisLabel.xAxisLabelRotation})
14625
+ translate(${-(xScaleBottom(yMaxLeft * 0.01) + xLabelMargin)} ,-8)` : `rotate(${90 - formatOptions.xAxisLabel.xAxisLabelRotation})
14626
+ translate(${formatOptions.xAxisLabel.xAxisLabelRotation != 0 ? `${xaxisLabelPosition === 1 ? 10 : -xLabelMargin},${-10}` : -labelWidth / 2 + " ,2"})`;
14627
+ }
14638
14628
  const initYaxisBar = (formatOptions, gTag, xLabel, innerHeight2, innerWidth2, yAxis, xAxisTop, xScaleBottom, yMaxLeft, dimensionList, chartType, isDateType, width, dimensionHeightWidthArray, columnWidth) => {
14639
14629
  try {
14630
+ const isTornadoChart = chartType === chartTypes.TornadoChart;
14640
14631
  let fontStyle = formatOptions.xAxisLabel.xAxisLabelFontStyle;
14641
14632
  let xaxisLabelPosition = parseInt(formatOptions.xAxisLabel.xAxisPosition);
14642
14633
  let responsiveDimList = responsiveXaxisLabel(dimensionList, innerHeight2);
14643
14634
  let labelWidth = formatOptions.xAxisLabel.labelTextWrap ? dimensionHeightWidthArray[3] + 10 < width * 0.1 ? dimensionHeightWidthArray[3] + 10 : width * 0.1 : formatOptions.xAxisLabel.xAxisLabelRotation == 0 ? columnWidth : dimensionHeightWidthArray[0] + 5;
14644
- let xLabelMargin = formatOptions.xAxisLabel.labelTextWrap ? xLabel : labelWidth;
14635
+ let xLabelMargin = formatOptions.xAxisLabel.labelTextWrap ? labelWidth : xLabel;
14645
14636
  let formatedResponsiveDimList = isDateType ? setDateFormats(
14646
14637
  formatOptions.xAxisLabel.xAxisNumberFormat,
14647
14638
  responsiveDimList.map((d) => d)
14648
14639
  ).map((d) => d) : responsiveDimList;
14649
14640
  gTag.selectAll("#yAxisRect").remove();
14650
14641
  gTag.selectAll("#yAxisG").remove();
14651
- let yRect = gTag.append("rect").attr("id", "yAxisRect").attr("transform", chartType === chartTypes.TornadoChart ? `translate(${-xLabelMargin - 20},0)` : `translate(${xaxisLabelPosition === 0 ? -xLabelMargin - 5 : xaxisLabelPosition === 1 ? innerWidth2 : xScaleBottom(0) + (-xLabelMargin - 5)},0)`).attr("height", innerHeight2).attr("width", chartType === chartTypes.TornadoChart ? xLabelMargin + 20 : xLabelMargin + 5).attr(
14642
+ let yRect = gTag.append("rect").attr("id", "yAxisRect").attr("transform", chartType === chartTypes.TornadoChart ? `translate(${-xLabelMargin + 10},0)` : `translate(${xaxisLabelPosition === 0 ? -xLabelMargin - 5 : xaxisLabelPosition === 1 ? innerWidth2 : xScaleBottom(0) + (-xLabelMargin - 5)},0)`).attr("height", innerHeight2).attr("width", chartType === chartTypes.TornadoChart ? xLabelMargin + 20 : xLabelMargin + 5).attr(
14652
14643
  "fill",
14653
14644
  formatOptions.xAxisLabel.xAxisLabelVisibility ? formatOptions.xAxisLabel.xAxisBackgroundColor ? formatOptions.xAxisLabel.xAxisBackgroundColor !== "#ffffff" ? formatOptions.xAxisLabel.xAxisBackgroundColor : "none" : formatOptions.chartArea.chartAreaColor : formatOptions.chartArea.chartAreaColor
14654
14645
  );
14655
- const YaxisG = gTag.append("g").attr("id", "yAxisG").attr("transform", chartType === chartTypes.TornadoChart ? `translate(${xScaleBottom(0)},0)` : `translate(${xaxisLabelPosition === 0 ? 0 : xaxisLabelPosition === 1 ? innerWidth2 : xScaleBottom(0)},0)`).call(yAxis);
14656
- if (chartType !== chartTypes.TornadoChart) {
14646
+ const YaxisG = gTag.append("g").attr("id", "yAxisG").attr("transform", isTornadoChart ? `translate(${xScaleBottom(0)},0)` : `translate(${xaxisLabelPosition === 0 ? 0 : xaxisLabelPosition === 1 ? innerWidth2 : xScaleBottom(0)},0)`).call(yAxis);
14647
+ if (true) {
14657
14648
  let foreignObject = YaxisG.selectAll("g").append("foreignObject").attr("class", "testingoverflowing").attr("width", xLabelMargin).attr("height", "20px").attr(
14658
14649
  "transform",
14659
- `rotate(${90 - formatOptions.xAxisLabel.xAxisLabelRotation})
14660
- translate(${formatOptions.xAxisLabel.xAxisLabelRotation != 0 ? `${xaxisLabelPosition === 1 ? 10 : -xLabelMargin},${-10}` : -labelWidth / 2 + " ,2"})`
14650
+ getTransformStringForYaxisLabels(isTornadoChart, xaxisLabelPosition, formatOptions, xScaleBottom, yMaxLeft, xLabelMargin, labelWidth)
14661
14651
  );
14662
- foreignObject.append("xhtml:h3").style("white-space", "pre").style("text-overflow", "ellipsis").style("text-align", formatOptions.xAxisLabel.xAxisLabelRotation == 0 ? "center" : "start").style("user-select", "none").style("margin", 0).style("margin-top", "5px").style("padding", 0).style("overflow", "hidden").style("font-family", formatOptions.xAxisLabel.xAxisLabelFontFamily).style("font-style", formatOptions.xAxisLabel.xAxisLabelFontStyle).style("color", formatOptions.xAxisLabel.xAxisLabelColor).style("font-size", formatOptions.xAxisLabel.xAxisLabelFontSize + "px").style("font-style", fontStyle.includes("Italic") ? "Italic" : "").style(
14652
+ foreignObject.append("xhtml:h3").style("white-space", "pre").style("text-overflow", "ellipsis").style("text-align", formatOptions.xAxisLabel.xAxisLabelRotation == 0 ? "center" : "start").style("user-select", "none").style("margin", 0).style("padding", 0).style("overflow", "hidden").style("font-family", formatOptions.xAxisLabel.xAxisLabelFontFamily).style("font-style", formatOptions.xAxisLabel.xAxisLabelFontStyle).style("color", formatOptions.xAxisLabel.xAxisLabelColor).style("font-size", formatOptions.xAxisLabel.xAxisLabelFontSize + "px").style("font-style", fontStyle.includes("Italic") ? "Italic" : "").style(
14663
14653
  "text-decoration",
14664
14654
  fontStyle.includes("Underline") ? "Underline" : ""
14665
14655
  ).style("font-weight", fontStyle.includes("Bold") ? "Bold" : "").style(
@@ -14668,13 +14658,6 @@ const initYaxisBar = (formatOptions, gTag, xLabel, innerHeight2, innerWidth2, yA
14668
14658
  ).attr("title", (d, i) => formatedResponsiveDimList[i]).html((d, i) => formatedResponsiveDimList[i]);
14669
14659
  }
14670
14660
  if (chartType === chartTypes.TornadoChart) {
14671
- YaxisG.selectAll("text").attr("dx", `${-(xScaleBottom(yMaxLeft * 0.01) + 15)}px`).style("fill", formatOptions.xAxisLabel.xAxisLabelColor !== "#ffffff" ? formatOptions.xAxisLabel.xAxisLabelColor : "none").style("font-family", formatOptions.xAxisLabel.xAxisLabelFontFamily).style("color", formatOptions.xAxisLabel.xAxisLabelColor).style("font-size", formatOptions.xAxisLabel.xAxisLabelFontSize + "px").style("font-style", fontStyle.includes("Italic") ? "Italic" : "").style(
14672
- "text-decoration",
14673
- fontStyle.includes("Underline") ? "Underline" : ""
14674
- ).style("font-weight", fontStyle.includes("Bold") ? "Bold" : "").style(
14675
- "visibility",
14676
- formatOptions.xAxisLabel.xAxisLabelVisibility ? "visible" : "hidden"
14677
- ).attr("title", (d, i) => responsiveXaxisLabel(dimensionList, innerWidth2)[i]).html((d, i) => responsiveXaxisLabel(dimensionList, innerWidth2)[i]);
14678
14661
  if (xAxisTop) {
14679
14662
  const YaxisRightG = gTag.append("g").attr("transform", `translate(${xScaleBottom(0)},0)`).call(xAxisTop);
14680
14663
  YaxisRightG.selectAll("line").style("shape-rendering", "crispEdges").style("stroke", formatOptions.plotArea.gridLinesColor).attr(
@@ -14685,7 +14668,15 @@ const initYaxisBar = (formatOptions, gTag, xLabel, innerHeight2, innerWidth2, yA
14685
14668
  "stroke-width",
14686
14669
  formatOptions.xAxisLabel.xAxisWidth ?? formatOptions.plotArea.plotAreaBorderThickness
14687
14670
  );
14671
+ YaxisRightG.selectAll("text").style(
14672
+ "visibility",
14673
+ "hidden"
14674
+ );
14688
14675
  }
14676
+ YaxisG.selectAll("text").style(
14677
+ "visibility",
14678
+ "hidden"
14679
+ );
14689
14680
  } else {
14690
14681
  YaxisG.selectAll("text").style(
14691
14682
  "visibility",
@@ -16981,20 +16972,24 @@ const CustomColumnChart = ({
16981
16972
  }
16982
16973
  }
16983
16974
  series.data.forEach((point2) => {
16984
- point2.type = series.properties.type;
16985
- point2.axis = series.properties.axis;
16986
- point2.labelPosition = series.properties.dataLabelPosition;
16987
- point2.labelColor = series.properties.labelColor;
16975
+ const newPoint = {
16976
+ ...point2,
16977
+ type: series.properties.type,
16978
+ axis: series.properties.axis,
16979
+ labelPosition: series.properties.dataLabelPosition,
16980
+ labelColor: series.properties.labelColor
16981
+ };
16988
16982
  if (series.properties.axis === "Secondary") {
16989
16983
  isSecondaryAxisDrawn = true;
16990
- yMaxRight = Math.max(yMaxRight, point2.value);
16991
- yMinRight = Math.min(yMinRight, point2.value);
16984
+ yMaxRight = Math.max(yMaxRight, newPoint.value);
16985
+ yMinRight = Math.min(yMinRight, newPoint.value);
16992
16986
  } else {
16993
- yMaxLeft = Math.max(yMaxLeft, point2.value);
16994
- yMinLeft = Math.min(yMinLeft, point2.value);
16987
+ yMaxLeft = Math.max(yMaxLeft, newPoint.value);
16988
+ yMinLeft = Math.min(yMinLeft, newPoint.value);
16995
16989
  }
16996
16990
  });
16997
16991
  });
16992
+ filteredData = JSON.parse(JSON.stringify(seriesData));
16998
16993
  chartJSON.chartData = tempChartData;
16999
16994
  chartJSON.legendList = legendList;
17000
16995
  chartJSON.yMaxLeft = yMaxLeft;
@@ -19248,8 +19243,10 @@ const NormalizedStackColumnChart = ({
19248
19243
  const getChartType = (lineData) => {
19249
19244
  stackChartData.forEach(
19250
19245
  (data2, i) => data2.forEach((item, position) => {
19251
- lineData[i].data[position][0] = item[0] = item.data.total === 0 ? 0 : item[0] / item.data.total;
19252
- lineData[i].data[position][1] = item[1] = item.data.total === 0 ? 0 : item[1] / item.data.total;
19246
+ if (lineData[i].data[position] && lineData[i].data[position][0] !== void 0 && lineData[i].data[position][1] !== void 0) {
19247
+ lineData[i].data[position][0] = item[0] = item.data.total === 0 ? 0 : item[0] / item.data.total;
19248
+ lineData[i].data[position][1] = item[1] = item.data.total === 0 ? 0 : item[1] / item.data.total;
19249
+ }
19253
19250
  })
19254
19251
  );
19255
19252
  lineData.forEach((lData) => {
@@ -22206,9 +22203,7 @@ const HorizontalBarChart = ({
22206
22203
  margin,
22207
22204
  yTitle,
22208
22205
  yLabel,
22209
- width,
22210
- xTitle,
22211
- xLabel
22206
+ width
22212
22207
  );
22213
22208
  yAxistitleRight(
22214
22209
  svg,
@@ -22695,9 +22690,7 @@ const StackHorizontalChart = ({
22695
22690
  margin,
22696
22691
  yTitle,
22697
22692
  yLabel,
22698
- width,
22699
- xTitle,
22700
- xLabel
22693
+ width
22701
22694
  );
22702
22695
  setChartTitle(svg, formatOptions, width, chartTitleHeight);
22703
22696
  drawLegends(
@@ -23384,9 +23377,7 @@ const NormalizedStackHorizontalBarChart = ({
23384
23377
  margin,
23385
23378
  yTitle,
23386
23379
  yLabel,
23387
- void 0,
23388
- xTitle,
23389
- xLabel
23380
+ void 0
23390
23381
  );
23391
23382
  setChartTitle(svg, formatOptions, width, chartTitleHeight);
23392
23383
  drawLegends(
@@ -26693,7 +26684,7 @@ const PieChart = ({ data, formatOptions, chartId }) => {
26693
26684
  chartFormatOptions.toolTip.toolTipDecimalPrecision
26694
26685
  )
26695
26686
  ) + "%" : getNumberWithFormatFunction(
26696
- "None",
26687
+ chartFormatOptions.toolTip.toolTipDisplayUnits,
26697
26688
  chartFormatOptions.toolTip.toolTipNumberFormat,
26698
26689
  chartFormatOptions.toolTip.toolTipDecimalPrecision
26699
26690
  )(d.currentTarget.__data__.data.data[0].value)
@@ -27060,7 +27051,7 @@ const DonutChart = ({
27060
27051
  chartFormatOptions.toolTip.toolTipDecimalPrecision
27061
27052
  )
27062
27053
  ) + "%" : getNumberWithFormatFunction(
27063
- "None",
27054
+ chartFormatOptions.toolTip.toolTipDisplayUnits,
27064
27055
  chartFormatOptions.toolTip.toolTipNumberFormat,
27065
27056
  chartFormatOptions.toolTip.toolTipDecimalPrecision
27066
27057
  )(d.currentTarget.__data__.data.data[0].value)
@@ -27160,7 +27151,7 @@ const DonutChart = ({
27160
27151
  ).attr(
27161
27152
  "font-family",
27162
27153
  (d) => d.data.properties?.valueFont ?? "Helvetica"
27163
- ).attr("transform", (d) => getDataLabelTransformString(d, isSingleDataLabel)).attr("visibility", (d) => d.endAngle - d.startAngle < 0.17 ? "hidden" : "visible").attr("text-anchor", "middle").attr("alignment-baseline", "middle").attr("dy", chartFormatOptions.plotArea.dataLabelName ? "1.00em" : "0").text((d) => {
27154
+ ).attr("fill", (d) => d.data.properties?.valueFontColor ?? "#000000").attr("transform", (d) => getDataLabelTransformString(d, isSingleDataLabel)).attr("visibility", (d) => d.endAngle - d.startAngle < 0.17 ? "hidden" : "visible").attr("text-anchor", "middle").attr("alignment-baseline", "middle").attr("dy", chartFormatOptions.plotArea.dataLabelName ? "1.00em" : "0").text((d) => {
27164
27155
  if (chartFormatOptions.plotArea.dataLabelValue) {
27165
27156
  const dataValue = d.data.data[0].value;
27166
27157
  if (chartFormatOptions.plotArea.dataLabelValue && dataValue !== void 0) {
@@ -27186,7 +27177,7 @@ const DonutChart = ({
27186
27177
  ).attr(
27187
27178
  "font-weight",
27188
27179
  (d) => d.data.properties?.valueFontStyle?.includes(fontStyleOptions.bold) ? fontStyleOptions.bold : "300"
27189
- ).attr("fill-opacity", 0.5).text((d) => {
27180
+ ).attr("fill", (d) => d.data.properties?.valueFontColor ?? "#000000").attr("fill-opacity", 0.5).text((d) => {
27190
27181
  const dataValue = Math.abs(d.data.data[0].value);
27191
27182
  if (chartFormatOptions.plotArea.plotAreaAbsoluteValue && dataValue !== void 0) {
27192
27183
  return format(".2s")(dataValue);
@@ -27227,7 +27218,69 @@ const DonutChart = ({
27227
27218
  const textWidth = 80;
27228
27219
  const xOffset = midangle < Math.PI ? 0 : -textWidth;
27229
27220
  return radius * 1.1 * (midangle < Math.PI ? 1 : -1) + xOffset;
27230
- }).attr("y", (d) => outerRadius.centroid(d)[1] - 30).append("xhtml:div").attr("hoverId", (d) => (d.data?.properties?.alias || d.data?.properties?.name || "Legend").replace(/\s+/g, "-")).style("display", "flex").style("flex-direction", "column").style("justify-content", "center").style("align-items", "center").style("height", "60px");
27221
+ }).attr("y", (d) => outerRadius.centroid(d)[1] - 30).append("xhtml:div").attr("hoverId", (d) => (d.data?.properties?.alias || d.data?.properties?.name || "Legend").replace(/\s+/g, "-")).style("display", "flex").style("flex-direction", "column").style("justify-content", "center").style("align-items", "center").style("height", "60px").html((d) => {
27222
+ try {
27223
+ let value2 = d.data.data[0].value.toString();
27224
+ if (d.data.data[0].value !== void 0) {
27225
+ value2 = chartFormatOptions.plotArea.dataLabelNumberFormat === ",.0%" ? (Math.abs(d.data.data[0].value / pieTotalValue) * 100).toFixed(
27226
+ convertStringToNumber(
27227
+ chartFormatOptions.plotArea.dataLabelDecimalPrecision
27228
+ )
27229
+ ) + "%" : getNumberWithFormatFunction(
27230
+ chartFormatOptions.plotArea.plotAreaDisplayUnits,
27231
+ chartFormatOptions.plotArea.dataLabelNumberFormat,
27232
+ chartFormatOptions.plotArea.dataLabelDecimalPrecision
27233
+ )(d.data.data[0].value);
27234
+ }
27235
+ let htmlString = "";
27236
+ if (chartFormatOptions.plotArea.dataLabelName) {
27237
+ htmlString += `<span style="
27238
+ font-size: ${d.data.properties.labelFontSize}px;
27239
+ color: ${d.data.properties.labelFontColor};
27240
+ font-style: ${d.data.properties.labelFontStyle.includes(fontStyleOptions.italic) ? fontStyleOptions.italic : ""};
27241
+ text-decoration: ${d.data.properties.labelFontStyle.includes(
27242
+ fontStyleOptions.underline
27243
+ ) ? fontStyleOptions.underline : ""};
27244
+ font-weight: ${d.data.properties.labelFontStyle.includes(fontStyleOptions.bold) ? fontStyleOptions.bold : ""};
27245
+ font-family: ${d.data.properties.labelFont};
27246
+ display: block; white-space: nowrap; width:80px; overflow:hidden; text-overflow:ellipsis; text-align: center;">
27247
+ ${d.data.legend}
27248
+ </span>`;
27249
+ }
27250
+ if (chartFormatOptions.plotArea.dataLabelValue && d.data.data[0].value !== void 0) {
27251
+ htmlString += `<span style="
27252
+ font-size: ${d.data.properties.valueFontSize}px;
27253
+ color: ${d.data.properties.valueFontColor};
27254
+ font-style: ${d.data.properties.valueFontStyle.includes(fontStyleOptions.italic) ? fontStyleOptions.italic : ""};
27255
+ text-decoration: ${d.data.properties.valueFontStyle.includes(
27256
+ fontStyleOptions.underline
27257
+ ) ? fontStyleOptions.underline : ""};
27258
+ font-weight: ${d.data.properties.valueFontStyle.includes(fontStyleOptions.bold) ? fontStyleOptions.bold : "300"};
27259
+ font-family: ${d.data.properties.valueFont};
27260
+ display: block;">
27261
+ ${value2}
27262
+ </span>`;
27263
+ }
27264
+ if (chartFormatOptions.plotArea.plotAreaAbsoluteValue && d.data[0].value !== void 0) {
27265
+ htmlString += `<span style="
27266
+ font-size: ${d.data.properties.valueFontSize}px;
27267
+ color: ${d.data.properties.valueFontColor};
27268
+ font-style: ${d.data.properties.valueFontStyle.includes(fontStyleOptions.italic) ? fontStyleOptions.italic : ""};
27269
+ text-decoration: ${d.data.properties.valueFontStyle.includes(
27270
+ fontStyleOptions.underline
27271
+ ) ? fontStyleOptions.underline : ""};
27272
+ font-weight: ${d.data.properties.valueFontStyle.includes(fontStyleOptions.bold) ? fontStyleOptions.bold : "300"};
27273
+ font-family: ${d.data.properties.valueFont};
27274
+ display: block;">
27275
+ ${format(".2s")(d.data[0].value)}
27276
+ </span>`;
27277
+ }
27278
+ return htmlString;
27279
+ } catch (error) {
27280
+ logError$2(fileName$7, "drawDonutDataLabels", error);
27281
+ return "";
27282
+ }
27283
+ });
27231
27284
  }
27232
27285
  } catch (error) {
27233
27286
  logError$2(fileName$7, "drawDonutDataLabels", error);
@@ -27612,7 +27665,7 @@ const PieofPie = ({
27612
27665
  chartFormatOptions.toolTip.toolTipDecimalPrecision
27613
27666
  ) ?? 0
27614
27667
  ) + "%" : getNumberWithFormatFunction(
27615
- "None",
27668
+ chartFormatOptions.toolTip.toolTipDisplayUnits,
27616
27669
  chartFormatOptions.toolTip.toolTipNumberFormat,
27617
27670
  chartFormatOptions.toolTip.toolTipDecimalPrecision
27618
27671
  )(d.currentTarget.__data__.data.data[0].value)
@@ -27680,7 +27733,7 @@ const PieofPie = ({
27680
27733
  chartFormatOptions.toolTip.toolTipDecimalPrecision
27681
27734
  )
27682
27735
  ) + "%" : getNumberWithFormatFunction(
27683
- "None",
27736
+ chartFormatOptions.toolTip.toolTipDisplayUnits,
27684
27737
  chartFormatOptions.toolTip.toolTipNumberFormat,
27685
27738
  chartFormatOptions.toolTip.toolTipDecimalPrecision
27686
27739
  )(d.currentTarget.__data__.data.data[0].value)
@@ -28027,26 +28080,26 @@ const PyramidChart = ({
28027
28080
  ${centerX + bottomWidth / 2},${yBottom}
28028
28081
  ${centerX - bottomWidth / 2},${yBottom}
28029
28082
  `
28030
- ).attr("fill", d.properties.color || "#4cb2ff").on("mousemove", function(d2) {
28083
+ ).attr("fill", d.properties.color || "#4cb2ff").on("mousemove", function() {
28031
28084
  try {
28032
28085
  showTooltipOnMouseMove(
28033
28086
  [
28034
28087
  {
28035
- key: d2.legend,
28036
- value: chartFormatOptions.toolTip.toolTipNumberFormat == ",.0%" ? d2.data[0].value ? (Math.abs(d2.data[0].value / pyramidTotalValue) * 100).toFixed(
28088
+ key: d.legend,
28089
+ value: chartFormatOptions.toolTip.toolTipNumberFormat == ",.0%" ? d.data[0].value ? (Math.abs(d.data[0].value / pyramidTotalValue) * 100).toFixed(
28037
28090
  convertStringToNumber(
28038
28091
  chartFormatOptions.toolTip.toolTipDecimalPrecision
28039
28092
  )
28040
28093
  ) + "%" : "" : getNumberWithFormatFunction(
28041
- "None",
28094
+ chartFormatOptions.toolTip.toolTipDisplayUnits,
28042
28095
  chartFormatOptions.toolTip.toolTipNumberFormat,
28043
28096
  chartFormatOptions.toolTip.toolTipDecimalPrecision
28044
- )(d2.data[0].value)
28097
+ )(d.data[0].value)
28045
28098
  }
28046
28099
  ],
28047
28100
  chartFormatOptions,
28048
28101
  void 0,
28049
- d2.currentTarget.__data__.data.properties
28102
+ d.properties
28050
28103
  );
28051
28104
  select$2(this).style("opacity", 0.8).style("stroke", chartFormatOptions.chartArea.chartAreaColor).style("stroke-width", "3px");
28052
28105
  } catch (error) {
@@ -28373,7 +28426,7 @@ const ProgressChart = ({
28373
28426
  {
28374
28427
  key: ChartData[0].properties.alias,
28375
28428
  value: chartFormatOptions.toolTip.toolTipNumberFormatProgress == ",.0%" ? "100 %" : getNumberWithFormatFunction(
28376
- "None",
28429
+ chartFormatOptions.toolTip.toolTipDisplayUnits,
28377
28430
  chartFormatOptions.toolTip.toolTipNumberFormatProgress,
28378
28431
  chartFormatOptions.toolTip.toolTipDecimalPrecision
28379
28432
  )(maxValue)
@@ -28411,7 +28464,7 @@ const ProgressChart = ({
28411
28464
  {
28412
28465
  key: ChartData[1].properties.alias,
28413
28466
  value: chartFormatOptions.toolTip.toolTipNumberFormatProgress == ",.0%" ? Math.round(progressValue / maxValue * 100) + "%" : getNumberWithFormatFunction(
28414
- "None",
28467
+ chartFormatOptions.toolTip.toolTipDisplayUnits,
28415
28468
  chartFormatOptions.toolTip.toolTipDecimalPrecision,
28416
28469
  chartFormatOptions.toolTip.toolTipNumberFormatProgress
28417
28470
  )(maxValue)
@@ -28419,7 +28472,7 @@ const ProgressChart = ({
28419
28472
  {
28420
28473
  key: ChartData[0].properties.alias,
28421
28474
  value: chartFormatOptions.toolTip.toolTipNumberFormatProgress == ",.0%" ? "100 %" : getNumberWithFormatFunction(
28422
- "None",
28475
+ chartFormatOptions.toolTip.toolTipDisplayUnits,
28423
28476
  chartFormatOptions.toolTip.toolTipDecimalPrecision,
28424
28477
  chartFormatOptions.toolTip.toolTipNumberFormatProgress
28425
28478
  )(progressValue)
@@ -28468,7 +28521,7 @@ const ProgressChart = ({
28468
28521
  chartFormatOptions.plotArea.dataLabels ? "visible" : "hidden"
28469
28522
  ).attr(
28470
28523
  "fill",
28471
- chartFormatOptions.plotArea.dataLabelValueColor !== "#ffffff" ? chartFormatOptions.plotArea.dataLabelValueColor : "none"
28524
+ chartFormatOptions.plotArea.dataLabelValueColor !== "#ffffff" ? chartFormatOptions.plotArea.dataLabelValueColor : chartFormatOptions.toolTip.toolTipDisplayUnits
28472
28525
  ).attr(
28473
28526
  "font-style",
28474
28527
  valuefontStyle.includes(fontStyleOptions.italic) ? fontStyleOptions.italic : ""
@@ -28828,7 +28881,7 @@ const Speedometer = ({
28828
28881
  value: chartFormatOptions.plotArea.dataLabelNumberFormat == ",.0%" ? Math.round(
28829
28882
  ChartData[index2].data[0].value / ticks2[ticks2.length - 1] * 100
28830
28883
  ) + "%" : getNumberWithFormatFunction(
28831
- "None",
28884
+ chartFormatOptions.toolTip.toolTipDisplayUnits,
28832
28885
  chartFormatOptions.toolTip.toolTipNumberFormat,
28833
28886
  chartFormatOptions.toolTip.toolTipDecimalPrecision
28834
28887
  )(ChartData[index2].data[0].value)
@@ -29195,7 +29248,7 @@ const RadialBarChart = ({
29195
29248
  chartFormatOptions.toolTip.toolTipDecimalPrecision
29196
29249
  )
29197
29250
  ) + "%" : getNumberWithFormatFunction(
29198
- "None",
29251
+ chartFormatOptions.toolTip.toolTipDisplayUnits,
29199
29252
  chartFormatOptions.toolTip.toolTipNumberFormatProgress,
29200
29253
  chartFormatOptions.toolTip.toolTipDecimalPrecision
29201
29254
  )(d.data[0].value)
@@ -29244,7 +29297,7 @@ const RadialBarChart = ({
29244
29297
  {
29245
29298
  key: chartFormatOptions.yAxisTitle.yAxisTitleText,
29246
29299
  value: getNumberWithFormatFunction(
29247
- "None",
29300
+ chartFormatOptions.toolTip.toolTipDisplayUnits,
29248
29301
  chartFormatOptions.toolTip.toolTipNumberFormat,
29249
29302
  chartFormatOptions.toolTip.toolTipDecimalPrecision
29250
29303
  )(d.data[0].value)
@@ -29755,7 +29808,7 @@ const WordCloud = ({ data: { ChartData }, formatOptions, chartId }) => {
29755
29808
  {
29756
29809
  key: d.properties.alias,
29757
29810
  value: getNumberWithFormatFunction(
29758
- "None",
29811
+ chartFormatOptions.toolTip.toolTipDisplayUnits,
29759
29812
  chartFormatOptions.toolTip.toolTipNumberFormat,
29760
29813
  chartFormatOptions.toolTip.toolTipDecimalPrecision
29761
29814
  )(d.data[0].value)
@@ -33230,7 +33283,7 @@ const VennChart = ({
33230
33283
  {
33231
33284
  key: d.label,
33232
33285
  value: getNumberWithFormatFunction(
33233
- "None",
33286
+ chartFormatOptions.toolTip.toolTipDisplayUnits,
33234
33287
  chartFormatOptions.toolTip.toolTipNumberFormat,
33235
33288
  chartFormatOptions.toolTip.toolTipDecimalPrecision
33236
33289
  )(d.size)
@@ -33981,7 +34034,7 @@ const SankeyChart = ({
33981
34034
  {
33982
34035
  key: d.name.split("~$~")[1],
33983
34036
  value: chartFormatOptions.toolTip.toolTipNumberFormat == ",.0%" ? layerWisePercentage.get(d.name) + "%" : getNumberWithFormatFunction(
33984
- "None",
34037
+ chartFormatOptions.toolTip.toolTipDisplayUnits,
33985
34038
  chartFormatOptions.toolTip.toolTipNumberFormat,
33986
34039
  chartFormatOptions.toolTip.toolTipDecimalPrecision
33987
34040
  )(d.value)
@@ -34060,7 +34113,7 @@ const SankeyChart = ({
34060
34113
  {
34061
34114
  key: d.source.name.split("~$~")[1] + "→" + d.target.name.split("~$~")[1],
34062
34115
  value: getNumberWithFormatFunction(
34063
- "None",
34116
+ chartFormatOptions.toolTip.toolTipDisplayUnits,
34064
34117
  chartFormatOptions.toolTip.toolTipNumberFormat,
34065
34118
  chartFormatOptions.toolTip.toolTipDecimalPrecision
34066
34119
  )(d.value)
@@ -49632,7 +49685,7 @@ const Maps = ({
49632
49685
  value: chartFormatOptions.toolTip.toolTipNumberFormat == ",.0%" ? Math.round(
49633
49686
  d.properties.data?.data[1]?.value / bubbleTotal * 100
49634
49687
  ) + "%" : getNumberWithFormatFunction(
49635
- "None",
49688
+ chartFormatOptions.toolTip.toolTipDisplayUnits,
49636
49689
  chartFormatOptions.toolTip.toolTipNumberFormat,
49637
49690
  chartFormatOptions.toolTip.toolTipDecimalPrecision
49638
49691
  )(d.properties.data?.data[1]?.value)
@@ -52334,7 +52387,7 @@ const BubbleChart = ({
52334
52387
  {
52335
52388
  key: chartFormatOptions.xAxisTitle.xAxisTitleText,
52336
52389
  value: getNumberWithFormatFunction(
52337
- "None",
52390
+ chartFormatOptions.toolTip.toolTipDisplayUnits,
52338
52391
  chartFormatOptions.toolTip.toolTipNumberFormat,
52339
52392
  chartFormatOptions.toolTip.toolTipDecimalPrecision
52340
52393
  )(d.dimension)
@@ -52342,7 +52395,7 @@ const BubbleChart = ({
52342
52395
  {
52343
52396
  key: chartFormatOptions.yAxisTitle.yAxisTitleText,
52344
52397
  value: getNumberWithFormatFunction(
52345
- "None",
52398
+ chartFormatOptions.toolTip.toolTipDisplayUnits,
52346
52399
  chartFormatOptions.toolTip.toolTipNumberFormat,
52347
52400
  chartFormatOptions.toolTip.toolTipDecimalPrecision
52348
52401
  )(d.measure)
@@ -52772,7 +52825,7 @@ const ScatterChart = ({
52772
52825
  {
52773
52826
  key: chartFormatOptions.xAxisTitle.xAxisTitleText,
52774
52827
  value: getNumberWithFormatFunction(
52775
- "None",
52828
+ chartFormatOptions.toolTip.toolTipDisplayUnits,
52776
52829
  chartFormatOptions.toolTip.toolTipNumberFormat,
52777
52830
  chartFormatOptions.toolTip.toolTipDecimalPrecision
52778
52831
  )(d.dimension)
@@ -52780,7 +52833,7 @@ const ScatterChart = ({
52780
52833
  {
52781
52834
  key: chartFormatOptions.yAxisTitle.yAxisTitleText,
52782
52835
  value: getNumberWithFormatFunction(
52783
- "None",
52836
+ chartFormatOptions.toolTip.toolTipDisplayUnits,
52784
52837
  chartFormatOptions.toolTip.toolTipNumberFormat,
52785
52838
  chartFormatOptions.toolTip.toolTipDecimalPrecision
52786
52839
  )(d.measure)
@@ -53226,7 +53279,8 @@ const WaterfallChart = ({
53226
53279
  let colorScale;
53227
53280
  const chartType = chartTypes.WaterfallChart;
53228
53281
  const svgRef = useRef();
53229
- const seriesData = generalizedChartData(data.ChartData, data.DimensionList);
53282
+ const isAdvancedWaterfall = Array.isArray(data) && data.length > 0 && data[0]?.hasOwnProperty("Column1") && data[0]?.hasOwnProperty("Column6");
53283
+ const seriesData = isAdvancedWaterfall ? [] : generalizedChartData(data.ChartData, data.DimensionList);
53230
53284
  const dimensionList = data.DimensionList;
53231
53285
  const barChart = false;
53232
53286
  const isSecondaryAxisDrawn = false;
@@ -53433,20 +53487,21 @@ const WaterfallChart = ({
53433
53487
  secondaryAxisTitleWidth
53434
53488
  );
53435
53489
  setChartTitle(svg, formatOptions, width, chartTitleHeight);
53436
- drawLegends(
53437
- height,
53438
- svg,
53439
- dimensionHeightWidthArray,
53440
- chartTitleHeight,
53441
- width,
53442
- legendMargin,
53443
- formatOptions,
53444
- seriesData,
53445
- chartId,
53446
- staticLegendShape.rectangle
53447
- );
53448
53490
  };
53449
53491
  const preProcessChartData = () => {
53492
+ if (isAdvancedWaterfall) {
53493
+ const tempWaterfallChartData2 = mapAdvancedWaterfallData(data);
53494
+ chartJSON.dimensionList = tempWaterfallChartData2.map((d) => d.xKey);
53495
+ chartJSON.legendList = chartJSON.dimensionList;
53496
+ waterFallData = stack().keys(["base", "dimensionTotal", "up", "down"])(
53497
+ tempWaterfallChartData2
53498
+ );
53499
+ const flat = [];
53500
+ waterFallData.forEach((k2) => k2.forEach((d) => flat.push(d[1])));
53501
+ chartJSON.yMaxLeft = max$2(flat) ?? 0;
53502
+ chartJSON.yMinLeft = min$2(flat) ?? 0;
53503
+ return;
53504
+ }
53450
53505
  seriesData.forEach((series) => {
53451
53506
  series.data.forEach((point2) => {
53452
53507
  });
@@ -53463,7 +53518,7 @@ const WaterfallChart = ({
53463
53518
  if (formatOptions.plotArea.hideZeroValues) {
53464
53519
  chartJSON.hideZeroValues = true;
53465
53520
  }
53466
- let tempWaterfallChartData = generateWaterFallData();
53521
+ let tempWaterfallChartData = isAdvancedWaterfall ? mapAdvancedWaterfallData(data) : generateWaterFallData();
53467
53522
  let tempData = JSON.parse(JSON.stringify(tempWaterfallChartData));
53468
53523
  tempWaterfallChartData.forEach((data2) => {
53469
53524
  if (!data2.Dimension && (data2.Up < 1e-9 && data2.Up !== 0 || data2.Down < 1e-9 && data2.Down !== 0)) {
@@ -53596,9 +53651,9 @@ const WaterfallChart = ({
53596
53651
  formatOptions.plotArea.gridLinesVisibility ? formatOptions.plotArea.gridLinesHorizontal ? -innerWidth2 + (seriesLabelWidth ? seriesLabelWidth : 0) : 0 : 0
53597
53652
  ).tickValues(responsiveLablesObj.autoLabelFlag ? void 0 : responsiveLablesObj.yAxisLabelArray).ticks(responsiveLablesObj.customTickValue).tickPadding(8).tickSizeOuter(0);
53598
53653
  }
53599
- colorScale = ordinal().range([
53600
- "#E25A42",
53654
+ colorScale = ordinal().domain(["base", "dimensionTotal", "up", "down"]).range([
53601
53655
  formatOptions.plotArea.totalColor,
53656
+ isAdvancedWaterfall ? "#34558800" : "#345588ff",
53602
53657
  formatOptions.plotArea.positiveColor,
53603
53658
  formatOptions.plotArea.negativeColor
53604
53659
  ]);
@@ -53634,7 +53689,7 @@ const WaterfallChart = ({
53634
53689
  const barGroupsEnter = barGroups.enter().append("g").attr("class", `bar-group-${k2}`).attr("fill", (d) => d.color ? d.color : colorScale(d.key) !== "#ffffff" ? colorScale(d.key) : "none").attr("opacity", (d) => d.opacity);
53635
53690
  barGroups = barGroupsEnter.merge(barGroups);
53636
53691
  let rects = barGroups.selectAll("rect").data((d) => d, (d) => d.key || d.Key);
53637
- const rectsEnter = rects.enter().append("rect").attr("class", "rect").attr("class", (d) => d.key ? d.key.replace(/ /g, "-") : d.Key.replace(/ /g, "-")).attr("x", (d) => xScale(d.data.dimension || d.data.legend)).attr("y", (d) => d[1] ? yScaleLeft(d[1]) : 0).attr("height", (d) => d[1] ? yScaleLeft(d[0]) - yScaleLeft(d[1]) : 0).attr("width", xScale.bandwidth()).attr("visibility", (d) => k2 === 0 && d.data.dimension && stackTotalData ? "hidden" : "visible").style("shape-rendering", "crispEdges").on("mousemove", (event2, d) => {
53692
+ const rectsEnter = rects.enter().append("rect").attr("class", "rect").attr("class", (d) => d.key ? d.key.replace(/ /g, "-") : d.Key.replace(/ /g, "-")).attr("x", (d) => xScale(!isAdvancedWaterfall ? d.data.dimension || d.data.legend : d.data.xKey)).attr("y", (d) => d[1] ? yScaleLeft(d[1]) : 0).attr("height", (d) => d[1] ? yScaleLeft(d[0]) - yScaleLeft(d[1]) : 0).attr("width", xScale.bandwidth()).attr("visibility", (d) => k2 === 0 && d.data.dimension && stackTotalData ? "hidden" : "visible").style("shape-rendering", "crispEdges").on("mousemove", (event2, d) => {
53638
53693
  const markerInfo = {
53639
53694
  markerShape: "square",
53640
53695
  markerColor: d.key === "dimensionTotal" ? formatOptions.plotArea.totalColor : d.key === "down" ? formatOptions.plotArea.negativeColor : formatOptions.plotArea.positiveColor
@@ -53673,7 +53728,7 @@ const WaterfallChart = ({
53673
53728
  formatOptions.plotArea.dataLabelNumberFormat,
53674
53729
  formatOptions.plotArea.dataLabelDecimalPrecision
53675
53730
  )
53676
- ).attr("x", (d) => xScale(d.data.dimension || d.data.legend) + columnWidth / 2).attr("y", (d) => d[1] ? yScaleLeft(d[1]) - 15 : 0).style("font-size", "11px").attr("text-anchor", "middle").attr("visibility", (d) => d[1] - d[0] !== 0 && yScaleLeft(d[1]) ? "visible" : "hidden");
53731
+ ).attr("x", (d) => xScale(!isAdvancedWaterfall ? d.data.dimension || d.data.legend : d.data.xKey) + columnWidth / 2).attr("y", (d) => d[1] ? yScaleLeft(d[1]) - 15 : 0).style("font-size", "11px").attr("text-anchor", "middle").attr("visibility", (d) => d[1] - d[0] !== 0 && yScaleLeft(d[1]) ? "visible" : "hidden");
53677
53732
  textGroups.exit().remove();
53678
53733
  }
53679
53734
  }
@@ -53843,6 +53898,23 @@ const WaterfallChart = ({
53843
53898
  throw error;
53844
53899
  }
53845
53900
  };
53901
+ const toNumber = (v) => v === null || v === void 0 || v === "" ? 0 : Number(v);
53902
+ const isNonZero = (v) => !Number.isNaN(toNumber(v)) && toNumber(v) !== 0;
53903
+ const mapAdvancedWaterfallData = (rawData) => {
53904
+ return rawData.filter((d) => d.Column1 && d.Column1 !== "*").filter((d) => {
53905
+ const base = toNumber(d.Column3);
53906
+ const up = toNumber(d.Column4);
53907
+ const down = toNumber(d.Column5);
53908
+ return isNonZero(base) || isNonZero(up) || isNonZero(down);
53909
+ }).map((d) => ({
53910
+ xKey: d.Column1,
53911
+ base: toNumber(d.Column3),
53912
+ up: toNumber(d.Column4),
53913
+ down: toNumber(d.Column5),
53914
+ total: toNumber(d.Column6),
53915
+ dimensionTotal: toNumber(d.Column2)
53916
+ }));
53917
+ };
53846
53918
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
53847
53919
  "svg",
53848
53920
  {
@@ -53862,6 +53934,7 @@ const TornadoChart = ({
53862
53934
  const chartId = crypto.randomUUID();
53863
53935
  let columnWidth = 0;
53864
53936
  const chartType = chartTypes.TornadoChart;
53937
+ const IsadvanceanalyticsChart = data.IsadvanceanalyticsChart;
53865
53938
  const svgRef = useRef();
53866
53939
  const seriesData = generalizedChartData(data.ChartData, data.DimensionList);
53867
53940
  const dimensionList = data.DimensionList;
@@ -53902,9 +53975,9 @@ const TornadoChart = ({
53902
53975
  let calculatedRange;
53903
53976
  let yAxisLeft;
53904
53977
  let xAxis;
53978
+ let yAxisRight;
53905
53979
  let filteredDimension;
53906
53980
  let filteredData = [];
53907
- let isSensitivityChart = false;
53908
53981
  let scrollPosition = 0;
53909
53982
  const visibleBars = 2;
53910
53983
  let chartJSON = {
@@ -53961,12 +54034,13 @@ const TornadoChart = ({
53961
54034
  maxNumberForSecondaryAxis,
53962
54035
  chartJSON.yMaxLeft,
53963
54036
  formatOptions,
53964
- chartJSON.legendList.map((d) => d["alias"]),
54037
+ !IsadvanceanalyticsChart ? chartJSON.legendList.map((d) => d["alias"]) : chartJSON.legendList.map((d) => d["alias"].split(" - ")[0]),
53965
54038
  chartJSON.dimensionList,
53966
54039
  chartJSON.yMaxRight,
53967
54040
  isSecondaryAxisDrawn,
53968
54041
  isNormalizedChart,
53969
- isDateType
54042
+ isDateType,
54043
+ true
53970
54044
  ));
53971
54045
  setSVGContainer(margin);
53972
54046
  ({ dataTable, dataTableHeight } = dataTablePreCalculation(
@@ -53998,11 +54072,11 @@ const TornadoChart = ({
53998
54072
  initYaxisBar(
53999
54073
  formatOptions,
54000
54074
  gTag,
54001
- yLabel,
54075
+ xLabel,
54002
54076
  innerHeight2,
54003
54077
  innerWidth2,
54004
54078
  yAxisLeft,
54005
- null,
54079
+ yAxisRight,
54006
54080
  xScale,
54007
54081
  chartJSON.yMaxLeft,
54008
54082
  chartJSON.dimensionList,
@@ -54062,7 +54136,8 @@ const TornadoChart = ({
54062
54136
  svg,
54063
54137
  margin,
54064
54138
  yTitle,
54065
- yLabel
54139
+ yLabel,
54140
+ innerWidth2
54066
54141
  );
54067
54142
  yAxistitleRight(
54068
54143
  svg,
@@ -54084,44 +54159,76 @@ const TornadoChart = ({
54084
54159
  width,
54085
54160
  legendMargin,
54086
54161
  formatOptions,
54087
- mapSeriesDataWithLegendList(seriesData, chartJSON.legendList),
54162
+ mapSeriesDataWithLegendList(
54163
+ seriesData,
54164
+ chartJSON.legendList,
54165
+ IsadvanceanalyticsChart,
54166
+ formatOptions
54167
+ ),
54088
54168
  chartId,
54089
54169
  staticLegendShape.rectangle,
54090
54170
  chartType
54091
54171
  );
54092
54172
  };
54093
- const mapSeriesDataWithLegendList = (seriesData2, legendList) => {
54094
- return seriesData2.map((series, index2) => ({
54095
- ...series,
54096
- properties: legendList[index2] ? { ...legendList[index2] } : {}
54097
- })).filter(
54173
+ const mapSeriesDataWithLegendList = (seriesData2, legendList, IsadvanceanalyticsChart2, formatOptions2) => {
54174
+ return seriesData2.map((series, index2) => {
54175
+ const legend = legendList[index2];
54176
+ if (!legend) return { ...series, properties: {} };
54177
+ let updatedAlias = legend.alias;
54178
+ if (IsadvanceanalyticsChart2 && legend.alias) {
54179
+ updatedAlias = legend.alias.split(" - ")[0].trim();
54180
+ }
54181
+ let updatedColor = legend.color;
54182
+ if (IsadvanceanalyticsChart2 && updatedAlias) {
54183
+ if (updatedAlias.includes("+ve")) {
54184
+ updatedColor = formatOptions2.plotArea.plotAreaCalculatedHigh;
54185
+ } else if (updatedAlias.includes("-ve")) {
54186
+ updatedColor = formatOptions2.plotArea.plotAreaCalculatedLow;
54187
+ }
54188
+ }
54189
+ return {
54190
+ ...series,
54191
+ properties: {
54192
+ ...legend,
54193
+ alias: updatedAlias,
54194
+ color: updatedColor
54195
+ }
54196
+ };
54197
+ }).filter(
54098
54198
  (series) => series.properties && Object.keys(series.properties).length > 0
54099
54199
  );
54100
54200
  };
54101
54201
  const preProcessChartData = () => {
54102
- const firstMeasure = seriesData[0]?.properties.currentMeasure;
54103
- let yMaxLeft = 0;
54104
- let yMaxRight = -Infinity;
54105
- const processedSeriesData = seriesData.map((series) => {
54106
- const isFirstMeasure = series.properties.currentMeasure === firstMeasure;
54107
- const newData = series.data.map((point2) => {
54108
- const newValue = isFirstMeasure ? -Math.abs(point2.value) : Math.abs(point2.value);
54202
+ let processedSeriesData;
54203
+ if (!IsadvanceanalyticsChart) {
54204
+ const firstMeasure = seriesData[0]?.properties.currentMeasure;
54205
+ let yMaxLeft = 0;
54206
+ let yMaxRight = -Infinity;
54207
+ processedSeriesData = seriesData.map((series) => {
54208
+ const isFirstMeasure = series.properties.currentMeasure === firstMeasure;
54209
+ const newData = series.data.map((point2) => {
54210
+ const newValue = isFirstMeasure ? -Math.abs(point2.value) : Math.abs(point2.value);
54211
+ return {
54212
+ ...point2,
54213
+ value: newValue
54214
+ };
54215
+ });
54216
+ const values = newData.map((d) => d.value);
54217
+ if (isFirstMeasure) yMaxLeft = Math.min(yMaxLeft, Math.min(...values));
54218
+ else yMaxRight = Math.max(yMaxRight, Math.max(...values));
54109
54219
  return {
54110
- ...point2,
54111
- value: newValue
54220
+ ...series,
54221
+ data: newData
54112
54222
  };
54113
54223
  });
54114
- const values = newData.map((d) => d.value);
54115
- if (isFirstMeasure) yMaxLeft = Math.min(yMaxLeft, Math.min(...values));
54116
- else yMaxRight = Math.max(yMaxRight, Math.max(...values));
54117
- return {
54118
- ...series,
54119
- data: newData
54120
- };
54121
- });
54122
- chartJSON.chartData = processedSeriesData;
54123
- chartJSON.yMaxLeft = yMaxLeft;
54124
- chartJSON.yMaxRight = yMaxRight;
54224
+ chartJSON.chartData = processedSeriesData;
54225
+ chartJSON.yMaxLeft = yMaxLeft;
54226
+ chartJSON.yMaxRight = yMaxRight;
54227
+ } else {
54228
+ chartJSON.chartData = seriesData;
54229
+ chartJSON.yMaxLeft = Math.min(...seriesData.map((d) => d.data[0].value));
54230
+ chartJSON.yMaxRight = Math.max(...seriesData.map((d) => d.data[0].value));
54231
+ }
54125
54232
  const formatedDimensionList = isDateType ? setDateFormats(
54126
54233
  formatOptions.xAxisLabel.xAxisNumberFormat,
54127
54234
  chartJSON.dimensionList
@@ -54132,7 +54239,7 @@ const TornadoChart = ({
54132
54239
  formatedDimensionList[i]
54133
54240
  );
54134
54241
  });
54135
- filteredData = JSON.parse(JSON.stringify(processedSeriesData));
54242
+ filteredData = JSON.parse(JSON.stringify(!IsadvanceanalyticsChart ? processedSeriesData : seriesData));
54136
54243
  filteredDimension = !formatOptions.plotArea.fitChart ? chartJSON.dimensionList.slice(
54137
54244
  scrollPosition,
54138
54245
  scrollPosition + visibleBars
@@ -54168,8 +54275,8 @@ const TornadoChart = ({
54168
54275
  getXAxis();
54169
54276
  yAxisLeft = axisLeft(yScaleLeft).tickSize(
54170
54277
  formatOptions.plotArea.gridLinesVisibility ? formatOptions.plotArea.gridLinesHorizontal ? -(innerWidth2 - xScaleForLegends(0)) : 0 : 0
54171
- ).tickSizeOuter(0).tickValues(responsiveXaxisLabel(chartJSON.dimensionList, innerWidth2));
54172
- axisRight(yScaleLeft).tickSize(
54278
+ ).tickSizeOuter(0).tickValues(responsiveXaxisLabel(chartJSON.dimensionList, innerHeight2));
54279
+ yAxisRight = axisRight(yScaleLeft).tickSize(
54173
54280
  formatOptions.plotArea.gridLinesVisibility ? formatOptions.plotArea.gridLinesHorizontal ? -xScaleForLegends(0) : 0 : 0
54174
54281
  ).tickSizeOuter(0).tickValues(responsiveXaxisLabel(chartJSON.dimensionList, innerWidth2));
54175
54282
  };
@@ -54212,23 +54319,23 @@ const TornadoChart = ({
54212
54319
  };
54213
54320
  const getChartType = () => {
54214
54321
  gTag.selectAll(".parentGroup").remove();
54215
- formatOptions.plotArea.plotAreaCalculatedHigh;
54216
- formatOptions.plotArea.plotAreaCalculatedLow;
54322
+ const positiveBarColor = formatOptions.plotArea.plotAreaCalculatedHigh;
54323
+ const negativeBarColor = formatOptions.plotArea.plotAreaCalculatedLow;
54217
54324
  const parent = gTag.append("g").attr("class", "parentGroup");
54218
54325
  parent.selectAll("rect").data(
54219
54326
  filteredData.flatMap(
54220
54327
  (d) => d.data.map((child) => ({
54221
54328
  ...child,
54222
- legendText: d.legend.replace("-", "~$~").split("~$~")[1].trim(),
54329
+ legendText: !IsadvanceanalyticsChart ? d.legend.replace("-", "~$~").split("~$~")[1].trim() : d.legend.split("ve) - ")[1],
54223
54330
  properties: d.properties
54224
54331
  }))
54225
54332
  )
54226
- ).enter().append("rect").attr("class", "rect").attr("y", (d) => d.legendText ? yScaleLeft(d.legendText) : yScaleLeft("defaultEntry")).attr("height", yScaleLeft.bandwidth()).attr("x", (d) => d.value >= 0 ? xScale(0) : xScale(d.value)).attr("width", (d) => Math.abs(xScale(d.value) - xScale(0))).style("shape-rendering", "crispEdges").attr("stroke-dasharray", (d) => d.properties.stackBorderStyle == 2 ? "5,3" : "0").attr("stroke-width", (d) => `${d.properties.stackBorderWidth}px`).attr(
54333
+ ).enter().append("rect").attr("class", "rect").attr("y", (d) => d.legendText ? yScaleLeft(d.legendText) : yScaleLeft("defaultEntry")).attr("height", yScaleLeft.bandwidth()).attr("x", (d) => d.value >= 0 ? xScale(0) : xScale(d.value)).attr("width", (d) => Math.abs(xScale(d.value) - xScale(0))).style("shape-rendering", "crispEdges").attr("stroke-dasharray", (d) => d.properties.stackBorderStyle == 2 ? "5,3" : "0").attr("stroke-width", (d) => `${d.properties.stackBorderWidth}px`).attr("hoverId", (d) => ((IsadvanceanalyticsChart ? d.legend.split(" - ")[0] : d["dimension"]) || "Legend").replace(/\s+/g, "-")).attr(
54227
54334
  "stroke",
54228
54335
  (d) => d.properties.stackBorderStyle == 0 ? "none" : formatOptions.column.stackBorderVisibility ? d.properties.stackBorderColor : "none"
54229
54336
  ).style(
54230
54337
  "fill",
54231
- (d) => d.properties.color
54338
+ (d) => IsadvanceanalyticsChart ? d.value > 0 ? positiveBarColor !== "#ffffff" ? positiveBarColor : "none" : negativeBarColor !== "#ffffff" ? negativeBarColor : "none" : d.properties.color
54232
54339
  ).on("mousemove", (event2, d) => {
54233
54340
  showTooltipOnMouseMove(
54234
54341
  [
@@ -54353,7 +54460,7 @@ const TornadoChart = ({
54353
54460
  svg,
54354
54461
  yScaleLeft,
54355
54462
  columnWidth,
54356
- isSensitivityChart,
54463
+ IsadvanceanalyticsChart,
54357
54464
  isReportEditable,
54358
54465
  barChart
54359
54466
  );