pace-chart-lib 1.0.28 → 1.0.29

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.
@@ -17125,6 +17125,7 @@ const CustomColumnChart = ({
17125
17125
  let yAxisLeft;
17126
17126
  let xAxis;
17127
17127
  let yAxisRight;
17128
+ let totalValueMap = /* @__PURE__ */ new Map();
17128
17129
  let filteredDimension;
17129
17130
  let filteredData = [];
17130
17131
  let requiredData = [];
@@ -17686,7 +17687,7 @@ const CustomColumnChart = ({
17686
17687
  ).append("path").attr("class", "line").attr("fill", "none");
17687
17688
  lineGroupsEnter.merge(lineGroups).select("path").attr("d", (d) => lineGenerator(d.data)).attr(
17688
17689
  "stroke",
17689
- (d) => d.properties !== commonColors.white ? d.properties.color : "none"
17690
+ (d) => d.properties.color !== commonColors.white ? d.properties.color : "none"
17690
17691
  ).attr("stroke-dasharray", (d) => {
17691
17692
  switch (d.properties.lineStyle) {
17692
17693
  case staticLineStyle.dotted:
@@ -17932,6 +17933,7 @@ const CustomColumnChart = ({
17932
17933
  filteredData = fData;
17933
17934
  filteredDimension = fDimension;
17934
17935
  visibleBars = fVisibleBars;
17936
+ createTotalMeasureValueMapForCustomColumChart(data, totalValueMap, filteredDimension);
17935
17937
  checkAndupdateInputData(
17936
17938
  primaryStackAreaAxisData,
17937
17939
  primaryStackColumnAxisData,
@@ -17955,6 +17957,28 @@ const CustomColumnChart = ({
17955
17957
  });
17956
17958
  drawCustomChart();
17957
17959
  };
17960
+ function createTotalMeasureValueMapForCustomColumChart(data2, totalValueMap2, filteredDimension2) {
17961
+ totalValueMap2.clear();
17962
+ if (filteredDimension2 && filteredDimension2.length > 0) {
17963
+ filteredDimension2.forEach((dimension) => {
17964
+ let totalMeasureValue = 0;
17965
+ totalValueMap2.set(dimension, totalMeasureValue);
17966
+ });
17967
+ }
17968
+ if (data2.ChartData && data2.ChartData.length > 0) {
17969
+ data2.ChartData.forEach((series) => {
17970
+ if (series.properties.type.includes("Stack")) {
17971
+ series.data.forEach((dataPoint, index2) => {
17972
+ if (totalValueMap2.has(dataPoint.dimension)) {
17973
+ let existingTotal = totalValueMap2.get(dataPoint.dimension) || 0;
17974
+ existingTotal += dataPoint.value || 0;
17975
+ totalValueMap2.set(dataPoint.dimension, existingTotal);
17976
+ }
17977
+ });
17978
+ }
17979
+ });
17980
+ }
17981
+ }
17958
17982
  const drawCustomChart = () => {
17959
17983
  getXScale();
17960
17984
  getXAxis();
@@ -18003,6 +18027,20 @@ const CustomColumnChart = ({
18003
18027
  xScaleForLegends,
18004
18028
  isReportEditable
18005
18029
  );
18030
+ addTotalValue(
18031
+ totalValueMap,
18032
+ xScale,
18033
+ yScaleLeft,
18034
+ margin,
18035
+ d3Annotation,
18036
+ [],
18037
+ formatOptions,
18038
+ chartType,
18039
+ height,
18040
+ width,
18041
+ svg,
18042
+ isReportEditable
18043
+ );
18006
18044
  };
18007
18045
  const createStackData = (requiredStackChatData) => {
18008
18046
  let legendList = requiredStackChatData.data.map((d) => d.legend);
@@ -17128,6 +17128,7 @@
17128
17128
  let yAxisLeft;
17129
17129
  let xAxis;
17130
17130
  let yAxisRight;
17131
+ let totalValueMap = /* @__PURE__ */ new Map();
17131
17132
  let filteredDimension;
17132
17133
  let filteredData = [];
17133
17134
  let requiredData = [];
@@ -17689,7 +17690,7 @@
17689
17690
  ).append("path").attr("class", "line").attr("fill", "none");
17690
17691
  lineGroupsEnter.merge(lineGroups).select("path").attr("d", (d) => lineGenerator(d.data)).attr(
17691
17692
  "stroke",
17692
- (d) => d.properties !== commonColors.white ? d.properties.color : "none"
17693
+ (d) => d.properties.color !== commonColors.white ? d.properties.color : "none"
17693
17694
  ).attr("stroke-dasharray", (d) => {
17694
17695
  switch (d.properties.lineStyle) {
17695
17696
  case staticLineStyle.dotted:
@@ -17935,6 +17936,7 @@
17935
17936
  filteredData = fData;
17936
17937
  filteredDimension = fDimension;
17937
17938
  visibleBars = fVisibleBars;
17939
+ createTotalMeasureValueMapForCustomColumChart(data, totalValueMap, filteredDimension);
17938
17940
  checkAndupdateInputData(
17939
17941
  primaryStackAreaAxisData,
17940
17942
  primaryStackColumnAxisData,
@@ -17958,6 +17960,28 @@
17958
17960
  });
17959
17961
  drawCustomChart();
17960
17962
  };
17963
+ function createTotalMeasureValueMapForCustomColumChart(data2, totalValueMap2, filteredDimension2) {
17964
+ totalValueMap2.clear();
17965
+ if (filteredDimension2 && filteredDimension2.length > 0) {
17966
+ filteredDimension2.forEach((dimension) => {
17967
+ let totalMeasureValue = 0;
17968
+ totalValueMap2.set(dimension, totalMeasureValue);
17969
+ });
17970
+ }
17971
+ if (data2.ChartData && data2.ChartData.length > 0) {
17972
+ data2.ChartData.forEach((series) => {
17973
+ if (series.properties.type.includes("Stack")) {
17974
+ series.data.forEach((dataPoint, index2) => {
17975
+ if (totalValueMap2.has(dataPoint.dimension)) {
17976
+ let existingTotal = totalValueMap2.get(dataPoint.dimension) || 0;
17977
+ existingTotal += dataPoint.value || 0;
17978
+ totalValueMap2.set(dataPoint.dimension, existingTotal);
17979
+ }
17980
+ });
17981
+ }
17982
+ });
17983
+ }
17984
+ }
17961
17985
  const drawCustomChart = () => {
17962
17986
  getXScale();
17963
17987
  getXAxis();
@@ -18006,6 +18030,20 @@
18006
18030
  xScaleForLegends,
18007
18031
  isReportEditable
18008
18032
  );
18033
+ addTotalValue(
18034
+ totalValueMap,
18035
+ xScale,
18036
+ yScaleLeft,
18037
+ margin,
18038
+ d3Annotation,
18039
+ [],
18040
+ formatOptions,
18041
+ chartType,
18042
+ height,
18043
+ width,
18044
+ svg,
18045
+ isReportEditable
18046
+ );
18009
18047
  };
18010
18048
  const createStackData = (requiredStackChatData) => {
18011
18049
  let legendList = requiredStackChatData.data.map((d) => d.legend);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pace-chart-lib",
3
- "version": "1.0.28",
3
+ "version": "1.0.29",
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",