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.
@@ -12503,7 +12503,7 @@
12503
12503
  let formatedResponsiveDimList = [];
12504
12504
  let actualDimesionWidth = dimensionHeightWidthArray[0] + 5;
12505
12505
  let maxDimensionWidth = dimensionHeightWidthArray[3] + 10;
12506
- if (chartJSON.chartType != chartTypes.WaterfallChart && chartJSON.chartType != chartTypes.ColumnHistogramChart) {
12506
+ if (chartJSON.chartType != chartTypes.ColumnHistogramChart) {
12507
12507
  formatedResponsiveDimList = isDateType ? setDateFormats(
12508
12508
  formatOptions.xAxisLabel.xAxisNumberFormat,
12509
12509
  responsiveDimList.map((d) => d)
@@ -12515,7 +12515,7 @@
12515
12515
  );
12516
12516
  });
12517
12517
  }
12518
- let isAreaTypeChartAndNotFitChart = !formatOptions.plotArea.fitChart && (chartJSON.chartType == "Area" || chartJSON.chartType == "StackArea" || chartJSON.chartType == "100StackArea");
12518
+ let isAreaTypeChartAndNotFitChart = !formatOptions.plotArea.fitChart && (chartJSON.chartType == chartTypes.AreaChart || chartJSON.chartType == chartTypes.StackAreaChart || chartJSON.chartType == chartTypes.NormalizedStackAreaChart);
12519
12519
  gTag ? "" : gTag = gTag;
12520
12520
  let fontStyle = formatOptions.xAxisLabel.xAxisLabelFontStyle;
12521
12521
  let Rotation = "rotate(" + -formatOptions.xAxisLabel.xAxisLabelRotation + ")";
@@ -12705,6 +12705,9 @@
12705
12705
  ).style("font-weight", fontStyle.includes("Bold") ? "bold" : "").style("color", "black").text((d) => d.seriesValue);
12706
12706
  }
12707
12707
  }
