pace-chart-lib 1.0.30 → 1.0.31

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.
@@ -417,33 +417,7 @@ export declare function setChartTitle(svg: any, formatOptions: TDefaultChartForm
417
417
  * @returns The appropriate D3 curve function based on the interpolation and smoothing settings.
418
418
  */
419
419
  export declare function getCurveType(formatOptions: TDefaultChartFormatOptionsType): d3.CurveFactory;
420
- /**
421
- * @param {TSeries[]} chartData - Array of data series for the chart.
422
- * @param {any} xScale - D3 scale function for the X axis.
423
- * @param {any} yScaleLeft - D3 scale function for the left Y axis.
424
- * @param {any} yScaleRight - D3 scale function for the right Y axis.
425
- * @param {TMargin} margin - Margin object defining chart margins.
426
- * @param {any} d3Annotation - D3 annotation library or object.
427
- * @param {string[]} labelExcludeList - List of labels to exclude from annotations.
428
- * @param {any[]} individualLabelColor - Array of colors for individual labels.
429
- * @param {any[]} oldAnnotationList - List of existing annotations to update or remove.
430
- * @param {TDefaultChartFormatOptionsType} formatOptions - Formatting options for the chart.
431
- * @param {string} chartType - Type of the chart (e.g., "line", "area").
432
- * @param {number} height - Total height of the SVG container.
433
- * @param {number} width - Total width of the SVG container.
434
- * @param {number} innerWidth - Inner width of the chart area.
435
- * @param {string[]} dimensionList - List of dimensions present in the chart data.
436
- * @param {number} innerHeight - Inner height of the chart area.
437
- * @param {string} widgetId - Unique identifier for the widget/chart instance.
438
- * @param {any} svg - D3 selection of the SVG element to render annotations.
439
- * @param {any} xScaleForLegends - D3 scale function for the X axis for legends.
440
- * @param {number} columnWidth - Column width for the chart.
441
- * @param {boolean} isSensitivityChart - Flag indicating if the chart is a sensitivity chart.
442
- * @param {boolean} barChart - Flag indicating if the chart is a barChart chart.
443
- *
444
- * @return {void} - This function does not return a value; it updates the SVG with annotations.
445
- */
446
- export declare function commonAnnotations(chartData: TSeries[], xScale: any, yScaleLeft: any, yScaleRight: any, margin: TMargin, d3Annotation: any, labelExcludeList: string[], individualLabelColor: any[], oldAnnotationList: any[], formatOptions: TDefaultChartFormatOptionsType, chartType: string, height: number, width: number, innerWidth: number, dimensionList: string[], innerHeight: number, widgetId: string, svg: any, xScaleForLegends?: any, columnWidth?: number, isReportEditable?: boolean, isSensitivityChart?: boolean, barChart?: boolean): void;
420
+ export declare function commonAnnotations(chartData: TSeries[], xScale: any, yScaleLeft: any, yScaleRight: any, margin: TMargin, d3Annotation: any, labelExcludeList: string[], individualLabelColor: any[], oldAnnotationList: any[], formatOptions: TDefaultChartFormatOptionsType, chartType: string, height: number, width: number, innerWidth: number, dimensionList: string[], innerHeight: number, widgetId: string, svg: any, xScaleForLegends?: any, columnWidth?: number, isReportEditable?: boolean, isSensitivityChart?: boolean, barChart?: boolean, isAATornado?: boolean): void;
447
421
  /**
448
422
  * @param {Array} chartData - The main data used to render the chart.
449
423
  * @param {Function} xscale - D3 scale function for the x-axis.
@@ -53,6 +53,7 @@ export type TChartProps = {
53
53
  chartId?: string;
54
54
  formatOptions?: TDefaultChartFormatOptionsType;
55
55
  isReportEditable?: any;
56
+ isAdvancedAnalyticsWaterFall?: boolean;
56
57
  };
57
58
  export type TChartJSON = {
58
59
  dimensionList: string[];
@@ -12838,8 +12838,15 @@ function setChartTitle(svg, formatOptions, width, chartTitleHeight) {
12838
12838
  "visibility",
12839
12839
  formatOptions.chartTitle.chartTitleVisibility ? "visible" : "hidden"
12840
12840
  ).attr("transform", `translate(2,2)`).attr("class", "chartTitle").attr("width", width).attr("height", chartTitleHeight + "px");
12841
+ const parseHTMLText = (html) => {
12842
+ const temp = document.createElement("div");
12843
+ temp.innerHTML = html;
12844
+ return temp.textContent || temp.innerText || "";
12845
+ };
12846
+ const hasHTML = !!formatOptions.chartTitle.chartTitleHTML;
12847
+ const titleText = hasHTML ? parseHTMLText(formatOptions.chartTitle.chartTitleHTML) : formatOptions.chartTitle.chartTitleText;
12841
12848
  if (formatOptions.chartTitle.dynamicTitleText.length !== 0) {
12842
- object2.append("xhtml:div").style("color", "rgba(119,119,119)").attr("title", formatOptions.chartTitle.chartTitleText).style("white-space", "pre").style("text-overflow", "ellipsis").html(
12849
+ object2.append("xhtml:div").style("color", "rgba(119,119,119)").attr("title", titleText).style("white-space", "pre").style("text-overflow", "ellipsis").html(
12843
12850
  formatOptions.chartTitle.chartTitleHTML ? formatOptions.chartTitle.chartTitleHTML : formatOptions.chartTitle.chartTitleText
12844
12851
  );
12845
12852
  } else {
@@ -12866,7 +12873,8 @@ function getSlicedLegendForTornado(legend) {
12866
12873
  if (index2 == -1) return legend;
12867
12874
  return legend.slice(index2 + 3);
12868
12875
  }
12869
- function commonAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin, d3Annotation2, labelExcludeList, individualLabelColor, oldAnnotationList, formatOptions, chartType, height, width, innerWidth2, dimensionList, innerHeight2, widgetId, svg, xScaleForLegends, columnWidth, isReportEditable, isSensitivityChart, barChart) {
12876
+ const getHoverText = (d, isAATornado) => isAATornado ? d?.legend?.split(" - ")[0] : d?.properties?.alias || d?.properties?.name || "Legend";
12877
+ function commonAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin, d3Annotation2, labelExcludeList, individualLabelColor, oldAnnotationList, formatOptions, chartType, height, width, innerWidth2, dimensionList, innerHeight2, widgetId, svg, xScaleForLegends, columnWidth, isReportEditable, isSensitivityChart, barChart, isAATornado) {
12870
12878
  try {
12871
12879
  const isTornadoChart = chartType === chartTypes.TornadoChart;
12872
12880
  let annotationType = formatOptions.annotation.annotationType ?? "1";
@@ -12906,6 +12914,7 @@ function commonAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin, d
12906
12914
  Legend: d.data[0].legend,
12907
12915
  LabelPosition: annotationPosition ? annotationPosition : d.properties.annotationPosition,
12908
12916
  Labelcolor: d.properties[dataLabelColor],
12917
+ hoverText: getHoverText(d, isAATornado),
12909
12918
  Axis: d.properties.axis
12910
12919
  });
12911
12920
  }
@@ -12921,6 +12930,7 @@ function commonAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin, d
12921
12930
  Legend: d.data[d.data.length - 1].legend,
12922
12931
  LabelPosition: annotationPosition ? annotationPosition : d.properties.annotationPosition,
12923
12932
  Labelcolor: d.properties[dataLabelColor],
12933
+ hoverText: getHoverText(d, isAATornado),
12924
12934
  Axis: d.properties.axis
12925
12935
  });
12926
12936
  }
@@ -12937,6 +12947,7 @@ function commonAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin, d
12937
12947
  Legend: d.data[0].legend,
12938
12948
  LabelPosition: annotationPosition ? annotationPosition : d.properties.annotationPosition,
12939
12949
  Labelcolor: d.properties[dataLabelColor],
12950
+ hoverText: getHoverText(d, isAATornado),
12940
12951
  Axis: d.properties.axis
12941
12952
  });
12942
12953
  }
@@ -12950,6 +12961,7 @@ function commonAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin, d
12950
12961
  Legend: d.data[d.data.length - 1].legend,
12951
12962
  LabelPosition: annotationPosition ? annotationPosition : d.properties.annotationPosition,
12952
12963
  Labelcolor: d.properties[dataLabelColor],
12964
+ hoverText: getHoverText(d, isAATornado),
12953
12965
  Axis: d.properties.axis
12954
12966
  });
12955
12967
  }
@@ -12966,6 +12978,7 @@ function commonAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin, d
12966
12978
  Legend: d.data[i].legend,
12967
12979
  LabelPosition: annotationPosition ? annotationPosition : d.properties.annotationPosition,
12968
12980
  Labelcolor: d.properties[dataLabelColor],
12981
+ hoverText: getHoverText(d, isAATornado),
12969
12982
  Axis: d.properties.axis
12970
12983
  });
12971
12984
  }
@@ -12988,6 +13001,7 @@ function commonAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin, d
12988
13001
  Legend: d.data[i].legend,
12989
13002
  LabelPosition: annotationPosition ? annotationPosition : d.properties.annotationPosition,
12990
13003
  Labelcolor: d.properties[dataLabelColor],
13004
+ hoverText: getHoverText(d, isAATornado),
12991
13005
  Axis: d.properties.axis
12992
13006
  });
12993
13007
  }
@@ -13003,6 +13017,7 @@ function commonAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin, d
13003
13017
  Legend: d.data[0].legend,
13004
13018
  LabelPosition: annotationPosition ? annotationPosition : d.properties.annotationPosition,
13005
13019
  Labelcolor: d.properties[dataLabelColor],
13020
+ hoverText: getHoverText(d, isAATornado),
13006
13021
  Axis: d.properties.axis
13007
13022
  });
13008
13023
  break;
@@ -13014,6 +13029,7 @@ function commonAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin, d
13014
13029
  Legend: d.data[d.data.length - 1].legend,
13015
13030
  LabelPosition: annotationPosition ? annotationPosition : d.properties.annotationPosition,
13016
13031
  Labelcolor: d.properties[dataLabelColor],
13032
+ hoverText: getHoverText(d, isAATornado),
13017
13033
  Axis: d.properties.axis
13018
13034
  });
13019
13035
  break;
@@ -13025,6 +13041,7 @@ function commonAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin, d
13025
13041
  Legend: d.data[0].legend,
13026
13042
  LabelPosition: annotationPosition ? annotationPosition : d.properties.annotationPosition,
13027
13043
  Labelcolor: d.properties[dataLabelColor],
13044
+ hoverText: getHoverText(d, isAATornado),
13028
13045
  Axis: d.properties.axis
13029
13046
  });
13030
13047
  if (d.data[d.data.length - 1])
@@ -13034,6 +13051,7 @@ function commonAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin, d
13034
13051
  Legend: d.data[d.data.length - 1].legend,
13035
13052
  LabelPosition: annotationPosition ? annotationPosition : d.properties.annotationPosition,
13036
13053
  Labelcolor: d.properties[dataLabelColor],
13054
+ hoverText: getHoverText(d, isAATornado),
13037
13055
  Axis: d.properties.axis
13038
13056
  });
13039
13057
  break;
@@ -13065,7 +13083,8 @@ function commonAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin, d
13065
13083
  position: parseInt(d.LabelPosition),
13066
13084
  currentLegend: d.Legend,
13067
13085
  //d.Legend.replaceAll(" ", "-"), need to check for this case by space replaced with -
13068
- isVisible: true
13086
+ isVisible: true,
13087
+ hoverId: d.hoverText.replace(/\s+/g, "-")
13069
13088
  } : {
13070
13089
  x: d.Dimension,
13071
13090
  y: { measure: d.Measure, axis: d.Axis },
@@ -13091,7 +13110,7 @@ function commonAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin, d
13091
13110
  };
13092
13111
  if (barChart) {
13093
13112
  let requiredXScale = d.Axis === axisTypes.primary ? yScaleLeft : yScaleRight;
13094
- (responsiveXaxisLabel(dimensionList, innerWidth2).includes(d.Dimension) || chartType === chartTypes.TornadoChart) && !labelExcludeList.includes(d.Legend) && requiredXScale(d.Measure) <= innerWidth2 && requiredXScale(d.Measure) >= 0 ? annotationsList.push(singleAnnotation) : null;
13113
+ (responsiveXaxisLabel(dimensionList, innerHeight2).includes(d.Dimension) || chartType === chartTypes.TornadoChart) && !labelExcludeList.includes(d.Legend) && requiredXScale(d.Measure) <= innerWidth2 && requiredXScale(d.Measure) >= 0 ? annotationsList.push(singleAnnotation) : null;
13095
13114
  } else {
13096
13115
  responsiveXaxisLabel(dimensionList, innerWidth2).includes(d.Dimension) && !labelExcludeList.includes(d.Legend) && (d.Axis == axisTypes.primary ? yScaleLeft(d.Measure) <= innerHeight2 && yScaleLeft(d.Measure) >= 0 : yScaleRight(d.Measure) <= innerHeight2 && yScaleRight(d.Measure) >= 0) ? annotationsList.push(singleAnnotation) : null;
13097
13116
  }
@@ -14619,6 +14638,7 @@ function stacklineAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin
14619
14638
  let makeAnnotations = d3Annotation2.annotation();
14620
14639
  let connector = formatOptions.annotation.connectorType;
14621
14640
  let labelType = formatOptions.annotation.annotationVisibility;
14641
+ let dataLabelColor = formatOptions?.annotation?.annotationSetLabelColor == "2" ? "color" : "labelColor";
14622
14642
  let fontStyle = formatOptions.annotation.annotationFontStyle;
14623
14643
  let connectorType = formatOptions.annotation.connectorType ? formatOptions.annotation.connectorType.toLowerCase() : "None";
14624
14644
  oldAnnotationList = conditionallyResetOldAnnotations(oldAnnotationList, formatOptions, chartType);
@@ -14726,7 +14746,7 @@ function stacklineAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin
14726
14746
  height: 15,
14727
14747
  width: 15
14728
14748
  },
14729
- color: d.properties.labelColor,
14749
+ color: d.properties[dataLabelColor],
14730
14750
  type: annotationTypeforCharts(d3Annotation2, parseFloat(annotationType)),
14731
14751
  height,
14732
14752
  width
@@ -14864,7 +14884,7 @@ const initXaxisBar = (formatOptions, gTag, yLabel, innerHeight2, innerWidth2, xA
14864
14884
  formatOptions.yAxisLabel.yAxisLabelVisibility ? "visible" : "hidden"
14865
14885
  ).style("shape-rendering", "crispEdges").style(
14866
14886
  "stroke",
14867
- formatOptions.yAxisLabel.yAxisColorInverted
14887
+ formatOptions.yAxisLabel.yAxisColor
14868
14888
  ).attr("stroke-width", formatOptions.yAxisLabel.yAxisWidth ? formatOptions.yAxisLabel.yAxisWidth : formatOptions.plotArea.plotAreaBorderThickness);
14869
14889
  } catch (error) {
14870
14890
  throw error;
@@ -14937,9 +14957,12 @@ const initYaxisBar = (formatOptions, gTag, xLabel, innerHeight2, innerWidth2, yA
14937
14957
  "visibility",
14938
14958
  formatOptions.yAxisLabel.yAxisLabelVisibility ? "visible" : formatOptions.plotArea.gridLinesVertical ? "visible" : "hidden"
14939
14959
  );
14940
- YaxisG.select(".domain").style("shape-rendering", "crispEdges").style(
14960
+ YaxisG.select(".domain").style("shape-rendering", "crispEdges").attr(
14961
+ "stroke-width",
14962
+ formatOptions.xAxisLabel.xAxisWidth ?? formatOptions.plotArea.plotAreaBorderThickness
14963
+ ).style(
14941
14964
  "stroke",
14942
- formatOptions.xAxisLabel.xAxisColorInverted
14965
+ formatOptions.xAxisLabel.xAxisColor
14943
14966
  );
14944
14967
  } catch (e) {
14945
14968
  throw e;
@@ -21358,7 +21381,7 @@ const LineChart = ({
21358
21381
  xAxis,
21359
21382
  dimensionHeightWidthArray,
21360
21383
  height,
21361
- barWidth,
21384
+ innerWidth2 / xScale.length,
21362
21385
  isDateType,
21363
21386
  innerWidth2,
21364
21387
  innerHeight2,
@@ -22987,6 +23010,9 @@ const HorizontalBarChart = ({
22987
23010
  filteredDimension = fDimension;
22988
23011
  visibleBars = fVisibleBars;
22989
23012
  createTotalMeasureValueMap(data, totalValueMap, filteredDimension);
23013
+ if (formatOptions.xAxisLabel.hideZeroValues) {
23014
+ filteredDimension = filteredDimension.filter((d) => totalValueMap.get(d) !== 0);
23015
+ }
22990
23016
  drawColumnChart();
22991
23017
  };
22992
23018
  const drawColumnChart = () => {
@@ -53977,14 +54003,15 @@ const ScatterChart = ({
53977
54003
  const WaterfallChart = ({
53978
54004
  isDateType,
53979
54005
  formatOptions,
53980
- data
54006
+ data,
54007
+ isAdvancedAnalyticsWaterFall = false
53981
54008
  }) => {
53982
54009
  const chartId = crypto.randomUUID?.();
53983
54010
  let columnWidth = 0;
53984
54011
  let colorScale;
53985
54012
  const chartType = chartTypes.WaterfallChart;
53986
54013
  const svgRef = useRef();
53987
- const isAdvancedWaterfall = Array.isArray(data) && data.length > 0 && data[0]?.hasOwnProperty("Column1") && data[0]?.hasOwnProperty("Column6");
54014
+ const isAdvancedWaterfall = isAdvancedAnalyticsWaterFall ?? false;
53988
54015
  const seriesData = isAdvancedWaterfall ? [] : generalizedChartData(data.ChartData, data.DimensionList);
53989
54016
  const dimensionList = data.DimensionList;
53990
54017
  const barChart = false;
@@ -54640,13 +54667,14 @@ const WaterfallChart = ({
54640
54667
  };
54641
54668
  const toNumber = (v) => v === null || v === void 0 || v === "" ? 0 : Number(v);
54642
54669
  const mapAdvancedWaterfallData = (rawData) => {
54643
- return rawData.filter((d) => d.Column1 && d.Column1 !== "*").map((d) => ({
54644
- xKey: d.Column1,
54645
- base: toNumber(d.Column3),
54646
- up: toNumber(d.Column4),
54647
- down: toNumber(d.Column5),
54648
- total: toNumber(d.Column6),
54649
- dimensionTotal: toNumber(d.Column2)
54670
+ const tempRawDataForAAWaterfallChart = rawData[0].Column1 == "" ? rawData.filter((d) => d.Column1 && d.Column1 !== "*") : rawData;
54671
+ return tempRawDataForAAWaterfallChart.map((d) => ({
54672
+ xKey: d.Column1 || (d.Dimension || d.Legend),
54673
+ base: toNumber(d.Column3 || d.Total),
54674
+ up: toNumber(d.Column4 || d.Up),
54675
+ down: toNumber(d.Column5 || d.Down),
54676
+ total: toNumber(d.Column6 || d.total),
54677
+ dimensionTotal: toNumber(d.Column2 || d.Base)
54650
54678
  }));
54651
54679
  };
54652
54680
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -55201,7 +55229,8 @@ const TornadoChart = ({
55201
55229
  columnWidth,
55202
55230
  isReportEditable,
55203
55231
  isAdvanceAnalyticsChart,
55204
- barChart
55232
+ barChart,
55233
+ isAdvanceAnalyticsChart
55205
55234
  );
55206
55235
  };
55207
55236
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -12841,8 +12841,15 @@
12841
12841
  "visibility",
12842
12842
  formatOptions.chartTitle.chartTitleVisibility ? "visible" : "hidden"
12843
12843
  ).attr("transform", `translate(2,2)`).attr("class", "chartTitle").attr("width", width).attr("height", chartTitleHeight + "px");
12844
+ const parseHTMLText = (html) => {
12845
+ const temp = document.createElement("div");
12846
+ temp.innerHTML = html;
12847
+ return temp.textContent || temp.innerText || "";
12848
+ };
12849
+ const hasHTML = !!formatOptions.chartTitle.chartTitleHTML;
12850
+ const titleText = hasHTML ? parseHTMLText(formatOptions.chartTitle.chartTitleHTML) : formatOptions.chartTitle.chartTitleText;
12844
12851
  if (formatOptions.chartTitle.dynamicTitleText.length !== 0) {
12845
- object2.append("xhtml:div").style("color", "rgba(119,119,119)").attr("title", formatOptions.chartTitle.chartTitleText).style("white-space", "pre").style("text-overflow", "ellipsis").html(
12852
+ object2.append("xhtml:div").style("color", "rgba(119,119,119)").attr("title", titleText).style("white-space", "pre").style("text-overflow", "ellipsis").html(
12846
12853
  formatOptions.chartTitle.chartTitleHTML ? formatOptions.chartTitle.chartTitleHTML : formatOptions.chartTitle.chartTitleText
12847
12854
  );
12848
12855
  } else {
@@ -12869,7 +12876,8 @@
12869
12876
  if (index2 == -1) return legend;
12870
12877
  return legend.slice(index2 + 3);
12871
12878
  }
12872
- function commonAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin, d3Annotation2, labelExcludeList, individualLabelColor, oldAnnotationList, formatOptions, chartType, height, width, innerWidth2, dimensionList, innerHeight2, widgetId, svg, xScaleForLegends, columnWidth, isReportEditable, isSensitivityChart, barChart) {
12879
+ const getHoverText = (d, isAATornado) => isAATornado ? d?.legend?.split(" - ")[0] : d?.properties?.alias || d?.properties?.name || "Legend";
12880
+ function commonAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin, d3Annotation2, labelExcludeList, individualLabelColor, oldAnnotationList, formatOptions, chartType, height, width, innerWidth2, dimensionList, innerHeight2, widgetId, svg, xScaleForLegends, columnWidth, isReportEditable, isSensitivityChart, barChart, isAATornado) {
12873
12881
  try {
12874
12882
  const isTornadoChart = chartType === chartTypes.TornadoChart;
12875
12883
  let annotationType = formatOptions.annotation.annotationType ?? "1";
@@ -12909,6 +12917,7 @@
12909
12917
  Legend: d.data[0].legend,
12910
12918
  LabelPosition: annotationPosition ? annotationPosition : d.properties.annotationPosition,
12911
12919
  Labelcolor: d.properties[dataLabelColor],
12920
+ hoverText: getHoverText(d, isAATornado),
12912
12921
  Axis: d.properties.axis
12913
12922
  });
12914
12923
  }
@@ -12924,6 +12933,7 @@
12924
12933
  Legend: d.data[d.data.length - 1].legend,
12925
12934
  LabelPosition: annotationPosition ? annotationPosition : d.properties.annotationPosition,
12926
12935
  Labelcolor: d.properties[dataLabelColor],
12936
+ hoverText: getHoverText(d, isAATornado),
12927
12937
  Axis: d.properties.axis
12928
12938
  });
12929
12939
  }
@@ -12940,6 +12950,7 @@
12940
12950
  Legend: d.data[0].legend,
12941
12951
  LabelPosition: annotationPosition ? annotationPosition : d.properties.annotationPosition,
12942
12952
  Labelcolor: d.properties[dataLabelColor],
12953
+ hoverText: getHoverText(d, isAATornado),
12943
12954
  Axis: d.properties.axis
12944
12955
  });
12945
12956
  }
@@ -12953,6 +12964,7 @@
12953
12964
  Legend: d.data[d.data.length - 1].legend,
12954
12965
  LabelPosition: annotationPosition ? annotationPosition : d.properties.annotationPosition,
12955
12966
  Labelcolor: d.properties[dataLabelColor],
12967
+ hoverText: getHoverText(d, isAATornado),
12956
12968
  Axis: d.properties.axis
12957
12969
  });
12958
12970
  }
@@ -12969,6 +12981,7 @@
12969
12981
  Legend: d.data[i].legend,
12970
12982
  LabelPosition: annotationPosition ? annotationPosition : d.properties.annotationPosition,
12971
12983
  Labelcolor: d.properties[dataLabelColor],
12984
+ hoverText: getHoverText(d, isAATornado),
12972
12985
  Axis: d.properties.axis
12973
12986
  });
12974
12987
  }
@@ -12991,6 +13004,7 @@
12991
13004
  Legend: d.data[i].legend,
12992
13005
  LabelPosition: annotationPosition ? annotationPosition : d.properties.annotationPosition,
12993
13006
  Labelcolor: d.properties[dataLabelColor],
13007
+ hoverText: getHoverText(d, isAATornado),
12994
13008
  Axis: d.properties.axis
12995
13009
  });
12996
13010
  }
@@ -13006,6 +13020,7 @@
13006
13020
  Legend: d.data[0].legend,
13007
13021
  LabelPosition: annotationPosition ? annotationPosition : d.properties.annotationPosition,
13008
13022
  Labelcolor: d.properties[dataLabelColor],
13023
+ hoverText: getHoverText(d, isAATornado),
13009
13024
  Axis: d.properties.axis
13010
13025
  });
13011
13026
  break;
@@ -13017,6 +13032,7 @@
13017
13032
  Legend: d.data[d.data.length - 1].legend,
13018
13033
  LabelPosition: annotationPosition ? annotationPosition : d.properties.annotationPosition,
13019
13034
  Labelcolor: d.properties[dataLabelColor],
13035
+ hoverText: getHoverText(d, isAATornado),
13020
13036
  Axis: d.properties.axis
13021
13037
  });
13022
13038
  break;
@@ -13028,6 +13044,7 @@
13028
13044
  Legend: d.data[0].legend,
13029
13045
  LabelPosition: annotationPosition ? annotationPosition : d.properties.annotationPosition,
13030
13046
  Labelcolor: d.properties[dataLabelColor],
13047
+ hoverText: getHoverText(d, isAATornado),
13031
13048
  Axis: d.properties.axis
13032
13049
  });
13033
13050
  if (d.data[d.data.length - 1])
@@ -13037,6 +13054,7 @@
13037
13054
  Legend: d.data[d.data.length - 1].legend,
13038
13055
  LabelPosition: annotationPosition ? annotationPosition : d.properties.annotationPosition,
13039
13056
  Labelcolor: d.properties[dataLabelColor],
13057
+ hoverText: getHoverText(d, isAATornado),
13040
13058
  Axis: d.properties.axis
13041
13059
  });
13042
13060
  break;
@@ -13068,7 +13086,8 @@
13068
13086
  position: parseInt(d.LabelPosition),
13069
13087
  currentLegend: d.Legend,
13070
13088
  //d.Legend.replaceAll(" ", "-"), need to check for this case by space replaced with -
13071
- isVisible: true
13089
+ isVisible: true,
13090
+ hoverId: d.hoverText.replace(/\s+/g, "-")
13072
13091
  } : {
13073
13092
  x: d.Dimension,
13074
13093
  y: { measure: d.Measure, axis: d.Axis },
@@ -13094,7 +13113,7 @@
13094
13113
  };
13095
13114
  if (barChart) {
13096
13115
  let requiredXScale = d.Axis === axisTypes.primary ? yScaleLeft : yScaleRight;
13097
- (responsiveXaxisLabel(dimensionList, innerWidth2).includes(d.Dimension) || chartType === chartTypes.TornadoChart) && !labelExcludeList.includes(d.Legend) && requiredXScale(d.Measure) <= innerWidth2 && requiredXScale(d.Measure) >= 0 ? annotationsList.push(singleAnnotation) : null;
13116
+ (responsiveXaxisLabel(dimensionList, innerHeight2).includes(d.Dimension) || chartType === chartTypes.TornadoChart) && !labelExcludeList.includes(d.Legend) && requiredXScale(d.Measure) <= innerWidth2 && requiredXScale(d.Measure) >= 0 ? annotationsList.push(singleAnnotation) : null;
13098
13117
  } else {
13099
13118
  responsiveXaxisLabel(dimensionList, innerWidth2).includes(d.Dimension) && !labelExcludeList.includes(d.Legend) && (d.Axis == axisTypes.primary ? yScaleLeft(d.Measure) <= innerHeight2 && yScaleLeft(d.Measure) >= 0 : yScaleRight(d.Measure) <= innerHeight2 && yScaleRight(d.Measure) >= 0) ? annotationsList.push(singleAnnotation) : null;
13100
13119
  }
@@ -14622,6 +14641,7 @@
14622
14641
  let makeAnnotations = d3Annotation2.annotation();
14623
14642
  let connector = formatOptions.annotation.connectorType;
14624
14643
  let labelType = formatOptions.annotation.annotationVisibility;
14644
+ let dataLabelColor = formatOptions?.annotation?.annotationSetLabelColor == "2" ? "color" : "labelColor";
14625
14645
  let fontStyle = formatOptions.annotation.annotationFontStyle;
14626
14646
  let connectorType = formatOptions.annotation.connectorType ? formatOptions.annotation.connectorType.toLowerCase() : "None";
14627
14647
  oldAnnotationList = conditionallyResetOldAnnotations(oldAnnotationList, formatOptions, chartType);
@@ -14729,7 +14749,7 @@
14729
14749
  height: 15,
14730
14750
  width: 15
14731
14751
  },
14732
- color: d.properties.labelColor,
14752
+ color: d.properties[dataLabelColor],
14733
14753
  type: annotationTypeforCharts(d3Annotation2, parseFloat(annotationType)),
14734
14754
  height,
14735
14755
  width
@@ -14867,7 +14887,7 @@
14867
14887
  formatOptions.yAxisLabel.yAxisLabelVisibility ? "visible" : "hidden"
14868
14888
  ).style("shape-rendering", "crispEdges").style(
14869
14889
  "stroke",
14870
- formatOptions.yAxisLabel.yAxisColorInverted
14890
+ formatOptions.yAxisLabel.yAxisColor
14871
14891
  ).attr("stroke-width", formatOptions.yAxisLabel.yAxisWidth ? formatOptions.yAxisLabel.yAxisWidth : formatOptions.plotArea.plotAreaBorderThickness);
14872
14892
  } catch (error) {
14873
14893
  throw error;
@@ -14940,9 +14960,12 @@
14940
14960
  "visibility",
14941
14961
  formatOptions.yAxisLabel.yAxisLabelVisibility ? "visible" : formatOptions.plotArea.gridLinesVertical ? "visible" : "hidden"
14942
14962
  );
14943
- YaxisG.select(".domain").style("shape-rendering", "crispEdges").style(
14963
+ YaxisG.select(".domain").style("shape-rendering", "crispEdges").attr(
14964
+ "stroke-width",
14965
+ formatOptions.xAxisLabel.xAxisWidth ?? formatOptions.plotArea.plotAreaBorderThickness
14966
+ ).style(
14944
14967
  "stroke",
14945
- formatOptions.xAxisLabel.xAxisColorInverted
14968
+ formatOptions.xAxisLabel.xAxisColor
14946
14969
  );
14947
14970
  } catch (e) {
14948
14971
  throw e;
@@ -21361,7 +21384,7 @@
21361
21384
  xAxis,
21362
21385
  dimensionHeightWidthArray,
21363
21386
  height,
21364
- barWidth,
21387
+ innerWidth2 / xScale.length,
21365
21388
  isDateType,
21366
21389
  innerWidth2,
21367
21390
  innerHeight2,
@@ -22990,6 +23013,9 @@
22990
23013
  filteredDimension = fDimension;
22991
23014
  visibleBars = fVisibleBars;
22992
23015
  createTotalMeasureValueMap(data, totalValueMap, filteredDimension);
23016
+ if (formatOptions.xAxisLabel.hideZeroValues) {
23017
+ filteredDimension = filteredDimension.filter((d) => totalValueMap.get(d) !== 0);
23018
+ }
22993
23019
  drawColumnChart();
22994
23020
  };
22995
23021
  const drawColumnChart = () => {
@@ -53980,14 +54006,15 @@
53980
54006
  const WaterfallChart = ({
53981
54007
  isDateType,
53982
54008
  formatOptions,
53983
- data
54009
+ data,
54010
+ isAdvancedAnalyticsWaterFall = false
53984
54011
  }) => {
53985
54012
  const chartId = crypto.randomUUID?.();
53986
54013
  let columnWidth = 0;
53987
54014
  let colorScale;
53988
54015
  const chartType = chartTypes.WaterfallChart;
53989
54016
  const svgRef = require$$0$1.useRef();
53990
- const isAdvancedWaterfall = Array.isArray(data) && data.length > 0 && data[0]?.hasOwnProperty("Column1") && data[0]?.hasOwnProperty("Column6");
54017
+ const isAdvancedWaterfall = isAdvancedAnalyticsWaterFall ?? false;
53991
54018
  const seriesData = isAdvancedWaterfall ? [] : generalizedChartData(data.ChartData, data.DimensionList);
53992
54019
  const dimensionList = data.DimensionList;
53993
54020
  const barChart = false;
@@ -54643,13 +54670,14 @@
54643
54670
  };
54644
54671
  const toNumber = (v) => v === null || v === void 0 || v === "" ? 0 : Number(v);
54645
54672
  const mapAdvancedWaterfallData = (rawData) => {
54646
- return rawData.filter((d) => d.Column1 && d.Column1 !== "*").map((d) => ({
54647
- xKey: d.Column1,
54648
- base: toNumber(d.Column3),
54649
- up: toNumber(d.Column4),
54650
- down: toNumber(d.Column5),
54651
- total: toNumber(d.Column6),
54652
- dimensionTotal: toNumber(d.Column2)
54673
+ const tempRawDataForAAWaterfallChart = rawData[0].Column1 == "" ? rawData.filter((d) => d.Column1 && d.Column1 !== "*") : rawData;
54674
+ return tempRawDataForAAWaterfallChart.map((d) => ({
54675
+ xKey: d.Column1 || (d.Dimension || d.Legend),
54676
+ base: toNumber(d.Column3 || d.Total),
54677
+ up: toNumber(d.Column4 || d.Up),
54678
+ down: toNumber(d.Column5 || d.Down),
54679
+ total: toNumber(d.Column6 || d.total),
54680
+ dimensionTotal: toNumber(d.Column2 || d.Base)
54653
54681
  }));
54654
54682
  };
54655
54683
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -55204,7 +55232,8 @@
55204
55232
  columnWidth,
55205
55233
  isReportEditable,
55206
55234
  isAdvanceAnalyticsChart,
55207
- barChart
55235
+ barChart,
55236
+ isAdvanceAnalyticsChart
55208
55237
  );
55209
55238
  };
55210
55239
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pace-chart-lib",
3
- "version": "1.0.30",
3
+ "version": "1.0.31",
4
4
  "description": "A simple React + Vite + TS UI library with a Button using custom fonts via SCSS.",
5
5
  "license": "MIT",
6
6
  "type": "module",