12708
+ function getTransformStringForXaxisLabelPosition(barChart, margin, formatOptions, innerHeight2, xLabel, yLabel) {
12709
+ 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)})`;
12710
+ }
12708
12711
  function setXaxistitle$1(formatOptions, barChart, svg, margin, xLabel, height, xTitle, chartType, yLabel, innerWidth2, innerHeight2) {
12709
12712
  try {
12710
12713
  let xAxisLabelPosition = formatOptions.xAxisLabel.xAxisPosition;
@@ -12712,29 +12715,11 @@
12712
12715
  let chartsWithYScrollFlag = false;
12713
12716
  let object2 = svg.append("foreignObject").attr(
12714
12717
  "visibility",
12715
- barChart ? formatOptions.yAxisTitle.yAxisTitleVisibility ? "visible" : "hidden" : formatOptions.xAxisTitle.xAxisTitleVisibility ? "visible" : "hidden"
12718
+ formatOptions.xAxisTitle.xAxisTitleVisibility ? "visible" : "hidden"
12716
12719
  ).attr(
12717
12720
  "transform",
12718
- // !formatOptions.plotArea.fitChart && chartsWithXScrollFlag
12719
- // ? `translate(${margin.left},${margin.top +
12720
- // innerHeight +
12721
- // (formatOptions?.xAxisLabel?.xAxisPosition == "1" ? 0 : barChart ? yLabel : xLabel)
12722
- // })`
12723
- // : !formatOptions.plotArea.fitChart && chartsWithYScrollFlag
12724
- // ? `translate(${margin.left},${height - xTitle - 5})`
12725
- // : `translate(${margin.left},${margin.top +
12726
- // innerHeight +
12727
- // (chartsWithXScrollFlag
12728
- // ? formatOptions?.xAxisLabel?.xAxisPosition == "1"
12729
- // ? 0
12730
- // : xLabel
12731
- // : chartType == chartTypes.tornadoChart
12732
- // ? xLabel + 5
12733
- // : yLabel + 5)
12734
- // })`
12735
- `translate(${margin.left},${margin.top + innerHeight2 + (formatOptions?.xAxisLabel?.xAxisPosition == "1" ? 0 : barChart ? yLabel : xLabel)})`
12736
- // `translate(${margin.left},${Margin.top + innerHeight + (chartsWithXScrollFlag ? (formatOptions?.xAxisLabel?.xAxisPosition == "1" ? 0 : Xlabel) : (attributes.type == chartTypes.TornadoChart) ? Xlabel + 5 : yLabel + 5) })`
12737
- ).attr("class", "xAxisTitle").attr("width", innerWidth2).attr("height", xTitle + "px").style("z-index", "9999");
12721
+ getTransformStringForXaxisLabelPosition(barChart, margin, formatOptions, innerHeight2, xLabel, yLabel)
12722
+ ).attr("class", "xAxisTitle").attr("width", barChart ? innerHeight2 : innerWidth2).attr("height", xTitle + "px").style("z-index", "9999");
12738
12723
  if (formatOptions.xAxisTitle.xAxisDynamicTitleText.length !== 0) {
12739
12724
  object2.append("xhtml:div").style("color", "rgba(119,119,119)").attr("title", formatOptions.xAxisTitle.xAxisTitleText).style("white-space", "pre").style("text-overflow", "ellipsis").html(
12740
12725
  formatOptions.xAxisTitle.xAxisTitleHTML ? formatOptions.xAxisTitle.xAxisTitleHTML : formatOptions.xAxisTitle.xAxisTitleText
@@ -12756,8 +12741,8 @@
12756
12741
  let currentInnerHeight = dataTableHeight > 0 ? innerHeight2 - dataTableHeight : innerHeight2 ? innerHeight2 : innerHeight2;
12757
12742
  let object2 = svg.append("foreignObject").attr(
12758
12743
  "visibility",
12759
- barChart ? formatOptions.xAxisTitle.xAxisTitleVisibility ? "visible" : "hidden" : formatOptions.yAxisTitle.yAxisTitleVisibility ? "visible" : "hidden"
12760
- ).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");
12744
+ formatOptions.yAxisTitle.yAxisTitleVisibility ? "visible" : "hidden"
12745
+ ).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");
12761
12746
  if (formatOptions.yAxisTitle.yAxisDynamicTitleText.length !== 0) {
12762
12747
  object2.append("xhtml:div").style("color", "rgba(119,119,119)").attr("title", formatOptions.yAxisTitle.yAxisTitleText).style("white-space", "pre").style("text-overflow", "ellipsis").html(
12763
12748
  formatOptions.yAxisTitle.yAxisTitleHTML ? formatOptions.yAxisTitle.yAxisTitleHTML : formatOptions.yAxisTitle.yAxisTitleText
@@ -14638,31 +14623,36 @@
14638
14623
  throw error;
14639
14624
  }
14640
14625
  };
14626
+ function getTransformStringForYaxisLabels(isTornadoChart, xaxisLabelPosition, formatOptions, xScaleBottom, yMaxLeft, xLabelMargin, labelWidth) {
14627
+ return isTornadoChart ? `rotate(${90 - formatOptions.xAxisLabel.xAxisLabelRotation})
14628
+ translate(${-(xScaleBottom(yMaxLeft * 0.01) + xLabelMargin)} ,-8)` : `rotate(${90 - formatOptions.xAxisLabel.xAxisLabelRotation})
14629
+ translate(${formatOptions.xAxisLabel.xAxisLabelRotation != 0 ? `${xaxisLabelPosition === 1 ? 10 : -xLabelMargin},${-10}` : -labelWidth / 2 + " ,2"})`;
14630
+ }
14641
14631
  const initYaxisBar = (formatOptions, gTag, xLabel, innerHeight2, innerWidth2, yAxis, xAxisTop, xScaleBottom, yMaxLeft, dimensionList, chartType, isDateType, width, dimensionHeightWidthArray, columnWidth) => {
14642
14632
  try {
14633
+ const isTornadoChart = chartType === chartTypes.TornadoChart;
14643
14634
  let fontStyle = formatOptions.xAxisLabel.xAxisLabelFontStyle;
14644
14635
  let xaxisLabelPosition = parseInt(formatOptions.xAxisLabel.xAxisPosition);
14645
14636
  let responsiveDimList = responsiveXaxisLabel(dimensionList, innerHeight2);
14646
14637
  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;
14647
- let xLabelMargin = formatOptions.xAxisLabel.labelTextWrap ? xLabel : labelWidth;
14638
+ let xLabelMargin = formatOptions.xAxisLabel.labelTextWrap ? labelWidth : xLabel;
14648
14639
  let formatedResponsiveDimList = isDateType ? setDateFormats(
14649
14640
  formatOptions.xAxisLabel.xAxisNumberFormat,
14650
14641
  responsiveDimList.map((d) => d)
14651
14642
  ).map((d) => d) : responsiveDimList;
14652
14643
  gTag.selectAll("#yAxisRect").remove();
14653
14644
  gTag.selectAll("#yAxisG").remove();
14654
- 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(
14645
+ 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(
14655
14646
  "fill",
14656
14647
  formatOptions.xAxisLabel.xAxisLabelVisibility ? formatOptions.xAxisLabel.xAxisBackgroundColor ? formatOptions.xAxisLabel.xAxisBackgroundColor !== "#ffffff" ? formatOptions.xAxisLabel.xAxisBackgroundColor : "none" : formatOptions.chartArea.chartAreaColor : formatOptions.chartArea.chartAreaColor
14657
14648
  );
14658
- 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);
14659
- if (chartType !== chartTypes.TornadoChart) {
14649
+ 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);
14650
+ if (true) {
14660
14651
  let foreignObject = YaxisG.selectAll("g").append("foreignObject").attr("class", "testingoverflowing").attr("width", xLabelMargin).attr("height", "20px").attr(
14661
14652
  "transform",
14662
- `rotate(${90 - formatOptions.xAxisLabel.xAxisLabelRotation})
14663
- translate(${formatOptions.xAxisLabel.xAxisLabelRotation != 0 ? `${xaxisLabelPosition === 1 ? 10 : -xLabelMargin},${-10}` : -labelWidth / 2 + " ,2"})`
14653
+ getTransformStringForYaxisLabels(isTornadoChart, xaxisLabelPosition, formatOptions, xScaleBottom, yMaxLeft, xLabelMargin, labelWidth)
14664
14654
  );
14665
- 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(
14655
+ 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(
14666
14656
  "text-decoration",
14667
14657
  fontStyle.includes("Underline") ? "Underline" : ""
14668
14658
  ).style("font-weight", fontStyle.includes("Bold") ? "Bold" : "").style(
@@ -14671,13 +14661,6 @@
14671
14661
  ).attr("title", (d, i) => formatedResponsiveDimList[i]).html((d, i) => formatedResponsiveDimList[i]);
14672
14662
  }
14673
14663
  if (chartType === chartTypes.TornadoChart) {
14674
- 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(
14675
- "text-decoration",
14676
- fontStyle.includes("Underline") ? "Underline" : ""
14677
- ).style("font-weight", fontStyle.includes("Bold") ? "Bold" : "").style(
14678
- "visibility",
14679
- formatOptions.xAxisLabel.xAxisLabelVisibility ? "visible" : "hidden"
14680
- ).attr("title", (d, i) => responsiveXaxisLabel(dimensionList, innerWidth2)[i]).html((d, i) => responsiveXaxisLabel(dimensionList, innerWidth2)[i]);
14681
14664
  if (xAxisTop) {
14682
14665
  const YaxisRightG = gTag.append("g").attr("transform", `translate(${xScaleBottom(0)},0)`).call(xAxisTop);
14683
14666
  YaxisRightG.selectAll("line").style("shape-rendering", "crispEdges").style("stroke", formatOptions.plotArea.gridLinesColor).attr(
@@ -14688,7 +14671,15 @@
14688
14671
  "stroke-width",
14689
14672
  formatOptions.xAxisLabel.xAxisWidth ?? formatOptions.plotArea.plotAreaBorderThickness
14690
14673
  );
14674
+ YaxisRightG.selectAll("text").style(
14675
+ "visibility",
14676
+ "hidden"
14677
+ );
14691
14678
  }
14679
+ YaxisG.selectAll("text").style(
14680
+ "visibility",
14681
+ "hidden"
14682
+ );
14692
14683
  } else {
14693
14684
  YaxisG.selectAll("text").style(
14694
14685
  "visibility",
@@ -16984,20 +16975,24 @@
16984
16975
  }
16985
16976
  }
16986
16977
  series.data.forEach((point2) => {
16987
- point2.type = series.properties.type;
16988
- point2.axis = series.properties.axis;
16989
- point2.labelPosition = series.properties.dataLabelPosition;
16990
- point2.labelColor = series.properties.labelColor;
16978
+ const newPoint = {
16979
+ ...point2,
16980
+ type: series.properties.type,
16981
+ axis: series.properties.axis,
16982
+ labelPosition: series.properties.dataLabelPosition,
16983
+ labelColor: series.properties.labelColor
16984
+ };
16991
16985
  if (series.properties.axis === "Secondary") {
16992
16986
  isSecondaryAxisDrawn = true;
16993
- yMaxRight = Math.max(yMaxRight, point2.value);
16994
- yMinRight = Math.min(yMinRight, point2.value);
16987
+ yMaxRight = Math.max(yMaxRight, newPoint.value);
16988
+ yMinRight = Math.min(yMinRight, newPoint.value);
16995
16989
  } else {
16996
- yMaxLeft = Math.max(yMaxLeft, point2.value);
16997
- yMinLeft = Math.min(yMinLeft, point2.value);
16990
+ yMaxLeft = Math.max(yMaxLeft, newPoint.value);
16991
+ yMinLeft = Math.min(yMinLeft, newPoint.value);
16998
16992
  }
16999
16993
  });
17000
16994
  });
16995
+ filteredData = JSON.parse(JSON.stringify(seriesData));
17001
16996
  chartJSON.chartData = tempChartData;
17002
16997
  chartJSON.legendList = legendList;
17003
16998
  chartJSON.yMaxLeft = yMaxLeft;
@@ -19251,8 +19246,10 @@
19251
19246
  const getChartType = (lineData) => {
19252
19247
  stackChartData.forEach(
19253
19248
  (data2, i) => data2.forEach((item, position) => {
19254
- lineData[i].data[position][0] = item[0] = item.data.total === 0 ? 0 : item[0] / item.data.total;
19255
- lineData[i].data[position][1] = item[1] = item.data.total === 0 ? 0 : item[1] / item.data.total;
19249
+ if (lineData[i].data[position] && lineData[i].data[position][0] !== void 0 && lineData[i].data[position][1] !== void 0) {
19250
+ lineData[i].data[position][0] = item[0] = item.data.total === 0 ? 0 : item[0] / item.data.total;
19251
+ lineData[i].data[position][1] = item[1] = item.data.total === 0 ? 0 : item[1] / item.data.total;
19252
+ }
19256
19253
  })
19257
19254
  );
19258
19255
  lineData.forEach((lData) => {
@@ -22209,9 +22206,7 @@
22209
22206
  margin,
22210
22207
  yTitle,
22211
22208
  yLabel,
22212
- width,
22213
- xTitle,
22214
- xLabel
22209
+ width
22215
22210
  );
22216
22211
  yAxistitleRight(
22217
22212
  svg,
@@ -22698,9 +22693,7 @@
22698
22693
  margin,
22699
22694
  yTitle,
22700
22695
  yLabel,
22701
- width,
22702
- xTitle,
22703
- xLabel
22696
+ width
22704
22697
  );
22705
22698
  setChartTitle(svg, formatOptions, width, chartTitleHeight);
22706
22699
  drawLegends(
@@ -23387,9 +23380,7 @@
23387
23380
  margin,
23388
23381
  yTitle,
23389
23382
  yLabel,
23390
- void 0,
23391
- xTitle,
23392
- xLabel
23383
+ void 0
23393
23384
  );
23394
23385
  setChartTitle(svg, formatOptions, width, chartTitleHeight);
23395
23386
  drawLegends(
@@ -26696,7 +26687,7 @@
26696
26687
  chartFormatOptions.toolTip.toolTipDecimalPrecision
26697
26688
  )
26698
26689
  ) + "%" : getNumberWithFormatFunction(
26699
- "None",
26690
+ chartFormatOptions.toolTip.toolTipDisplayUnits,
26700
26691
  chartFormatOptions.toolTip.toolTipNumberFormat,
26701
26692
  chartFormatOptions.toolTip.toolTipDecimalPrecision
26702
26693
  )(d.currentTarget.__data__.data.data[0].value)
@@ -27063,7 +27054,7 @@
27063
27054
  chartFormatOptions.toolTip.toolTipDecimalPrecision
27064
27055
  )
27065
27056
  ) + "%" : getNumberWithFormatFunction(
27066
- "None",
27057
+ chartFormatOptions.toolTip.toolTipDisplayUnits,
27067
27058
  chartFormatOptions.toolTip.toolTipNumberFormat,
27068
27059
  chartFormatOptions.toolTip.toolTipDecimalPrecision
27069
27060
  )(d.currentTarget.__data__.data.data[0].value)
@@ -27163,7 +27154,7 @@
27163
27154
  ).attr(
27164
27155
  "font-family",
27165
27156
  (d) => d.data.properties?.valueFont ?? "Helvetica"
27166
- ).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) => {
27157
+ ).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) => {
27167
27158
  if (chartFormatOptions.plotArea.dataLabelValue) {
27168
27159
  const dataValue = d.data.data[0].value;
27169
27160
  if (chartFormatOptions.plotArea.dataLabelValue && dataValue !== void 0) {
@@ -27189,7 +27180,7 @@
27189
27180
  ).attr(
27190
27181
  "font-weight",
27191
27182
  (d) => d.data.properties?.valueFontStyle?.includes(fontStyleOptions.bold) ? fontStyleOptions.bold : "300"
27192
- ).attr("fill-opacity", 0.5).text((d) => {
27183
+ ).attr("fill", (d) => d.data.properties?.valueFontColor ?? "#000000").attr("fill-opacity", 0.5).text((d) => {
27193
27184
  const dataValue = Math.abs(d.data.data[0].value);
27194
27185
  if (chartFormatOptions.plotArea.plotAreaAbsoluteValue && dataValue !== void 0) {
27195
27186
  return format(".2s")(dataValue);
@@ -27230,7 +27221,69 @@
27230
27221
  const textWidth = 80;
27231
27222
  const xOffset = midangle < Math.PI ? 0 : -textWidth;
27232
27223
  return radius * 1.1 * (midangle < Math.PI ? 1 : -1) + xOffset;
27233
- }).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");
27224
+ }).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) => {
27225
+ try {
27226
+ let value2 = d.data.data[0].value.toString();
27227
+ if (d.data.data[0].value !== void 0) {
27228
+ value2 = chartFormatOptions.plotArea.dataLabelNumberFormat === ",.0%" ? (Math.abs(d.data.data[0].value / pieTotalValue) * 100).toFixed(
27229
+ convertStringToNumber(
27230
+ chartFormatOptions.plotArea.dataLabelDecimalPrecision
27231
+ )
27232
+ ) + "%" : getNumberWithFormatFunction(
27233
+ chartFormatOptions.plotArea.plotAreaDisplayUnits,
27234
+ chartFormatOptions.plotArea.dataLabelNumberFormat,
27235
+ chartFormatOptions.plotArea.dataLabelDecimalPrecision
27236
+ )(d.data.data[0].value);
27237
+ }
27238
+ let htmlString = "";
27239
+ if (chartFormatOptions.plotArea.dataLabelName) {
27240
+ htmlString += `<span style="
27241
+ font-size: ${d.data.properties.labelFontSize}px;
27242
+ color: ${d.data.properties.labelFontColor};
27243
+ font-style: ${d.data.properties.labelFontStyle.includes(fontStyleOptions.italic) ? fontStyleOptions.italic : ""};
27244
+ text-decoration: ${d.data.properties.labelFontStyle.includes(
27245
+ fontStyleOptions.underline
27246
+ ) ? fontStyleOptions.underline : ""};
27247
+ font-weight: ${d.data.properties.labelFontStyle.includes(fontStyleOptions.bold) ? fontStyleOptions.bold : ""};
27248
+ font-family: ${d.data.properties.labelFont};
27249
+ display: block; white-space: nowrap; width:80px; overflow:hidden; text-overflow:ellipsis; text-align: center;">
27250
+ ${d.data.legend}
27251
+ </span>`;
27252
+ }
27253
+ if (chartFormatOptions.plotArea.dataLabelValue && d.data.data[0].value !== void 0) {
27254
+ htmlString += `<span style="
27255
+ font-size: ${d.data.properties.valueFontSize}px;
27256
+ color: ${d.data.properties.valueFontColor};
27257
+ font-style: ${d.data.properties.valueFontStyle.includes(fontStyleOptions.italic) ? fontStyleOptions.italic : ""};
27258
+ text-decoration: ${d.data.properties.valueFontStyle.includes(
27259
+ fontStyleOptions.underline
27260
+ ) ? fontStyleOptions.underline : ""};
27261
+ font-weight: ${d.data.properties.valueFontStyle.includes(fontStyleOptions.bold) ? fontStyleOptions.bold : "300"};
27262
+ font-family: ${d.data.properties.valueFont};
27263
+ display: block;">
27264
+ ${value2}
27265
+ </span>`;
27266
+ }
27267
+ if (chartFormatOptions.plotArea.plotAreaAbsoluteValue && d.data[0].value !== void 0) {
27268
+ htmlString += `<span style="
27269
+ font-size: ${d.data.properties.valueFontSize}px;
27270
+ color: ${d.data.properties.valueFontColor};
27271
+ font-style: ${d.data.properties.valueFontStyle.includes(fontStyleOptions.italic) ? fontStyleOptions.italic : ""};
27272
+ text-decoration: ${d.data.properties.valueFontStyle.includes(
27273
+ fontStyleOptions.underline
27274
+ ) ? fontStyleOptions.underline : ""};
27275
+ font-weight: ${d.data.properties.valueFontStyle.includes(fontStyleOptions.bold) ? fontStyleOptions.bold : "300"};
27276
+ font-family: ${d.data.properties.valueFont};
27277
+ display: block;">
27278
+ ${format(".2s")(d.data[0].value)}
27279
+ </span>`;
27280
+ }
27281
+ return htmlString;
27282
+ } catch (error) {
27283
+ logError$2(fileName$7, "drawDonutDataLabels", error);
27284
+ return "";
27285
+ }
27286
+ });
27234
27287
  }
27235
27288
  } catch (error) {
27236
27289
  logError$2(fileName$7, "drawDonutDataLabels", error);
@@ -27615,7 +27668,7 @@
27615
27668
  chartFormatOptions.toolTip.toolTipDecimalPrecision
27616
27669
  ) ?? 0
27617
27670
  ) + "%" : getNumberWithFormatFunction(
27618
- "None",
27671
+ chartFormatOptions.toolTip.toolTipDisplayUnits,
27619
27672
  chartFormatOptions.toolTip.toolTipNumberFormat,
27620
27673
  chartFormatOptions.toolTip.toolTipDecimalPrecision
27621
27674
  )(d.currentTarget.__data__.data.data[0].value)
@@ -27683,7 +27736,7 @@
27683
27736
  chartFormatOptions.toolTip.toolTipDecimalPrecision
27684
27737
  )
27685
27738
  ) + "%" : getNumberWithFormatFunction(
27686
- "None",
27739
+ chartFormatOptions.toolTip.toolTipDisplayUnits,
27687
27740
  chartFormatOptions.toolTip.toolTipNumberFormat,
27688
27741
  chartFormatOptions.toolTip.toolTipDecimalPrecision
27689
27742
  )(d.currentTarget.__data__.data.data[0].value)
@@ -28030,26 +28083,26 @@
28030
28083
  ${centerX + bottomWidth / 2},${yBottom}
28031
28084
  ${centerX - bottomWidth / 2},${yBottom}
28032
28085
  `
28033
- ).attr("fill", d.properties.color || "#4cb2ff").on("mousemove", function(d2) {
28086
+ ).attr("fill", d.properties.color || "#4cb2ff").on("mousemove", function() {
28034
28087
  try {
28035
28088
  showTooltipOnMouseMove(
28036
28089
  [
28037
28090
  {
28038
- key: d2.legend,
28039
- value: chartFormatOptions.toolTip.toolTipNumberFormat == ",.0%" ? d2.data[0].value ? (Math.abs(d2.data[0].value / pyramidTotalValue) * 100).toFixed(
28091
+ key: d.legend,
28092
+ value: chartFormatOptions.toolTip.toolTipNumberFormat == ",.0%" ? d.data[0].value ? (Math.abs(d.data[0].value / pyramidTotalValue) * 100).toFixed(
28040
28093
  convertStringToNumber(
28041
28094
  chartFormatOptions.toolTip.toolTipDecimalPrecision
28042
28095
  )
28043
28096
  ) + "%" : "" : getNumberWithFormatFunction(
28044
- "None",
28097
+ chartFormatOptions.toolTip.toolTipDisplayUnits,
28045
28098
  chartFormatOptions.toolTip.toolTipNumberFormat,
28046
28099
  chartFormatOptions.toolTip.toolTipDecimalPrecision
28047
- )(d2.data[0].value)
28100
+ )(d.data[0].value)
28048
28101
  }
28049
28102
  ],
28050
28103
  chartFormatOptions,
28051
28104
  void 0,
28052
- d2.currentTarget.__data__.data.properties
28105
+ d.properties
28053
28106
  );
28054
28107
  select$2(this).style("opacity", 0.8).style("stroke", chartFormatOptions.chartArea.chartAreaColor).style("stroke-width", "3px");
28055
28108
  } catch (error) {
@@ -28376,7 +28429,7 @@
28376
28429
  {
28377
28430
  key: ChartData[0].properties.alias,
28378
28431
  value: chartFormatOptions.toolTip.toolTipNumberFormatProgress == ",.0%" ? "100 %" : getNumberWithFormatFunction(
28379
- "None",
28432
+ chartFormatOptions.toolTip.toolTipDisplayUnits,
28380
28433
  chartFormatOptions.toolTip.toolTipNumberFormatProgress,
28381
28434
  chartFormatOptions.toolTip.toolTipDecimalPrecision
28382
28435
  )(maxValue)
@@ -28414,7 +28467,7 @@
28414
28467
  {
28415
28468
  key: ChartData[1].properties.alias,
28416
28469
  value: chartFormatOptions.toolTip.toolTipNumberFormatProgress == ",.0%" ? Math.round(progressValue / maxValue * 100) + "%" : getNumberWithFormatFunction(
28417
- "None",
28470
+ chartFormatOptions.toolTip.toolTipDisplayUnits,
28418
28471
  chartFormatOptions.toolTip.toolTipDecimalPrecision,
28419
28472
  chartFormatOptions.toolTip.toolTipNumberFormatProgress
28420
28473
  )(maxValue)
@@ -28422,7 +28475,7 @@
28422
28475
  {
28423
28476
  key: ChartData[0].properties.alias,
28424
28477
  value: chartFormatOptions.toolTip.toolTipNumberFormatProgress == ",.0%" ? "100 %" : getNumberWithFormatFunction(
28425
- "None",
28478
+ chartFormatOptions.toolTip.toolTipDisplayUnits,
28426
28479
  chartFormatOptions.toolTip.toolTipDecimalPrecision,
28427
28480
  chartFormatOptions.toolTip.toolTipNumberFormatProgress
28428
28481
  )(progressValue)
@@ -28471,7 +28524,7 @@
28471
28524
  chartFormatOptions.plotArea.dataLabels ? "visible" : "hidden"
28472
28525
  ).attr(
28473
28526
  "fill",
28474
- chartFormatOptions.plotArea.dataLabelValueColor !== "#ffffff" ? chartFormatOptions.plotArea.dataLabelValueColor : "none"
28527
+ chartFormatOptions.plotArea.dataLabelValueColor !== "#ffffff" ? chartFormatOptions.plotArea.dataLabelValueColor : chartFormatOptions.toolTip.toolTipDisplayUnits
28475
28528
  ).attr(
28476
28529
  "font-style",
28477
28530
  valuefontStyle.includes(fontStyleOptions.italic) ? fontStyleOptions.italic : ""
@@ -28831,7 +28884,7 @@
28831
28884
  value: chartFormatOptions.plotArea.dataLabelNumberFormat == ",.0%" ? Math.round(
28832
28885
  ChartData[index2].data[0].value / ticks2[ticks2.length - 1] * 100
28833
28886
  ) + "%" : getNumberWithFormatFunction(
28834
- "None",
28887
+ chartFormatOptions.toolTip.toolTipDisplayUnits,
28835
28888
  chartFormatOptions.toolTip.toolTipNumberFormat,
28836
28889
  chartFormatOptions.toolTip.toolTipDecimalPrecision
28837
28890
  )(ChartData[index2].data[0].value)
@@ -29198,7 +29251,7 @@
29198
29251
  chartFormatOptions.toolTip.toolTipDecimalPrecision
29199
29252
  )
29200
29253
  ) + "%" : getNumberWithFormatFunction(
29201
- "None",
29254
+ chartFormatOptions.toolTip.toolTipDisplayUnits,
29202
29255
  chartFormatOptions.toolTip.toolTipNumberFormatProgress,
29203
29256
  chartFormatOptions.toolTip.toolTipDecimalPrecision
29204
29257
  )(d.data[0].value)
@@ -29247,7 +29300,7 @@
29247
29300
  {
29248
29301
  key: chartFormatOptions.yAxisTitle.yAxisTitleText,
29249
29302
  value: getNumberWithFormatFunction(
29250
- "None",
29303
+ chartFormatOptions.toolTip.toolTipDisplayUnits,
29251
29304
  chartFormatOptions.toolTip.toolTipNumberFormat,
29252
29305
  chartFormatOptions.toolTip.toolTipDecimalPrecision
29253
29306
  )(d.data[0].value)
@@ -29758,7 +29811,7 @@
29758
29811
  {
29759
29812
  key: d.properties.alias,
29760
29813
  value: getNumberWithFormatFunction(
29761
- "None",
29814
+ chartFormatOptions.toolTip.toolTipDisplayUnits,
29762
29815
  chartFormatOptions.toolTip.toolTipNumberFormat,
29763
29816
  chartFormatOptions.toolTip.toolTipDecimalPrecision
29764
29817
  )(d.data[0].value)
@@ -33233,7 +33286,7 @@
33233
33286
  {
33234
33287
  key: d.label,
33235
33288
  value: getNumberWithFormatFunction(
33236
- "None",
33289
+ chartFormatOptions.toolTip.toolTipDisplayUnits,
33237
33290
  chartFormatOptions.toolTip.toolTipNumberFormat,
33238
33291
  chartFormatOptions.toolTip.toolTipDecimalPrecision
33239
33292
  )(d.size)
@@ -33984,7 +34037,7 @@
33984
34037
  {
33985
34038
  key: d.name.split("~$~")[1],
33986
34039
  value: chartFormatOptions.toolTip.toolTipNumberFormat == ",.0%" ? layerWisePercentage.get(d.name) + "%" : getNumberWithFormatFunction(
33987
- "None",
34040
+ chartFormatOptions.toolTip.toolTipDisplayUnits,
33988
34041
  chartFormatOptions.toolTip.toolTipNumberFormat,
33989
34042
  chartFormatOptions.toolTip.toolTipDecimalPrecision
33990
34043
  )(d.value)
@@ -34063,7 +34116,7 @@
34063
34116
  {
34064
34117
  key: d.source.name.split("~$~")[1] + "→" + d.target.name.split("~$~")[1],
34065
34118
  value: getNumberWithFormatFunction(
34066
- "None",
34119
+ chartFormatOptions.toolTip.toolTipDisplayUnits,
34067
34120
  chartFormatOptions.toolTip.toolTipNumberFormat,
34068
34121
  chartFormatOptions.toolTip.toolTipDecimalPrecision
34069
34122
  )(d.value)
@@ -49635,7 +49688,7 @@
49635
49688
  value: chartFormatOptions.toolTip.toolTipNumberFormat == ",.0%" ? Math.round(
49636
49689
  d.properties.data?.data[1]?.value / bubbleTotal * 100
49637
49690
  ) + "%" : getNumberWithFormatFunction(
49638
- "None",
49691
+ chartFormatOptions.toolTip.toolTipDisplayUnits,
49639
49692
  chartFormatOptions.toolTip.toolTipNumberFormat,
49640
49693
  chartFormatOptions.toolTip.toolTipDecimalPrecision
49641
49694
  )(d.properties.data?.data[1]?.value)
@@ -52337,7 +52390,7 @@
52337
52390
  {
52338
52391
  key: chartFormatOptions.xAxisTitle.xAxisTitleText,
52339
52392
  value: getNumberWithFormatFunction(
52340
- "None",
52393
+ chartFormatOptions.toolTip.toolTipDisplayUnits,
52341
52394
  chartFormatOptions.toolTip.toolTipNumberFormat,
52342
52395
  chartFormatOptions.toolTip.toolTipDecimalPrecision
52343
52396
  )(d.dimension)
@@ -52345,7 +52398,7 @@
52345
52398
  {
52346
52399
  key: chartFormatOptions.yAxisTitle.yAxisTitleText,
52347
52400
  value: getNumberWithFormatFunction(
52348
- "None",
52401
+ chartFormatOptions.toolTip.toolTipDisplayUnits,
52349
52402
  chartFormatOptions.toolTip.toolTipNumberFormat,
52350
52403
  chartFormatOptions.toolTip.toolTipDecimalPrecision
52351
52404
  )(d.measure)
@@ -52775,7 +52828,7 @@
52775
52828
  {
52776
52829
  key: chartFormatOptions.xAxisTitle.xAxisTitleText,
52777
52830
  value: getNumberWithFormatFunction(
52778
- "None",
52831
+ chartFormatOptions.toolTip.toolTipDisplayUnits,
52779
52832
  chartFormatOptions.toolTip.toolTipNumberFormat,
52780
52833
  chartFormatOptions.toolTip.toolTipDecimalPrecision
52781
52834
  )(d.dimension)
@@ -52783,7 +52836,7 @@
52783
52836
  {
52784
52837
  key: chartFormatOptions.yAxisTitle.yAxisTitleText,
52785
52838
  value: getNumberWithFormatFunction(
52786
- "None",
52839
+ chartFormatOptions.toolTip.toolTipDisplayUnits,
52787
52840
  chartFormatOptions.toolTip.toolTipNumberFormat,
52788
52841
  chartFormatOptions.toolTip.toolTipDecimalPrecision
52789
52842
  )(d.measure)
@@ -53229,7 +53282,8 @@
53229
53282
  let colorScale;
53230
53283
  const chartType = chartTypes.WaterfallChart;
53231
53284
  const svgRef = require$$0$1.useRef();
53232
- const seriesData = generalizedChartData(data.ChartData, data.DimensionList);
53285
+ const isAdvancedWaterfall = Array.isArray(data) && data.length > 0 && data[0]?.hasOwnProperty("Column1") && data[0]?.hasOwnProperty("Column6");
53286
+ const seriesData = isAdvancedWaterfall ? [] : generalizedChartData(data.ChartData, data.DimensionList);
53233
53287
  const dimensionList = data.DimensionList;
53234
53288
  const barChart = false;
53235
53289
  const isSecondaryAxisDrawn = false;
@@ -53436,20 +53490,21 @@
53436
53490
  secondaryAxisTitleWidth
53437
53491
  );
53438
53492
  setChartTitle(svg, formatOptions, width, chartTitleHeight);
53439
- drawLegends(
53440
- height,
53441
- svg,
53442
- dimensionHeightWidthArray,
53443
- chartTitleHeight,
53444
- width,
53445
- legendMargin,
53446
- formatOptions,
53447
- seriesData,
53448
- chartId,
53449
- staticLegendShape.rectangle
53450
- );
53451
53493
  };
53452
53494
  const preProcessChartData = () => {
53495
+ if (isAdvancedWaterfall) {
53496
+ const tempWaterfallChartData2 = mapAdvancedWaterfallData(data);
53497
+ chartJSON.dimensionList = tempWaterfallChartData2.map((d) => d.xKey);
53498
+ chartJSON.legendList = chartJSON.dimensionList;
53499
+ waterFallData = stack().keys(["base", "dimensionTotal", "up", "down"])(
53500
+ tempWaterfallChartData2
53501
+ );
53502
+ const flat = [];
53503
+ waterFallData.forEach((k2) => k2.forEach((d) => flat.push(d[1])));
53504
+ chartJSON.yMaxLeft = max$2(flat) ?? 0;
53505
+ chartJSON.yMinLeft = min$2(flat) ?? 0;
53506
+ return;
53507
+ }
53453
53508
  seriesData.forEach((series) => {
53454
53509
  series.data.forEach((point2) => {
53455
53510
  });
@@ -53466,7 +53521,7 @@
53466
53521
  if (formatOptions.plotArea.hideZeroValues) {
53467
53522
  chartJSON.hideZeroValues = true;
53468
53523
  }
53469
- let tempWaterfallChartData = generateWaterFallData();
53524
+ let tempWaterfallChartData = isAdvancedWaterfall ? mapAdvancedWaterfallData(data) : generateWaterFallData();
53470
53525
  let tempData = JSON.parse(JSON.stringify(tempWaterfallChartData));
53471
53526
  tempWaterfallChartData.forEach((data2) => {
53472
53527
  if (!data2.Dimension && (data2.Up < 1e-9 && data2.Up !== 0 || data2.Down < 1e-9 && data2.Down !== 0)) {
@@ -53599,9 +53654,9 @@
53599
53654
  formatOptions.plotArea.gridLinesVisibility ? formatOptions.plotArea.gridLinesHorizontal ? -innerWidth2 + (seriesLabelWidth ? seriesLabelWidth : 0) : 0 : 0
53600
53655
  ).tickValues(responsiveLablesObj.autoLabelFlag ? void 0 : responsiveLablesObj.yAxisLabelArray).ticks(responsiveLablesObj.customTickValue).tickPadding(8).tickSizeOuter(0);
53601
53656
  }
53602
- colorScale = ordinal().range([
53603
- "#E25A42",
53657
+ colorScale = ordinal().domain(["base", "dimensionTotal", "up", "down"]).range([
53604
53658
  formatOptions.plotArea.totalColor,
53659
+ isAdvancedWaterfall ? "#34558800" : "#345588ff",
53605
53660
  formatOptions.plotArea.positiveColor,
53606
53661
  formatOptions.plotArea.negativeColor
53607
53662
  ]);
@@ -53637,7 +53692,7 @@
53637
53692
  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);
53638
53693
  barGroups = barGroupsEnter.merge(barGroups);
53639
53694
  let rects = barGroups.selectAll("rect").data((d) => d, (d) => d.key || d.Key);
53640
- 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) => {
53695
+ 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) => {
53641
53696
  const markerInfo = {
53642
53697
  markerShape: "square",
53643
53698
  markerColor: d.key === "dimensionTotal" ? formatOptions.plotArea.totalColor : d.key === "down" ? formatOptions.plotArea.negativeColor : formatOptions.plotArea.positiveColor
@@ -53676,7 +53731,7 @@
53676
53731
  formatOptions.plotArea.dataLabelNumberFormat,
53677
53732
  formatOptions.plotArea.dataLabelDecimalPrecision
53678
53733
  )
53679
- ).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");
53734
+ ).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");
53680
53735
  textGroups.exit().remove();
53681
53736
  }
53682
53737
  }
@@ -53846,6 +53901,23 @@
53846
53901
  throw error;
53847
53902
  }
53848
53903
  };
53904
+ const toNumber = (v) => v === null || v === void 0 || v === "" ? 0 : Number(v);
53905
+ const isNonZero = (v) => !Number.isNaN(toNumber(v)) && toNumber(v) !== 0;
53906
+ const mapAdvancedWaterfallData = (rawData) => {
53907
+ return rawData.filter((d) => d.Column1 && d.Column1 !== "*").filter((d) => {
53908
+ const base = toNumber(d.Column3);
53909
+ const up = toNumber(d.Column4);
53910
+ const down = toNumber(d.Column5);
53911
+ return isNonZero(base) || isNonZero(up) || isNonZero(down);
53912
+ }).map((d) => ({
53913
+ xKey: d.Column1,
53914
+ base: toNumber(d.Column3),
53915
+ up: toNumber(d.Column4),
53916
+ down: toNumber(d.Column5),
53917
+ total: toNumber(d.Column6),
53918
+ dimensionTotal: toNumber(d.Column2)
53919
+ }));
53920
+ };
53849
53921
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
53850
53922
  "svg",
53851
53923
  {
@@ -53865,6 +53937,7 @@
53865
53937
  const chartId = crypto.randomUUID();
53866
53938
  let columnWidth = 0;
53867
53939
  const chartType = chartTypes.TornadoChart;
53940
+ const IsadvanceanalyticsChart = data.IsadvanceanalyticsChart;
53868
53941
  const svgRef = require$$0$1.useRef();
53869
53942
  const seriesData = generalizedChartData(data.ChartData, data.DimensionList);
53870
53943
  const dimensionList = data.DimensionList;
@@ -53905,9 +53978,9 @@
53905
53978
  let calculatedRange;
53906
53979
  let yAxisLeft;
53907
53980
  let xAxis;
53981
+ let yAxisRight;
53908
53982
  let filteredDimension;
53909
53983
  let filteredData = [];
53910
- let isSensitivityChart = false;
53911
53984
  let scrollPosition = 0;
53912
53985
  const visibleBars = 2;
53913
53986
  let chartJSON = {
@@ -53964,12 +54037,13 @@
53964
54037
  maxNumberForSecondaryAxis,
53965
54038
  chartJSON.yMaxLeft,
53966
54039
  formatOptions,
53967
- chartJSON.legendList.map((d) => d["alias"]),
54040
+ !IsadvanceanalyticsChart ? chartJSON.legendList.map((d) => d["alias"]) : chartJSON.legendList.map((d) => d["alias"].split(" - ")[0]),
53968
54041
  chartJSON.dimensionList,
53969
54042
  chartJSON.yMaxRight,
53970
54043
  isSecondaryAxisDrawn,
53971
54044
  isNormalizedChart,
53972
- isDateType
54045
+ isDateType,
54046
+ true
53973
54047
  ));
53974
54048
  setSVGContainer(margin);
53975
54049
  ({ dataTable, dataTableHeight } = dataTablePreCalculation(
@@ -54001,11 +54075,11 @@
54001
54075
  initYaxisBar(
54002
54076
  formatOptions,
54003
54077
  gTag,
54004
- yLabel,
54078
+ xLabel,
54005
54079
  innerHeight2,
54006
54080
  innerWidth2,
54007
54081
  yAxisLeft,
54008
- null,
54082
+ yAxisRight,
54009
54083
  xScale,
54010
54084
  chartJSON.yMaxLeft,
54011
54085
  chartJSON.dimensionList,
@@ -54065,7 +54139,8 @@
54065
54139
  svg,
54066
54140
  margin,
54067
54141
  yTitle,
54068
- yLabel
54142
+ yLabel,
54143
+ innerWidth2
54069
54144
  );
54070
54145
  yAxistitleRight(
54071
54146
  svg,
@@ -54087,44 +54162,76 @@
54087
54162
  width,
54088
54163
  legendMargin,
54089
54164
  formatOptions,
54090
- mapSeriesDataWithLegendList(seriesData, chartJSON.legendList),
54165
+ mapSeriesDataWithLegendList(
54166
+ seriesData,
54167
+ chartJSON.legendList,
54168
+ IsadvanceanalyticsChart,
54169
+ formatOptions
54170
+ ),
54091
54171
  chartId,
54092
54172
  staticLegendShape.rectangle,
54093
54173
  chartType
54094
54174
  );
54095
54175
  };
54096
- const mapSeriesDataWithLegendList = (seriesData2, legendList) => {
54097
- return seriesData2.map((series, index2) => ({
54098
- ...series,
54099
- properties: legendList[index2] ? { ...legendList[index2] } : {}
54100
- })).filter(
54176
+ const mapSeriesDataWithLegendList = (seriesData2, legendList, IsadvanceanalyticsChart2, formatOptions2) => {
54177
+ return seriesData2.map((series, index2) => {
54178
+ const legend = legendList[index2];
54179
+ if (!legend) return { ...series, properties: {} };
54180
+ let updatedAlias = legend.alias;
54181
+ if (IsadvanceanalyticsChart2 && legend.alias) {
54182
+ updatedAlias = legend.alias.split(" - ")[0].trim();
54183
+ }
54184
+ let updatedColor = legend.color;
54185
+ if (IsadvanceanalyticsChart2 && updatedAlias) {
54186
+ if (updatedAlias.includes("+ve")) {
54187
+ updatedColor = formatOptions2.plotArea.plotAreaCalculatedHigh;
54188
+ } else if (updatedAlias.includes("-ve")) {
54189
+ updatedColor = formatOptions2.plotArea.plotAreaCalculatedLow;
54190
+ }
54191
+ }
54192
+ return {
54193
+ ...series,
54194
+ properties: {
54195
+ ...legend,
54196
+ alias: updatedAlias,
54197
+ color: updatedColor
54198
+ }
54199
+ };
54200
+ }).filter(
54101
54201
  (series) => series.properties && Object.keys(series.properties).length > 0
54102
54202
  );
54103
54203
  };
54104
54204
  const preProcessChartData = () => {
54105
- const firstMeasure = seriesData[0]?.properties.currentMeasure;
54106
- let yMaxLeft = 0;
54107
- let yMaxRight = -Infinity;
54108
- const processedSeriesData = seriesData.map((series) => {
54109
- const isFirstMeasure = series.properties.currentMeasure === firstMeasure;
54110
- const newData = series.data.map((point2) => {
54111
- const newValue = isFirstMeasure ? -Math.abs(point2.value) : Math.abs(point2.value);
54205
+ let processedSeriesData;
54206
+ if (!IsadvanceanalyticsChart) {
54207
+ const firstMeasure = seriesData[0]?.properties.currentMeasure;
54208
+ let yMaxLeft = 0;
54209
+ let yMaxRight = -Infinity;
54210
+ processedSeriesData = seriesData.map((series) => {
54211
+ const isFirstMeasure = series.properties.currentMeasure === firstMeasure;
54212
+ const newData = series.data.map((point2) => {
54213
+ const newValue = isFirstMeasure ? -Math.abs(point2.value) : Math.abs(point2.value);
54214
+ return {
54215
+ ...point2,
54216
+ value: newValue
54217
+ };
54218
+ });
54219
+ const values = newData.map((d) => d.value);
54220
+ if (isFirstMeasure) yMaxLeft = Math.min(yMaxLeft, Math.min(...values));
54221
+ else yMaxRight = Math.max(yMaxRight, Math.max(...values));
54112
54222
  return {
54113
- ...point2,
54114
- value: newValue
54223
+ ...series,
54224
+ data: newData
54115
54225
  };
54116
54226
  });
54117
- const values = newData.map((d) => d.value);
54118
- if (isFirstMeasure) yMaxLeft = Math.min(yMaxLeft, Math.min(...values));
54119
- else yMaxRight = Math.max(yMaxRight, Math.max(...values));
54120
- return {
54121
- ...series,
54122
- data: newData
54123
- };
54124
- });
54125
- chartJSON.chartData = processedSeriesData;
54126
- chartJSON.yMaxLeft = yMaxLeft;
54127
- chartJSON.yMaxRight = yMaxRight;
54227
+ chartJSON.chartData = processedSeriesData;
54228
+ chartJSON.yMaxLeft = yMaxLeft;
54229
+ chartJSON.yMaxRight = yMaxRight;
54230
+ } else {
54231
+ chartJSON.chartData = seriesData;
54232
+ chartJSON.yMaxLeft = Math.min(...seriesData.map((d) => d.data[0].value));
54233
+ chartJSON.yMaxRight = Math.max(...seriesData.map((d) => d.data[0].value));
54234
+ }
54128
54235
  const formatedDimensionList = isDateType ? setDateFormats(
54129
54236
  formatOptions.xAxisLabel.xAxisNumberFormat,
54130
54237
  chartJSON.dimensionList
@@ -54135,7 +54242,7 @@
54135
54242
  formatedDimensionList[i]
54136
54243
  );
54137
54244
  });
54138
- filteredData = JSON.parse(JSON.stringify(processedSeriesData));
54245
+ filteredData = JSON.parse(JSON.stringify(!IsadvanceanalyticsChart ? processedSeriesData : seriesData));
54139
54246
  filteredDimension = !formatOptions.plotArea.fitChart ? chartJSON.dimensionList.slice(
54140
54247
  scrollPosition,
54141
54248
  scrollPosition + visibleBars
@@ -54171,8 +54278,8 @@
54171
54278
  getXAxis();
54172
54279
  yAxisLeft = axisLeft(yScaleLeft).tickSize(
54173
54280
  formatOptions.plotArea.gridLinesVisibility ? formatOptions.plotArea.gridLinesHorizontal ? -(innerWidth2 - xScaleForLegends(0)) : 0 : 0
54174
- ).tickSizeOuter(0).tickValues(responsiveXaxisLabel(chartJSON.dimensionList, innerWidth2));
54175
- axisRight(yScaleLeft).tickSize(
54281
+ ).tickSizeOuter(0).tickValues(responsiveXaxisLabel(chartJSON.dimensionList, innerHeight2));
54282
+ yAxisRight = axisRight(yScaleLeft).tickSize(
54176
54283
  formatOptions.plotArea.gridLinesVisibility ? formatOptions.plotArea.gridLinesHorizontal ? -xScaleForLegends(0) : 0 : 0
54177
54284
  ).tickSizeOuter(0).tickValues(responsiveXaxisLabel(chartJSON.dimensionList, innerWidth2));
54178
54285
  };
@@ -54215,23 +54322,23 @@
54215
54322
  };
54216
54323
  const getChartType = () => {
54217
54324
  gTag.selectAll(".parentGroup").remove();
54218
- formatOptions.plotArea.plotAreaCalculatedHigh;
54219
- formatOptions.plotArea.plotAreaCalculatedLow;
54325
+ const positiveBarColor = formatOptions.plotArea.plotAreaCalculatedHigh;
54326
+ const negativeBarColor = formatOptions.plotArea.plotAreaCalculatedLow;
54220
54327
  const parent = gTag.append("g").attr("class", "parentGroup");
54221
54328
  parent.selectAll("rect").data(
54222
54329
  filteredData.flatMap(
54223
54330
  (d) => d.data.map((child) => ({
54224
54331
  ...child,
54225
- legendText: d.legend.replace("-", "~$~").split("~$~")[1].trim(),
54332
+ legendText: !IsadvanceanalyticsChart ? d.legend.replace("-", "~$~").split("~$~")[1].trim() : d.legend.split("ve) - ")[1],
54226
54333
  properties: d.properties
54227
54334
  }))
54228
54335
  )
54229
- ).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(
54336
+ ).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(
54230
54337
  "stroke",
54231
54338
  (d) => d.properties.stackBorderStyle == 0 ? "none" : formatOptions.column.stackBorderVisibility ? d.properties.stackBorderColor : "none"
54232
54339
  ).style(
54233
54340
  "fill",
54234
- (d) => d.properties.color
54341
+ (d) => IsadvanceanalyticsChart ? d.value > 0 ? positiveBarColor !== "#ffffff" ? positiveBarColor : "none" : negativeBarColor !== "#ffffff" ? negativeBarColor : "none" : d.properties.color
54235
54342
  ).on("mousemove", (event2, d) => {
54236
54343
  showTooltipOnMouseMove(
54237
54344
  [
@@ -54356,7 +54463,7 @@
54356
54463
  svg,
54357
54464
  yScaleLeft,
54358
54465
  columnWidth,
54359
- isSensitivityChart,
54466
+ IsadvanceanalyticsChart,
54360
54467
  isReportEditable,
54361
54468
  barChart
54362
54469
  );