pace-chart-lib 1.0.43 → 1.0.44

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.
@@ -4778,7 +4778,7 @@ function index$2(projection, context) {
4778
4778
  };
4779
4779
  return path2.projection(projection).digits(digits).context(context);
4780
4780
  }
4781
- function transformer$1(methods) {
4781
+ function transformer$2(methods) {
4782
4782
  return function(stream) {
4783
4783
  var s2 = new TransformStream();
4784
4784
  for (var key in methods) s2[key] = methods[key];
@@ -4844,7 +4844,7 @@ function resample(project, delta2) {
4844
4844
  return +delta2 ? resample$1(project, delta2) : resampleNone(project);
4845
4845
  }
4846
4846
  function resampleNone(project) {
4847
- return transformer$1({
4847
+ return transformer$2({
4848
4848
  point: function(x2, y2) {
4849
4849
  x2 = project(x2, y2);
4850
4850
  this.stream.point(x2[0], x2[1]);
@@ -4913,13 +4913,13 @@ function resample$1(project, delta2) {
4913
4913
  return resampleStream;
4914
4914
  };
4915
4915
  }
4916
- var transformRadians = transformer$1({
4916
+ var transformRadians = transformer$2({
4917
4917
  point: function(x2, y2) {
4918
4918
  this.stream.point(x2 * radians, y2 * radians);
4919
4919
  }
4920
4920
  });
4921
4921
  function transformRotate(rotate) {
4922
- return transformer$1({
4922
+ return transformer$2({
4923
4923
  point: function(x2, y2) {
4924
4924
  var r = rotate(x2, y2);
4925
4925
  return this.stream.point(r[0], r[1]);
@@ -5737,6 +5737,24 @@ function initRange(domain, range2) {
5737
5737
  }
5738
5738
  return this;
5739
5739
  }
5740
+ function initInterpolator(domain, interpolator) {
5741
+ switch (arguments.length) {
5742
+ case 0:
5743
+ break;
5744
+ case 1: {
5745
+ if (typeof domain === "function") this.interpolator(domain);
5746
+ else this.range(domain);
5747
+ break;
5748
+ }
5749
+ default: {
5750
+ this.domain(domain);
5751
+ if (typeof interpolator === "function") this.interpolator(interpolator);
5752
+ else this.range(interpolator);
5753
+ break;
5754
+ }
5755
+ }
5756
+ return this;
5757
+ }
5740
5758
  const implicit = Symbol("implicit");
5741
5759
  function ordinal() {
5742
5760
  var index2 = new InternMap(), domain = [], range2 = [], unknown = implicit;
@@ -5879,10 +5897,10 @@ function polymap(domain, range2, interpolate2) {
5879
5897
  return r[i2](d[i2](x2));
5880
5898
  };
5881
5899
  }
5882
- function copy(source, target) {
5900
+ function copy$1(source, target) {
5883
5901
  return target.domain(source.domain()).range(source.range()).interpolate(source.interpolate()).clamp(source.clamp()).unknown(source.unknown());
5884
5902
  }
5885
- function transformer() {
5903
+ function transformer$1() {
5886
5904
  var domain = unit, range2 = unit, interpolate2 = interpolate$2, transform, untransform, unknown, clamp2 = identity$3, piecewise, output, input;
5887
5905
  function rescale() {
5888
5906
  var n = Math.min(domain.length, range2.length);
@@ -5921,7 +5939,7 @@ function transformer() {
5921
5939
  };
5922
5940
  }
5923
5941
  function continuous() {
5924
- return transformer()(identity$3, identity$3);
5942
+ return transformer$1()(identity$3, identity$3);
5925
5943
  }
5926
5944
  function tickFormat(start2, stop, count2, specifier) {
5927
5945
  var step2 = tickStep(start2, stop, count2), precision;
@@ -5996,7 +6014,7 @@ function linearish(scale2) {
5996
6014
  function linear$1() {
5997
6015
  var scale2 = continuous();
5998
6016
  scale2.copy = function() {
5999
- return copy(scale2, linear$1());
6017
+ return copy$1(scale2, linear$1());
6000
6018
  };
6001
6019
  initRange.apply(scale2, arguments);
6002
6020
  return linearish(scale2);
@@ -6023,13 +6041,53 @@ function powish(transform) {
6023
6041
  return linearish(scale2);
6024
6042
  }
6025
6043
  function pow() {
6026
- var scale2 = powish(transformer());
6044
+ var scale2 = powish(transformer$1());
6027
6045
  scale2.copy = function() {
6028
- return copy(scale2, pow()).exponent(scale2.exponent());
6046
+ return copy$1(scale2, pow()).exponent(scale2.exponent());
6029
6047
  };
6030
6048
  initRange.apply(scale2, arguments);
6031
6049
  return scale2;
6032
6050
  }
6051
+ function transformer() {
6052
+ var x02 = 0, x12 = 1, t02, t12, k10, transform, interpolator = identity$3, clamp2 = false, unknown;
6053
+ function scale2(x2) {
6054
+ return x2 == null || isNaN(x2 = +x2) ? unknown : interpolator(k10 === 0 ? 0.5 : (x2 = (transform(x2) - t02) * k10, clamp2 ? Math.max(0, Math.min(1, x2)) : x2));
6055
+ }
6056
+ scale2.domain = function(_) {
6057
+ return arguments.length ? ([x02, x12] = _, t02 = transform(x02 = +x02), t12 = transform(x12 = +x12), k10 = t02 === t12 ? 0 : 1 / (t12 - t02), scale2) : [x02, x12];
6058
+ };
6059
+ scale2.clamp = function(_) {
6060
+ return arguments.length ? (clamp2 = !!_, scale2) : clamp2;
6061
+ };
6062
+ scale2.interpolator = function(_) {
6063
+ return arguments.length ? (interpolator = _, scale2) : interpolator;
6064
+ };
6065
+ function range2(interpolate2) {
6066
+ return function(_) {
6067
+ var r0, r1;
6068
+ return arguments.length ? ([r0, r1] = _, interpolator = interpolate2(r0, r1), scale2) : [interpolator(0), interpolator(1)];
6069
+ };
6070
+ }
6071
+ scale2.range = range2(interpolate$2);
6072
+ scale2.rangeRound = range2(interpolateRound);
6073
+ scale2.unknown = function(_) {
6074
+ return arguments.length ? (unknown = _, scale2) : unknown;
6075
+ };
6076
+ return function(t) {
6077
+ transform = t, t02 = t(x02), t12 = t(x12), k10 = t02 === t12 ? 0 : 1 / (t12 - t02);
6078
+ return scale2;
6079
+ };
6080
+ }
6081
+ function copy(source, target) {
6082
+ return target.domain(source.domain()).interpolator(source.interpolator()).clamp(source.clamp()).unknown(source.unknown());
6083
+ }
6084
+ function sequential() {
6085
+ var scale2 = linearish(transformer()(identity$3));
6086
+ scale2.copy = function() {
6087
+ return copy(scale2, sequential());
6088
+ };
6089
+ return initInterpolator.apply(scale2, arguments);
6090
+ }
6033
6091
  function constant$7(x2) {
6034
6092
  return function constant2() {
6035
6093
  return x2;
@@ -11052,6 +11110,7 @@ const defaultChartFormatOptions = {
11052
11110
  gridLinesHorizontal: true,
11053
11111
  gridLinesVertical: false,
11054
11112
  ticksHeight: "100",
11113
+ ticksWidth: "100",
11055
11114
  gridLinesColor: "#ccc",
11056
11115
  xCoordinate: "None",
11057
11116
  yCoordinate: "None",
@@ -11518,6 +11577,7 @@ var chartTypes = /* @__PURE__ */ ((chartTypes2) => {
11518
11577
  chartTypes2["CombinationArea"] = "CombinationArea";
11519
11578
  chartTypes2["CombinationStackArea"] = "CombinationStackArea";
11520
11579
  chartTypes2["TornadoDefaultEntry"] = "defaultEntry";
11580
+ chartTypes2["ClevelandDotPlot"] = "ClevelandDotPlot";
11521
11581
  return chartTypes2;
11522
11582
  })(chartTypes || {});
11523
11583
  const connecterCurve = {
@@ -12476,7 +12536,7 @@ function initYaxis$1(gTag, formatOptions, dataTableHeight, yLabel, yAxisLeft, in
12476
12536
  );
12477
12537
  yAxisG.select(".domain").style("shape-rendering", "crispEdges").style("stroke", formatOptions.yAxisLabel.yAxisColor).attr(
12478
12538
  "stroke-width",
12479
- formatOptions.yAxisLabel.yAxisWidth ? formatOptions.yAxisLabel.yAxisWidth : formatOptions.plotArea.plotAreaBorderThickness
12539
+ formatOptions.yAxisLabel.yAxisWidth ?? formatOptions.plotArea.plotAreaBorderThickness
12480
12540
  );
12481
12541
  } catch (error) {
12482
12542
  throw error;
@@ -15813,6 +15873,11 @@ function getVerticalGridLinesTickSize(formatOptions, innerHeight2, dataTableHeig
15813
15873
  const actualTickHeight = (innerHeight2 - dataTableHeightIfPreset) * tickHeightPercentage / 100;
15814
15874
  return formatOptions.plotArea.gridLinesVisibility ? formatOptions.plotArea.gridLinesVertical ? -actualTickHeight * axisPositionMultiplier : 0 : 0;
15815
15875
  }
15876
+ function getHorizontalGridLinesTickSize(formatOptions, innerWidth2, seriesLabelWidth = 0) {
15877
+ const tickHeightPercentage = parseFloat(formatOptions.plotArea.ticksWidth) || 100;
15878
+ const actualTickWidth = (innerWidth2 - seriesLabelWidth) * tickHeightPercentage / 100;
15879
+ return formatOptions.plotArea.gridLinesVisibility ? formatOptions.plotArea.gridLinesHorizontal ? -actualTickWidth : 0 : 0;
15880
+ }
15816
15881
  const chartProperties = {
15817
15882
  color: "defaultColor",
15818
15883
  name: "",
@@ -17095,7 +17160,6 @@ const ColumnChart = ({
17095
17160
  let xScale;
17096
17161
  let xScaleForLegends;
17097
17162
  let calculatedRange;
17098
- let seriesLabelWidth;
17099
17163
  let yAxisLeft;
17100
17164
  let xAxis;
17101
17165
  let yAxisRight;
@@ -17103,6 +17167,7 @@ const ColumnChart = ({
17103
17167
  let filteredData = [];
17104
17168
  let scrollPosition = 0;
17105
17169
  let visibleBars = 0;
17170
+ const colorScaleMap = /* @__PURE__ */ new Map();
17106
17171
  let chartJSON = {
17107
17172
  dimensionList,
17108
17173
  chartType,
@@ -17285,8 +17350,12 @@ const ColumnChart = ({
17285
17350
  let yMinLeft = Infinity;
17286
17351
  let yMaxRight = -Infinity;
17287
17352
  let yMinRight = Infinity;
17353
+ let seriesMinValue = Infinity;
17354
+ let seriesMaxValue = -Infinity;
17288
17355
  seriesData.forEach((series) => {
17289
17356
  legendList.push(series.properties.legendUniqueId);
17357
+ seriesMaxValue = -Infinity;
17358
+ seriesMinValue = Infinity;
17290
17359
  series.data.forEach((point2) => {
17291
17360
  allChartData.push(point2);
17292
17361
  if (series.properties.axis === "Secondary") {
@@ -17297,7 +17366,17 @@ const ColumnChart = ({
17297
17366
  yMaxLeft = Math.max(yMaxLeft, point2.value);
17298
17367
  yMinLeft = Math.min(yMinLeft, point2.value);
17299
17368
  }
17369
+ seriesMaxValue = Math.max(seriesMaxValue, point2.value);
17370
+ seriesMinValue = Math.min(seriesMinValue, point2.value);
17300
17371
  });
17372
+ if (series.properties.setColorScale) {
17373
+ colorScaleMap.set(
17374
+ series.properties.legendUniqueId,
17375
+ sequential().domain([seriesMinValue, seriesMaxValue]).interpolator(
17376
+ interpolateRgb$1(series.properties.startColor, series.properties.endColor)
17377
+ )
17378
+ );
17379
+ }
17301
17380
  });
17302
17381
  chartJSON.chartData = allChartData;
17303
17382
  chartJSON.legendList = legendList;
@@ -17349,19 +17428,6 @@ const ColumnChart = ({
17349
17428
  ]);
17350
17429
  }
17351
17430
  calculatedRange = [0, innerWidth2];
17352
- if (formatOptions.seriesLabel.seriesLabelVisibility) {
17353
- let labelObj = prepareDataForSeriesLabel(
17354
- innerWidth2,
17355
- yScaleLeft,
17356
- formatOptions,
17357
- filteredData,
17358
- yScaleRight,
17359
- isSecondaryAxisDrawn
17360
- );
17361
- labelObj.labelArray;
17362
- formatOptions.seriesLabel.seriesLabelPosition == "Right" && (seriesLabelWidth = labelObj.heightWidth[0]);
17363
- formatOptions.seriesLabel.seriesLabelPosition == "Right" ? calculatedRange = [0, innerWidth2 - labelObj.heightWidth[0]] : calculatedRange = [labelObj.heightWidth[0], innerWidth2];
17364
- }
17365
17431
  getXScale();
17366
17432
  };
17367
17433
  const getXScale = () => {
@@ -17389,7 +17455,7 @@ const ColumnChart = ({
17389
17455
  formatOptions.yAxisLabel.yAxisLabelDecimalPrecision
17390
17456
  )
17391
17457
  ).tickSize(
17392
- formatOptions.plotArea.gridLinesVisibility ? formatOptions.plotArea.gridLinesHorizontal ? -innerWidth2 + (seriesLabelWidth ? seriesLabelWidth : 0) : 0 : 0
17458
+ getHorizontalGridLinesTickSize(formatOptions, innerWidth2)
17393
17459
  ).tickValues(
17394
17460
  responsiveLablesObj.autoLabelFlag ? void 0 : responsiveLablesObj.yAxisLabelArray
17395
17461
  ).ticks(responsiveLablesObj.customTickValue).tickPadding(8).tickSizeOuter(0);
@@ -17413,7 +17479,7 @@ const ColumnChart = ({
17413
17479
  ).ticks(
17414
17480
  seondaryResponsiveLablesObj.secondaryCustomTickValue ?? innerHeight2 / 30
17415
17481
  ).tickSize(
17416
- formatOptions.plotArea.gridLinesVisibility ? formatOptions.plotArea.gridLinesHorizontal ? -innerWidth2 : 0 : 0
17482
+ getHorizontalGridLinesTickSize(formatOptions, innerWidth2)
17417
17483
  ).tickPadding(8).tickSizeOuter(0);
17418
17484
  }
17419
17485
  };
@@ -17459,7 +17525,7 @@ const ColumnChart = ({
17459
17525
  const bars = columnGroupsEnter.append("rect").attr("x", (d) => xScaleForLegends(d.legendUniqueId)).attr("width", xScaleForLegends.bandwidth()).attr("y", (d) => {
17460
17526
  const yScale = data2.properties.axis === axisTypes.primary ? yScaleLeft : yScaleRight;
17461
17527
  return yScale(0);
17462
- }).attr("height", 0).attr("fill", data2.properties.color).attr(
17528
+ }).attr("height", 0).attr("fill", (d) => colorScaleMap.get(data2.properties.legendUniqueId)?.(d.value) ?? data2.properties.color).attr(
17463
17529
  "stroke-dasharray",
17464
17530
  (d) => data2.properties.stackBorderStyle == 2 ? "5,3" : "0"
17465
17531
  ).attr("stroke-width", (d) => `${data2.properties.stackBorderWidth}px`).attr(
@@ -17502,7 +17568,7 @@ const ColumnChart = ({
17502
17568
  },
17503
17569
  {
17504
17570
  key: "Legend",
17505
- value: d.legend.includes("~$~") ? d.legend.split("~$~")[1] : d.legend
17571
+ value: data2.properties.alias
17506
17572
  }
17507
17573
  ],
17508
17574
  formatOptions,
@@ -18085,7 +18151,12 @@ const CustomColumnChart = ({
18085
18151
  formatOptions.yAxisLabel.yAxisLabelDecimalPrecision
18086
18152
  )
18087
18153
  ).tickSize(
18088
- formatOptions.plotArea.gridLinesVisibility ? formatOptions.plotArea.gridLinesHorizontal ? -innerWidth2 + 0 : 0 : 0
18154
+ getHorizontalGridLinesTickSize(formatOptions, innerWidth2)
18155
+ // formatOptions.plotArea.gridLinesVisibility
18156
+ // ? formatOptions.plotArea.gridLinesHorizontal
18157
+ // ? -innerWidth + (seriesLabelWidth ? seriesLabelWidth : 0)
18158
+ // : 0
18159
+ // : 0,
18089
18160
  ).tickValues(
18090
18161
  responsiveLablesObj.autoLabelFlag ? void 0 : responsiveLablesObj.yAxisLabelArray
18091
18162
  ).ticks(responsiveLablesObj.customTickValue).tickPadding(8).tickSizeOuter(0);
@@ -18110,13 +18181,27 @@ const CustomColumnChart = ({
18110
18181
  ).tickValues(
18111
18182
  responsiveLablesObj.autoLabelFlag ? void 0 : responsiveLablesObj.yAxisLabelArray
18112
18183
  ).ticks(responsiveLablesObj.customTickValue).tickSize(
18113
- formatOptions.plotArea.gridLinesVisibility ? formatOptions.plotArea.gridLinesHorizontal ? -innerWidth2 : 0 : 0
18184
+ getHorizontalGridLinesTickSize(formatOptions, innerWidth2)
18114
18185
  ).tickPadding(8).tickSizeOuter(0);
18115
18186
  }
18116
18187
  };
18117
18188
  const getXAxis = () => {
18118
18189
  xAxis = axisBottom(xScale).tickSize(
18119
- formatOptions.plotArea.gridLinesVisibility ? formatOptions.plotArea.gridLinesVertical ? formatOptions.plotArea.gridLinesVertical ? -(dataTableHeight > 0 ? innerHeight2 - dataTableHeight : innerHeight2) : parseFloat(formatOptions.plotArea.ticksHeight) * ((dataTableHeight > 0 ? innerHeight2 - dataTableHeight : innerHeight2) / 100) * (formatOptions.xAxisLabel.xAxisPosition == "1" ? 1 : -1) : 0 : 0
18190
+ getVerticalGridLinesTickSize(formatOptions, innerHeight2, dataTableHeight, true)
18191
+ // formatOptions.plotArea.gridLinesVisibility
18192
+ // ? formatOptions.plotArea.gridLinesVertical
18193
+ // ? formatOptions.plotArea.gridLinesVertical
18194
+ // ? -(dataTableHeight > 0
18195
+ // ? innerHeight - dataTableHeight
18196
+ // : innerHeight)
18197
+ // : parseFloat(formatOptions.plotArea.ticksHeight) *
18198
+ // ((dataTableHeight > 0
18199
+ // ? innerHeight - dataTableHeight
18200
+ // : innerHeight) /
18201
+ // 100) *
18202
+ // (formatOptions.xAxisLabel.xAxisPosition == "1" ? 1 : -1)
18203
+ // : 0
18204
+ // : 0,
18120
18205
  ).tickSizeOuter(0).tickValues(responsiveXaxisLabel(filteredDimension, innerWidth2));
18121
18206
  };
18122
18207
  const getChartType = (lineData) => {
@@ -18727,11 +18812,11 @@ const LayeredColumnChart = ({
18727
18812
  let xScale;
18728
18813
  let xScaleForLegends;
18729
18814
  let calculatedRange;
18730
- let seriesLabelWidth;
18731
18815
  let yAxisLeft;
18732
18816
  let xAxis;
18733
18817
  let filteredDimension;
18734
18818
  let filteredData = [];
18819
+ const colorScaleMap = /* @__PURE__ */ new Map();
18735
18820
  let scrollPosition = 0;
18736
18821
  let visibleBars = 2;
18737
18822
  let scrollbarVisible = false;
@@ -18906,13 +18991,27 @@ const LayeredColumnChart = ({
18906
18991
  let yMinLeft = Infinity;
18907
18992
  let yMaxRight = -Infinity;
18908
18993
  let yMinRight = Infinity;
18994
+ let seriesMaxValue = -Infinity;
18995
+ let seriesMinValue = Infinity;
18909
18996
  seriesData.forEach((series) => {
18910
18997
  legendList.push(series.properties.legendUniqueId);
18998
+ seriesMaxValue = -Infinity;
18999
+ seriesMinValue = Infinity;
18911
19000
  series.data.forEach((point2) => {
18912
19001
  allChartData.push(point2);
19002
+ seriesMaxValue = Math.max(seriesMaxValue, point2.value);
19003
+ seriesMinValue = Math.min(seriesMinValue, point2.value);
18913
19004
  yMaxLeft = Math.max(yMaxLeft, point2.value);
18914
19005
  yMinLeft = Math.min(yMinLeft, point2.value);
18915
19006
  });
19007
+ if (series.properties.setColorScale) {
19008
+ colorScaleMap.set(
19009
+ series.properties.legendUniqueId,
19010
+ sequential().domain([seriesMinValue, seriesMaxValue]).interpolator(
19011
+ interpolateRgb$1(series.properties.startColor, series.properties.endColor)
19012
+ )
19013
+ );
19014
+ }
18916
19015
  });
18917
19016
  chartJSON.chartData = allChartData;
18918
19017
  chartJSON.legendList = legendList;
@@ -18962,19 +19061,6 @@ const LayeredColumnChart = ({
18962
19061
  ]);
18963
19062
  }
18964
19063
  calculatedRange = [0, innerWidth2];
18965
- if (formatOptions.seriesLabel.seriesLabelVisibility) {
18966
- let labelObj = prepareDataForSeriesLabel(
18967
- innerWidth2,
18968
- yScaleLeft,
18969
- formatOptions,
18970
- filteredData,
18971
- yScaleRight,
18972
- isSecondaryAxisDrawn
18973
- );
18974
- labelObj.labelArray;
18975
- formatOptions.seriesLabel.seriesLabelPosition == "Right" && (seriesLabelWidth = labelObj.heightWidth[0]);
18976
- formatOptions.seriesLabel.seriesLabelPosition == "Right" ? calculatedRange = [0, innerWidth2 - labelObj.heightWidth[0]] : calculatedRange = [labelObj.heightWidth[0], innerWidth2];
18977
- }
18978
19064
  };
18979
19065
  const getXScale = () => {
18980
19066
  xScaleForLegends = band().domain(["layeredLegend"]).range([0, columnWidth]).paddingInner(
@@ -19002,7 +19088,7 @@ const LayeredColumnChart = ({
19002
19088
  formatOptions.yAxisLabel.yAxisLabelDecimalPrecision
19003
19089
  )
19004
19090
  ).tickSize(
19005
- formatOptions.plotArea.gridLinesVisibility ? formatOptions.plotArea.gridLinesHorizontal ? -innerWidth2 + (seriesLabelWidth ? seriesLabelWidth : 0) : 0 : 0
19091
+ getHorizontalGridLinesTickSize(formatOptions, innerWidth2)
19006
19092
  ).tickValues(
19007
19093
  responsiveLablesObj.autoLabelFlag ? void 0 : responsiveLablesObj.yAxisLabelArray
19008
19094
  ).ticks(responsiveLablesObj.customTickValue).tickPadding(8).tickSizeOuter(0);
@@ -19010,7 +19096,21 @@ const LayeredColumnChart = ({
19010
19096
  };
19011
19097
  const getXAxis = () => {
19012
19098
  xAxis = axisBottom(xScale).tickSize(
19013
- formatOptions.plotArea.gridLinesVisibility ? formatOptions.plotArea.gridLinesVertical ? formatOptions.plotArea.gridLinesVertical ? -(dataTableHeight > 0 ? innerHeight2 - dataTableHeight : innerHeight2) : parseFloat(formatOptions.plotArea.ticksHeight) * ((dataTableHeight > 0 ? innerHeight2 - dataTableHeight : innerHeight2) / 100) * (formatOptions.xAxisLabel.xAxisPosition == "1" ? 1 : -1) : 0 : 0
19099
+ getVerticalGridLinesTickSize(formatOptions, innerHeight2, dataTableHeight)
19100
+ // formatOptions.plotArea.gridLinesVisibility
19101
+ // ? formatOptions.plotArea.gridLinesVertical
19102
+ // ? formatOptions.plotArea.gridLinesVertical
19103
+ // ? -(dataTableHeight > 0
19104
+ // ? innerHeight - dataTableHeight
19105
+ // : innerHeight)
19106
+ // : parseFloat(formatOptions.plotArea.ticksHeight) *
19107
+ // ((dataTableHeight > 0
19108
+ // ? innerHeight - dataTableHeight
19109
+ // : innerHeight) /
19110
+ // 100) *
19111
+ // (formatOptions.xAxisLabel.xAxisPosition == "1" ? 1 : -1)
19112
+ // : 0
19113
+ // : 0
19014
19114
  ).tickSizeOuter(0).tickValues(responsiveXaxisLabel(filteredDimension, innerWidth2));
19015
19115
  };
19016
19116
  const getChartType = (lineData) => {
@@ -19049,7 +19149,7 @@ const LayeredColumnChart = ({
19049
19149
  }).attr("height", (d) => {
19050
19150
  const yScale = data2.properties.axis === axisTypes.primary ? yScaleLeft : yScaleRight;
19051
19151
  return Math.abs(yScale(d.value) - yScale(0));
19052
- }).attr("fill", data2.properties.color).attr(
19152
+ }).attr("fill", (d) => colorScaleMap.get(data2.properties.legendUniqueId)?.(d.value) ?? data2.properties.color).attr(
19053
19153
  "stroke-dasharray",
19054
19154
  (d) => data2.properties.stackBorderStyle == 2 ? "5,3" : "0"
19055
19155
  ).attr("stroke-width", () => `${data2.properties.stackBorderWidth}px`).attr(
@@ -19082,7 +19182,7 @@ const LayeredColumnChart = ({
19082
19182
  },
19083
19183
  {
19084
19184
  key: "Legend",
19085
- value: d.legend.includes("~$~") ? d.legend.split("~$~")[1] : d.legend
19185
+ value: d.properties.alias
19086
19186
  }
19087
19187
  ],
19088
19188
  formatOptions,
@@ -19108,7 +19208,6 @@ const LayeredColumnChart = ({
19108
19208
  const drawColumnChart = () => {
19109
19209
  getXScale();
19110
19210
  getXAxis();
19111
- getChartType(filteredData);
19112
19211
  initXaxis$1(
19113
19212
  gTag,
19114
19213
  chartJSON,
@@ -19126,6 +19225,7 @@ const LayeredColumnChart = ({
19126
19225
  filteredDimension,
19127
19226
  xScale
19128
19227
  );
19228
+ getChartType(filteredData);
19129
19229
  commonAnnotations(
19130
19230
  seriesData,
19131
19231
  xScale,
@@ -19246,6 +19346,7 @@ const StackColumnChart = ({
19246
19346
  let yScaleRight;
19247
19347
  let xScale;
19248
19348
  let calculatedRange;
19349
+ const colorScaleMap = /* @__PURE__ */ new Map();
19249
19350
  let yAxisLeft;
19250
19351
  let xAxis;
19251
19352
  let filteredDimension;
@@ -19421,13 +19522,27 @@ const StackColumnChart = ({
19421
19522
  const preProcessChartData = () => {
19422
19523
  const allChartData = [];
19423
19524
  const legendList = [];
19525
+ let seriesMaxValue = -Infinity;
19526
+ let seriesMinValue = Infinity;
19424
19527
  seriesData.forEach((series, index2) => {
19425
19528
  const prefixedLegend = `${index2}~$~${series.properties.legend}`;
19426
19529
  series.properties.legend = prefixedLegend;
19427
19530
  legendList.push(prefixedLegend);
19531
+ seriesMaxValue = -Infinity;
19532
+ seriesMinValue = Infinity;
19428
19533
  for (const point2 of series.data) {
19534
+ seriesMaxValue = Math.max(seriesMaxValue, point2.value);
19535
+ seriesMinValue = Math.min(seriesMinValue, point2.value);
19429
19536
  allChartData.push(point2);
19430
19537
  }
19538
+ if (series.properties.setColorScale) {
19539
+ colorScaleMap.set(
19540
+ series.properties.legendUniqueId,
19541
+ sequential().domain([seriesMinValue, seriesMaxValue]).interpolator(
19542
+ interpolateRgb$1(series.properties.startColor, series.properties.endColor)
19543
+ )
19544
+ );
19545
+ }
19431
19546
  });
19432
19547
  chartJSON.chartData = allChartData;
19433
19548
  chartJSON.legendList = legendList;
@@ -19495,7 +19610,7 @@ const StackColumnChart = ({
19495
19610
  formatOptions.yAxisLabel.yAxisLabelDecimalPrecision
19496
19611
  )
19497
19612
  ).tickSize(
19498
- formatOptions.plotArea.gridLinesVisibility ? formatOptions.plotArea.gridLinesHorizontal ? -innerWidth2 + 0 : 0 : 0
19613
+ getHorizontalGridLinesTickSize(formatOptions, innerWidth2)
19499
19614
  ).tickValues(
19500
19615
  respParams.autoLabelFlag ? void 0 : respParams.yAxisLabelArray
19501
19616
  ).ticks(respParams.customTickValue).tickPadding(8).tickSizeOuter(0);
@@ -19533,7 +19648,7 @@ const StackColumnChart = ({
19533
19648
  };
19534
19649
  const baseRects = rects.enter().append("rect").merge(rects).attr("x", (d) => xScale(d.data.dimension) - columnWidth / 2).attr("width", columnWidth).attr("y", (d) => yScaleLeft(0)).attr("height", 0).attr("fill", (d, i, nodes) => {
19535
19650
  const { props } = getPropsForRect(nodes, i);
19536
- return props?.color || "gray";
19651
+ return colorScaleMap.get(props.legendUniqueId)?.(d.data[d.key]) ?? props?.color ?? "gray";
19537
19652
  }).attr("stroke", (d, i, nodes) => {
19538
19653
  const { props } = getPropsForRect(nodes, i);
19539
19654
  return props?.stackBorderStyle == 0 ? "none" : formatOptions.column.stackBorderVisibility ? props.stackBorderColor : "none";
@@ -19564,7 +19679,7 @@ const StackColumnChart = ({
19564
19679
  },
19565
19680
  {
19566
19681
  key: "Legend",
19567
- value: d.key.includes("~$~") ? d.key.split("~$~")[1] : d.key
19682
+ value: d.properties.alias
19568
19683
  }
19569
19684
  ],
19570
19685
  formatOptions,
@@ -19961,7 +20076,7 @@ const NormalizedStackColumnChart = ({
19961
20076
  let yScaleRight;
19962
20077
  let xScale;
19963
20078
  let calculatedRange;
19964
- let seriesLabelWidth;
20079
+ const colorScaleMap = /* @__PURE__ */ new Map();
19965
20080
  let yAxisLeft;
19966
20081
  let xAxis;
19967
20082
  let filteredDimension;
@@ -20140,13 +20255,27 @@ const NormalizedStackColumnChart = ({
20140
20255
  const preProcessChartData = () => {
20141
20256
  const allChartData = [];
20142
20257
  const legendList = [];
20258
+ let seriesMaxValue = -Infinity;
20259
+ let seriesMinValue = Infinity;
20143
20260
  seriesData.forEach((series, index2) => {
20144
20261
  const prefixedLegend = `${index2}~$~${series.properties.legend}`;
20145
20262
  series.properties.legend = prefixedLegend;
20146
20263
  legendList.push(prefixedLegend);
20264
+ seriesMaxValue = -Infinity;
20265
+ seriesMinValue = Infinity;
20147
20266
  for (const point2 of series.data) {
20267
+ seriesMaxValue = Math.max(seriesMaxValue, point2.value);
20268
+ seriesMinValue = Math.min(seriesMinValue, point2.value);
20148
20269
  allChartData.push(point2);
20149
20270
  }
20271
+ if (series.properties.setColorScale) {
20272
+ colorScaleMap.set(
20273
+ series.properties.legendUniqueId,
20274
+ sequential().domain([seriesMinValue, seriesMaxValue]).interpolator(
20275
+ interpolateRgb$1(series.properties.startColor, series.properties.endColor)
20276
+ )
20277
+ );
20278
+ }
20150
20279
  });
20151
20280
  chartJSON.chartData = allChartData;
20152
20281
  chartJSON.legendList = legendList;
@@ -20208,7 +20337,7 @@ const NormalizedStackColumnChart = ({
20208
20337
  true
20209
20338
  );
20210
20339
  labelObj.labelArray;
20211
- formatOptions.seriesLabel.seriesLabelPosition == "Right" && (seriesLabelWidth = labelObj.heightWidth[0]);
20340
+ formatOptions.seriesLabel.seriesLabelPosition == "Right" && labelObj.heightWidth[0];
20212
20341
  formatOptions.seriesLabel.seriesLabelPosition == "Right" ? calculatedRange = [0, innerWidth2 - labelObj.heightWidth[0]] : calculatedRange = [labelObj.heightWidth[0], innerWidth2];
20213
20342
  }
20214
20343
  };
@@ -20218,7 +20347,7 @@ const NormalizedStackColumnChart = ({
20218
20347
  const initAxis = () => {
20219
20348
  {
20220
20349
  yAxisLeft = axisLeft(yScaleLeft).tickSize(
20221
- formatOptions.plotArea.gridLinesVisibility ? formatOptions.plotArea.gridLinesHorizontal ? -innerWidth2 + (seriesLabelWidth ? seriesLabelWidth : 0) : 0 : 0
20350
+ getHorizontalGridLinesTickSize(formatOptions, innerWidth2)
20222
20351
  ).ticks(
20223
20352
  dataTableHeight > 0 ? (innerHeight2 - dataTableHeight) / 80 : innerHeight2 / 80,
20224
20353
  "%"
@@ -20227,7 +20356,21 @@ const NormalizedStackColumnChart = ({
20227
20356
  };
20228
20357
  const getXAxis = () => {
20229
20358
  xAxis = axisBottom(xScale).tickSize(
20230
- formatOptions.plotArea.gridLinesVisibility ? formatOptions.plotArea.gridLinesVertical ? formatOptions.plotArea.gridLinesVertical ? -(dataTableHeight > 0 ? innerHeight2 - dataTableHeight : innerHeight2) : parseFloat(formatOptions.plotArea.ticksHeight) * ((dataTableHeight > 0 ? innerHeight2 - dataTableHeight : innerHeight2) / 100) * (formatOptions.xAxisLabel.xAxisPosition == "1" ? 1 : -1) : 0 : 0
20359
+ getVerticalGridLinesTickSize(formatOptions, innerHeight2, dataTableHeight, true)
20360
+ // formatOptions.plotArea.gridLinesVisibility
20361
+ // ? formatOptions.plotArea.gridLinesVertical
20362
+ // ? formatOptions.plotArea.gridLinesVertical
20363
+ // ? -(dataTableHeight > 0
20364
+ // ? innerHeight - dataTableHeight
20365
+ // : innerHeight)
20366
+ // : parseFloat(formatOptions.plotArea.ticksHeight) *
20367
+ // ((dataTableHeight > 0
20368
+ // ? innerHeight - dataTableHeight
20369
+ // : innerHeight) /
20370
+ // 100) *
20371
+ // (formatOptions.xAxisLabel.xAxisPosition == "1" ? 1 : -1)
20372
+ // : 0
20373
+ // : 0
20231
20374
  ).tickSizeOuter(0).tickValues(responsiveXaxisLabel(filteredDimension, innerWidth2));
20232
20375
  };
20233
20376
  const getChartType = (lineData) => {
@@ -20265,7 +20408,7 @@ const NormalizedStackColumnChart = ({
20265
20408
  };
20266
20409
  const rectsEnter = rects.enter().append("rect").attr("x", (d) => xScale(d.data.dimension) - columnWidth / 2).attr("width", columnWidth).attr("y", yScaleLeft(0)).attr("height", 0).attr("fill", (d, i, nodes) => {
20267
20410
  const { props } = getPropsForRect(nodes, i);
20268
- return props?.color || "gray";
20411
+ return colorScaleMap.get(props.legendUniqueId)?.(d.data[d.key]) ?? props?.color ?? "gray";
20269
20412
  }).attr("stroke", (d, i, nodes) => {
20270
20413
  const { props } = getPropsForRect(nodes, i);
20271
20414
  return props?.stackBorderStyle === 0 ? "none" : formatOptions.column.stackBorderVisibility ? props.stackBorderColor : "none";
@@ -20299,7 +20442,7 @@ const NormalizedStackColumnChart = ({
20299
20442
  },
20300
20443
  {
20301
20444
  key: "Legend",
20302
- value: d.key.includes("~$~") ? d.key.split("~$~")[1] : d.key
20445
+ value: d.properties.alias
20303
20446
  }
20304
20447
  ],
20305
20448
  formatOptions,
@@ -21418,7 +21561,7 @@ const ColumnHistogramChart = ({
21418
21561
  formatOptions.yAxisLabel.yAxisLabelDecimalPrecision
21419
21562
  )
21420
21563
  ).tickSize(
21421
- formatOptions.plotArea.gridLinesVisibility ? formatOptions.plotArea.gridLinesHorizontal ? -innerWidth2 + 0 : 0 : 0
21564
+ getHorizontalGridLinesTickSize(formatOptions, innerWidth2)
21422
21565
  ).tickValues(
21423
21566
  responsiveLablesObj.autoLabelFlag ? void 0 : responsiveLablesObj.yAxisLabelArray
21424
21567
  ).ticks(responsiveLablesObj.customTickValue).tickPadding(8).tickSizeOuter(0);
@@ -21446,7 +21589,21 @@ const ColumnHistogramChart = ({
21446
21589
  false
21447
21590
  )
21448
21591
  ).tickSize(
21449
- formatOptions.plotArea.gridLinesVisibility ? formatOptions.plotArea.gridLinesVertical ? formatOptions.plotArea.gridLinesVertical ? -(dataTableHeight > 0 ? innerHeight2 - dataTableHeight : innerHeight2) : parseFloat(formatOptions.plotArea.ticksHeight) * ((dataTableHeight > 0 ? innerHeight2 - dataTableHeight : innerHeight2) / 100) * (formatOptions.xAxisLabel.xAxisPosition == "1" ? 1 : -1) : 0 : 0
21592
+ getVerticalGridLinesTickSize(formatOptions, innerHeight2, dataTableHeight)
21593
+ // formatOptions.plotArea.gridLinesVisibility
21594
+ // ? formatOptions.plotArea.gridLinesVertical
21595
+ // ? formatOptions.plotArea.gridLinesVertical
21596
+ // ? -(dataTableHeight > 0
21597
+ // ? innerHeight - dataTableHeight
21598
+ // : innerHeight)
21599
+ // : parseFloat(formatOptions.plotArea.ticksHeight) *
21600
+ // ((dataTableHeight > 0
21601
+ // ? innerHeight - dataTableHeight
21602
+ // : innerHeight) /
21603
+ // 100) *
21604
+ // (formatOptions.xAxisLabel.xAxisPosition == "1" ? 1 : -1)
21605
+ // : 0
21606
+ // : 0,
21450
21607
  ).tickSizeOuter(0);
21451
21608
  formatOptions.bins.binsCalculation === "Automatic" ? xAxis.ticks(thresholds) : xAxis.tickValues(periods).ticks(innerWidth2 / 50);
21452
21609
  };
@@ -21943,7 +22100,7 @@ const LineChart = ({
21943
22100
  formatOptions.yAxisLabel.yAxisLabelDecimalPrecision
21944
22101
  )
21945
22102
  ).tickSize(
21946
- formatOptions.plotArea.gridLinesVisibility ? formatOptions.plotArea.gridLinesHorizontal ? -innerWidth2 + (seriesLabelWidth ? seriesLabelWidth : 0) : 0 : 0
22103
+ getHorizontalGridLinesTickSize(formatOptions, innerWidth2, seriesLabelWidth)
21947
22104
  ).tickValues(
21948
22105
  responsiveLablesObj.autoLabelFlag ? void 0 : responsiveLablesObj.yAxisLabelArray
21949
22106
  ).ticks(responsiveLablesObj.customTickValue).tickPadding(8).tickSizeOuter(0);
@@ -21965,17 +22122,18 @@ const LineChart = ({
21965
22122
  ).tickValues(
21966
22123
  responsiveSecondaryLablesObj.autoLabelFlag ? void 0 : responsiveSecondaryLablesObj.secondaryYAxisLabelArray
21967
22124
  ).ticks(responsiveSecondaryLablesObj.secondaryCustomTickValue).tickSize(
21968
- formatOptions.plotArea.gridLinesVisibility ? formatOptions.plotArea.gridLinesHorizontal ? -innerWidth2 : 0 : 0
22125
+ getHorizontalGridLinesTickSize(formatOptions, innerWidth2, seriesLabelWidth)
21969
22126
  ).tickPadding(8).tickSizeOuter(0);
21970
22127
  }
21971
22128
  };
21972
22129
  const getXAxis = () => {
21973
22130
  xAxis = axisBottom(xScale).tickSize(
21974
- formatOptions.plotArea.gridLinesVisibility ? formatOptions.plotArea.gridLinesVertical ? formatOptions.plotArea.gridLinesVertical ? -(dataTableHeight > 0 ? innerHeight2 - dataTableHeight : innerHeight2) : parseFloat(formatOptions.plotArea.ticksHeight) * ((dataTableHeight > 0 ? innerHeight2 - dataTableHeight : innerHeight2) / 100) * (formatOptions.xAxisLabel.xAxisPosition == "1" ? 1 : -1) : 0 : 0
22131
+ getVerticalGridLinesTickSize(formatOptions, innerHeight2, dataTableHeight, true)
21975
22132
  ).tickSizeOuter(0).tickValues(responsiveXaxisLabel(filteredDimension, innerWidth2));
21976
22133
  };
21977
22134
  const getChartType = (lineData) => {
21978
- lineData.forEach((lData) => {
22135
+ const reversedLineData = [...lineData].reverse();
22136
+ reversedLineData.forEach((lData) => {
21979
22137
  lData.data.forEach((cData) => {
21980
22138
  cData.hideZero = lData.properties.hideZeroValues;
21981
22139
  cData.axis = lData.properties.axis;
@@ -21989,7 +22147,7 @@ const LineChart = ({
21989
22147
  ).defined(
21990
22148
  (d) => d.hideZero || chartJSON.hideZeroValues ? Boolean(d.value) : true
21991
22149
  ).curve(getCurveType(formatOptions));
21992
- let lines = gTag.selectAll(".parentGroup").data([lineData]);
22150
+ let lines = gTag.selectAll(".parentGroup").data([reversedLineData]);
21993
22151
  lines = lines.enter().append("g").attr("class", "lines parentGroup").merge(lines);
21994
22152
  let lineGroups = lines.selectAll(".line-group").data((d) => d);
21995
22153
  let lineGroupsEnter = lineGroups.enter().append("g").attr("class", "line-group");
@@ -22023,7 +22181,7 @@ const LineChart = ({
22023
22181
  lineGroups.exit().remove();
22024
22182
  lineMarkers(
22025
22183
  lines,
22026
- lineData,
22184
+ reversedLineData,
22027
22185
  "None",
22028
22186
  xScale,
22029
22187
  yScaleLeft,
@@ -22490,7 +22648,7 @@ const StackLineChart = ({
22490
22648
  formatOptions.yAxisLabel.yAxisLabelDecimalPrecision
22491
22649
  )
22492
22650
  ).tickSize(
22493
- formatOptions.plotArea.gridLinesVisibility ? formatOptions.plotArea.gridLinesHorizontal ? -innerWidth2 + (seriesLabelWidth ? seriesLabelWidth : 0) : 0 : 0
22651
+ getHorizontalGridLinesTickSize(formatOptions, innerWidth2, seriesLabelWidth)
22494
22652
  ).tickValues(
22495
22653
  responsiveLablesObj.autoLabelFlag ? void 0 : responsiveLablesObj.yAxisLabelArray
22496
22654
  ).ticks(responsiveLablesObj.customTickValue).tickPadding(8).tickSizeOuter(0);
@@ -22498,7 +22656,7 @@ const StackLineChart = ({
22498
22656
  };
22499
22657
  const getXAxis = () => {
22500
22658
  xAxis = axisBottom(xScale).tickSize(
22501
- formatOptions.plotArea.gridLinesVisibility ? formatOptions.plotArea.gridLinesVertical ? formatOptions.plotArea.gridLinesVertical ? -(dataTableHeight > 0 ? innerHeight2 - dataTableHeight : innerHeight2) : parseFloat(formatOptions.plotArea.ticksHeight) * ((dataTableHeight > 0 ? innerHeight2 - dataTableHeight : innerHeight2) / 100) * (formatOptions.xAxisLabel.xAxisPosition == "1" ? 1 : -1) : 0 : 0
22659
+ getVerticalGridLinesTickSize(formatOptions, innerHeight2, dataTableHeight, true)
22502
22660
  ).tickSizeOuter(0).tickValues(responsiveXaxisLabel(filteredDimension, innerWidth2));
22503
22661
  };
22504
22662
  const getChartType = (lineData) => {
@@ -23001,7 +23159,7 @@ const NormalisedStackLineChart = ({
23001
23159
  const initAxis = () => {
23002
23160
  {
23003
23161
  yAxisLeft = axisLeft(yScaleLeft).tickSize(
23004
- formatOptions.plotArea.gridLinesVisibility ? formatOptions.plotArea.gridLinesHorizontal ? -innerWidth2 + (seriesLabelWidth ? seriesLabelWidth : 0) : 0 : 0
23162
+ getHorizontalGridLinesTickSize(formatOptions, innerWidth2, seriesLabelWidth)
23005
23163
  ).ticks(
23006
23164
  dataTableHeight > 0 ? (innerHeight2 - dataTableHeight) / 80 : innerHeight2 / 80,
23007
23165
  "%"
@@ -23010,7 +23168,7 @@ const NormalisedStackLineChart = ({
23010
23168
  };
23011
23169
  const getXAxis = () => {
23012
23170
  xAxis = axisBottom(xScale).tickSize(
23013
- formatOptions.plotArea.gridLinesVisibility ? formatOptions.plotArea.gridLinesVertical ? formatOptions.plotArea.gridLinesVertical ? -(dataTableHeight > 0 ? innerHeight2 - dataTableHeight : innerHeight2) : parseFloat(formatOptions.plotArea.ticksHeight) * ((dataTableHeight > 0 ? innerHeight2 - dataTableHeight : innerHeight2) / 100) * (formatOptions.xAxisLabel.xAxisPosition == "1" ? 1 : -1) : 0 : 0
23171
+ getVerticalGridLinesTickSize(formatOptions, innerHeight2, dataTableHeight, true)
23014
23172
  ).tickSizeOuter(0).tickValues(responsiveXaxisLabel(filteredDimension, innerWidth2));
23015
23173
  };
23016
23174
  const getChartType = (lineData) => {
@@ -23250,6 +23408,7 @@ const HorizontalBarChart = ({
23250
23408
  const barChart = true;
23251
23409
  let isSecondaryAxisDrawn = false;
23252
23410
  const isNormalizedChart = false;
23411
+ const colorScaleMap = /* @__PURE__ */ new Map();
23253
23412
  let customYaxisMinValue = formatOptions.yAxisLabel.yAxisIntervalsVisibility ? parseFloat(formatOptions.yAxisLabel.yAxisMinText) : void 0;
23254
23413
  let customYaxisMaxValue = formatOptions.yAxisLabel.yAxisIntervalsVisibility ? parseFloat(formatOptions.yAxisLabel.yAxisMaxText) : void 0;
23255
23414
  let secondaryCustomYaxisMinValue = formatOptions.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility ? parseFloat(
@@ -23463,8 +23622,12 @@ const HorizontalBarChart = ({
23463
23622
  let yMinLeft = Infinity;
23464
23623
  let yMaxRight = -Infinity;
23465
23624
  let yMinRight = Infinity;
23625
+ let seriesMinValue = Infinity;
23626
+ let seriesMaxValue = -Infinity;
23466
23627
  seriesData.forEach((series) => {
23467
23628
  legendList.push(series.properties.legendUniqueId);
23629
+ seriesMaxValue = -Infinity;
23630
+ seriesMinValue = Infinity;
23468
23631
  series.data.forEach((point2) => {
23469
23632
  allChartData.push(point2);
23470
23633
  if (series.properties.axis === "Secondary") {
@@ -23475,7 +23638,17 @@ const HorizontalBarChart = ({
23475
23638
  yMaxLeft = Math.max(yMaxLeft, point2.value);
23476
23639
  yMinLeft = Math.min(yMinLeft, point2.value);
23477
23640
  }
23641
+ seriesMaxValue = Math.max(seriesMaxValue, point2.value);
23642
+ seriesMinValue = Math.min(seriesMinValue, point2.value);
23478
23643
  });
23644
+ if (series.properties.setColorScale) {
23645
+ colorScaleMap.set(
23646
+ series.properties.legendUniqueId,
23647
+ sequential().domain([seriesMinValue, seriesMaxValue]).interpolator(
23648
+ interpolateRgb$1(series.properties.startColor, series.properties.endColor)
23649
+ )
23650
+ );
23651
+ }
23479
23652
  });
23480
23653
  chartJSON.chartData = allChartData;
23481
23654
  chartJSON.legendList = legendList;
@@ -23627,7 +23800,7 @@ const HorizontalBarChart = ({
23627
23800
  const bars = columnGroupsEnter.append("rect").attr("y", (d) => yScaleLegends(d.legendUniqueId)).attr("height", yScaleLegends.bandwidth()).attr("x", (d) => {
23628
23801
  const xScaleUsed = data2.properties.axis === axisTypes.primary ? xScaleBottom : xScaleTop;
23629
23802
  return d.value >= 0 ? xScaleUsed(0) : xScaleUsed(0);
23630
- }).attr("width", 0).attr("fill", data2.properties.color).attr(
23803
+ }).attr("width", 0).attr("fill", (d) => colorScaleMap.get(data2.properties.legendUniqueId)?.(d.value) ?? data2.properties.color).attr(
23631
23804
  "stroke-dasharray",
23632
23805
  (d) => d.properties.stackBorderStyle == 2 ? "5,3" : "0"
23633
23806
  ).attr("stroke-width", (d) => `${d.properties.stackBorderWidth}px`).attr(
@@ -23799,6 +23972,7 @@ const StackHorizontalChart = ({
23799
23972
  let secondaryYLabel;
23800
23973
  let maxNumberForPrimaryAxis;
23801
23974
  let maxNumberForSecondaryAxis;
23975
+ const colorScaleMap = /* @__PURE__ */ new Map();
23802
23976
  let innerWidth2;
23803
23977
  let innerHeight2;
23804
23978
  let width;
@@ -23964,13 +24138,27 @@ const StackHorizontalChart = ({
23964
24138
  const preProcessChartData = () => {
23965
24139
  const allChartData = [];
23966
24140
  const legendList = [];
24141
+ let seriesMaxValue = -Infinity;
24142
+ let seriesMinValue = Infinity;
23967
24143
  seriesData.forEach((series, index2) => {
23968
24144
  const prefixedLegend = `${index2}~$~${series.properties.legend}`;
23969
24145
  series.properties.legend = prefixedLegend;
23970
24146
  legendList.push(prefixedLegend);
24147
+ seriesMaxValue = -Infinity;
24148
+ seriesMinValue = Infinity;
23971
24149
  for (const point2 of series.data) {
24150
+ seriesMaxValue = Math.max(seriesMaxValue, point2.value);
24151
+ seriesMinValue = Math.min(seriesMinValue, point2.value);
23972
24152
  allChartData.push(point2);
23973
24153
  }
24154
+ if (series.properties.setColorScale) {
24155
+ colorScaleMap.set(
24156
+ series.properties.legendUniqueId,
24157
+ sequential().domain([seriesMinValue, seriesMaxValue]).interpolator(
24158
+ interpolateRgb$1(series.properties.startColor, series.properties.endColor)
24159
+ )
24160
+ );
24161
+ }
23974
24162
  });
23975
24163
  chartJSON.chartData = allChartData;
23976
24164
  chartJSON.legendList = legendList;
@@ -24098,10 +24286,10 @@ const StackHorizontalChart = ({
24098
24286
  );
24099
24287
  return { props: seriesData[groupIndex]?.properties, groupIndex };
24100
24288
  };
24101
- const baseRects = rects.enter().append("rect").merge(rects).attr("y", (d) => yScale(d.data.dimension) - columnWidth / 2).attr("height", columnWidth).attr(
24102
- "fill",
24103
- (d, i, nodes) => getPropsForRect(nodes, i).props?.color || "gray"
24104
- ).attr("stroke", (d, i, nodes) => {
24289
+ const baseRects = rects.enter().append("rect").merge(rects).attr("y", (d) => yScale(d.data.dimension) - columnWidth / 2).attr("height", columnWidth).attr("fill", (d, i, nodes) => {
24290
+ const { props } = getPropsForRect(nodes, i);
24291
+ return colorScaleMap.get(props.legendUniqueId)?.(d.data[d.key]) ?? props?.color ?? "gray";
24292
+ }).attr("stroke", (d, i, nodes) => {
24105
24293
  const props = getPropsForRect(nodes, i).props;
24106
24294
  return props?.stackBorderStyle === 0 ? "none" : formatOptions.column.stackBorderVisibility ? props.stackBorderColor : "none";
24107
24295
  }).attr(
@@ -24132,7 +24320,7 @@ const StackHorizontalChart = ({
24132
24320
  },
24133
24321
  {
24134
24322
  key: "Legend",
24135
- value: d.key.includes("~$~") ? d.key.split("~$~")[1] : d.key
24323
+ value: d.properties.alias
24136
24324
  }
24137
24325
  ],
24138
24326
  formatOptions,
@@ -24508,6 +24696,7 @@ const NormalizedStackHorizontalBarChart = ({
24508
24696
  let innerHeight2;
24509
24697
  let width;
24510
24698
  let height;
24699
+ const colorScaleMap = /* @__PURE__ */ new Map();
24511
24700
  let svg;
24512
24701
  let gTag;
24513
24702
  let xScaleBottom;
@@ -24668,13 +24857,27 @@ const NormalizedStackHorizontalBarChart = ({
24668
24857
  const preProcessChartData = () => {
24669
24858
  const allChartData = [];
24670
24859
  const legendList = [];
24860
+ let seriesMaxValue = -Infinity;
24861
+ let seriesMinValue = Infinity;
24671
24862
  seriesData.forEach((series, index2) => {
24672
24863
  const prefixedLegend = `${index2}~$~${series.properties.legend}`;
24673
24864
  series.properties.legend = prefixedLegend;
24674
24865
  legendList.push(prefixedLegend);
24866
+ seriesMaxValue = -Infinity;
24867
+ seriesMinValue = Infinity;
24675
24868
  for (const point2 of series.data) {
24869
+ seriesMaxValue = Math.max(seriesMaxValue, point2.value);
24870
+ seriesMinValue = Math.min(seriesMinValue, point2.value);
24676
24871
  allChartData.push(point2);
24677
24872
  }
24873
+ if (series.properties.setColorScale) {
24874
+ colorScaleMap.set(
24875
+ series.properties.legendUniqueId,
24876
+ sequential().domain([seriesMinValue, seriesMaxValue]).interpolator(
24877
+ interpolateRgb$1(series.properties.startColor, series.properties.endColor)
24878
+ )
24879
+ );
24880
+ }
24678
24881
  });
24679
24882
  chartJSON.chartData = allChartData;
24680
24883
  chartJSON.legendList = legendList;
@@ -24783,10 +24986,10 @@ const NormalizedStackHorizontalBarChart = ({
24783
24986
  );
24784
24987
  return { props: seriesData[groupIndex]?.properties, groupIndex };
24785
24988
  };
24786
- const baseRects = rects.enter().append("rect").merge(rects).attr("y", (d) => yScale(d.data.dimension) - columnWidth / 2).attr("height", columnWidth).attr(
24787
- "fill",
24788
- (d, i, nodes) => getPropsForRect(nodes, i).props?.color || "gray"
24789
- ).attr("stroke", (d, i, nodes) => {
24989
+ const baseRects = rects.enter().append("rect").merge(rects).attr("y", (d) => yScale(d.data.dimension) - columnWidth / 2).attr("height", columnWidth).attr("fill", (d, i, nodes) => {
24990
+ const { props } = getPropsForRect(nodes, i);
24991
+ return colorScaleMap.get(props.legendUniqueId)?.(d.data[d.key]) ?? props?.color ?? "gray";
24992
+ }).attr("stroke", (d, i, nodes) => {
24790
24993
  const props = getPropsForRect(nodes, i).props;
24791
24994
  return props?.stackBorderStyle === 0 ? "none" : formatOptions.column.stackBorderVisibility ? props.stackBorderColor : "none";
24792
24995
  }).attr(
@@ -24817,7 +25020,7 @@ const NormalizedStackHorizontalBarChart = ({
24817
25020
  },
24818
25021
  {
24819
25022
  key: "Legend",
24820
- value: d.key.includes("~$~") ? d.key.split("~$~")[1] : d.key
25023
+ value: d.properties.alias
24821
25024
  }
24822
25025
  ],
24823
25026
  formatOptions,
@@ -24951,6 +25154,7 @@ const LayeredHorizontalBarChart = ({
24951
25154
  const dimensionList = data.DimensionList;
24952
25155
  const barChart = true;
24953
25156
  const isSecondaryAxisDrawn = false;
25157
+ const colorScaleMap = /* @__PURE__ */ new Map();
24954
25158
  let customYaxisMinValue = formatOptions.yAxisLabel.yAxisIntervalsVisibility ? parseFloat(formatOptions.yAxisLabel.yAxisMinText) : void 0;
24955
25159
  let customYaxisMaxValue = formatOptions.yAxisLabel.yAxisIntervalsVisibility ? parseFloat(formatOptions.yAxisLabel.yAxisMaxText) : void 0;
24956
25160
  let margin;
@@ -25134,13 +25338,27 @@ const LayeredHorizontalBarChart = ({
25134
25338
  let yMinLeft = Infinity;
25135
25339
  let yMaxRight = -Infinity;
25136
25340
  let yMinRight = Infinity;
25341
+ let seriesMaxValue = -Infinity;
25342
+ let seriesMinValue = Infinity;
25137
25343
  seriesData.forEach((series) => {
25138
25344
  legendList.push(series.properties.legendUniqueId);
25345
+ seriesMaxValue = -Infinity;
25346
+ seriesMinValue = Infinity;
25139
25347
  series.data.forEach((point2) => {
25140
25348
  allChartData.push(point2);
25349
+ seriesMaxValue = Math.max(seriesMaxValue, point2.value);
25350
+ seriesMinValue = Math.min(seriesMinValue, point2.value);
25141
25351
  yMaxLeft = Math.max(yMaxLeft, point2.value);
25142
25352
  yMinLeft = Math.min(yMinLeft, point2.value);
25143
25353
  });
25354
+ if (series.properties.setColorScale) {
25355
+ colorScaleMap.set(
25356
+ series.properties.legendUniqueId,
25357
+ sequential().domain([seriesMinValue, seriesMaxValue]).interpolator(
25358
+ interpolateRgb$1(series.properties.startColor, series.properties.endColor)
25359
+ )
25360
+ );
25361
+ }
25144
25362
  });
25145
25363
  chartJSON.chartData = allChartData;
25146
25364
  chartJSON.legendList = legendList;
@@ -25270,7 +25488,7 @@ const LayeredHorizontalBarChart = ({
25270
25488
  }).attr(
25271
25489
  "width",
25272
25490
  (d) => d.value > 0 ? customYaxisMaxValue && d.value > customYaxisMaxValue ? xScaleBottom(customYaxisMaxValue) - xScaleBottom(0) : xScaleBottom(d.value) - xScaleBottom(0) : Math.abs(xScaleBottom(0) - xScaleBottom(d.value))
25273
- ).attr("fill", data2.properties.color).attr(
25491
+ ).attr("fill", (d) => colorScaleMap.get(data2.properties.legendUniqueId)?.(d.value) ?? data2.properties.color).attr(
25274
25492
  "stroke-dasharray",
25275
25493
  (d) => d.stackBorderStyle === 2 ? "5,3" : "0"
25276
25494
  ).attr("stroke-width", (d) => `${d.stackBorderWidth}px`).attr(
@@ -25303,7 +25521,7 @@ const LayeredHorizontalBarChart = ({
25303
25521
  },
25304
25522
  {
25305
25523
  key: "Legend",
25306
- value: d.legend.includes("~$~") ? d.legend.split("~$~")[1] : d.legend
25524
+ value: data2.properties.alias
25307
25525
  }
25308
25526
  ],
25309
25527
  formatOptions,
@@ -26485,7 +26703,7 @@ const AreaChart = ({
26485
26703
  formatOptions.yAxisLabel.yAxisLabelDecimalPrecision
26486
26704
  )
26487
26705
  ).tickSize(
26488
- formatOptions.plotArea.gridLinesVisibility ? formatOptions.plotArea.gridLinesHorizontal ? -innerWidth2 + (seriesLabelWidth ? seriesLabelWidth : 0) : 0 : 0
26706
+ getHorizontalGridLinesTickSize(formatOptions, innerWidth2, seriesLabelWidth)
26489
26707
  ).tickValues(
26490
26708
  responsiveLablesObj.autoLabelFlag ? void 0 : responsiveLablesObj.yAxisLabelArray
26491
26709
  ).ticks(responsiveLablesObj.customTickValue).tickPadding(8).tickSizeOuter(0);
@@ -26515,7 +26733,7 @@ const AreaChart = ({
26515
26733
  };
26516
26734
  const getXAxis = () => {
26517
26735
  xAxis = axisBottom(xScale).tickSize(
26518
- formatOptions.plotArea.gridLinesVisibility ? formatOptions.plotArea.gridLinesVertical ? formatOptions.plotArea.gridLinesVertical ? -(dataTableHeight > 0 ? innerHeight2 - dataTableHeight : innerHeight2) : parseFloat(formatOptions.plotArea.ticksHeight) * ((dataTableHeight > 0 ? innerHeight2 - dataTableHeight : innerHeight2) / 100) * (formatOptions.xAxisLabel.xAxisPosition == "1" ? 1 : -1) : 0 : 0
26736
+ getVerticalGridLinesTickSize(formatOptions, innerHeight2, dataTableHeight, true)
26519
26737
  ).tickSizeOuter(0).tickValues(responsiveXaxisLabel(filteredDimension, innerWidth2));
26520
26738
  };
26521
26739
  const getChartType = (lineData) => {
@@ -27051,7 +27269,7 @@ const StackAreaChart = ({
27051
27269
  formatOptions.yAxisLabel.yAxisLabelDecimalPrecision
27052
27270
  )
27053
27271
  ).tickSize(
27054
- formatOptions.plotArea.gridLinesVisibility ? formatOptions.plotArea.gridLinesHorizontal ? -innerWidth2 + (seriesLabelWidth ? seriesLabelWidth : 0) : 0 : 0
27272
+ getHorizontalGridLinesTickSize(formatOptions, innerWidth2, seriesLabelWidth)
27055
27273
  ).tickValues(
27056
27274
  responsiveLablesObj.autoLabelFlag ? void 0 : responsiveLablesObj.yAxisLabelArray
27057
27275
  ).ticks(responsiveLablesObj.customTickValue).tickPadding(8).tickSizeOuter(0);
@@ -27059,7 +27277,7 @@ const StackAreaChart = ({
27059
27277
  };
27060
27278
  const getXAxis = () => {
27061
27279
  xAxis = axisBottom(xScale).tickSize(
27062
- formatOptions.plotArea.gridLinesVisibility ? formatOptions.plotArea.gridLinesVertical ? formatOptions.plotArea.gridLinesVertical ? -(dataTableHeight > 0 ? innerHeight2 - dataTableHeight : innerHeight2) : parseFloat(formatOptions.plotArea.ticksHeight) * ((dataTableHeight > 0 ? innerHeight2 - dataTableHeight : innerHeight2) / 100) * (formatOptions.xAxisLabel.xAxisPosition == "1" ? 1 : -1) : 0 : 0
27280
+ getVerticalGridLinesTickSize(formatOptions, innerHeight2, dataTableHeight, true)
27063
27281
  ).tickSizeOuter(0).tickValues(responsiveXaxisLabel(filteredDimension, innerWidth2));
27064
27282
  };
27065
27283
  const getChartType = (lineData) => {
@@ -27167,7 +27385,6 @@ const StackAreaChart = ({
27167
27385
  const drawLineChart = () => {
27168
27386
  getXScale();
27169
27387
  getXAxis();
27170
- getChartType(filteredData);
27171
27388
  initXaxis$1(
27172
27389
  gTag,
27173
27390
  chartJSON,
@@ -27185,6 +27402,7 @@ const StackAreaChart = ({
27185
27402
  filteredDimension,
27186
27403
  xScale
27187
27404
  );
27405
+ getChartType(filteredData);
27188
27406
  stacklineAnnotations(
27189
27407
  stackChartData,
27190
27408
  xScale,
@@ -27601,7 +27819,7 @@ const NormalizedStackAreaChart = ({
27601
27819
  const initAxis = () => {
27602
27820
  {
27603
27821
  yAxisLeft = axisLeft(yScaleLeft).tickSize(
27604
- formatOptions.plotArea.gridLinesVisibility ? formatOptions.plotArea.gridLinesHorizontal ? -innerWidth2 + (seriesLabelWidth ? seriesLabelWidth : 0) : 0 : 0
27822
+ getHorizontalGridLinesTickSize(formatOptions, innerWidth2, seriesLabelWidth)
27605
27823
  ).ticks(
27606
27824
  dataTableHeight > 0 ? (innerHeight2 - dataTableHeight) / 80 : innerHeight2 / 80,
27607
27825
  "%"
@@ -27610,7 +27828,7 @@ const NormalizedStackAreaChart = ({
27610
27828
  };
27611
27829
  const getXAxis = () => {
27612
27830
  xAxis = axisBottom(xScale).tickSize(
27613
- formatOptions.plotArea.gridLinesVisibility ? formatOptions.plotArea.gridLinesVertical ? formatOptions.plotArea.gridLinesVertical ? -(dataTableHeight > 0 ? innerHeight2 - dataTableHeight : innerHeight2) : parseFloat(formatOptions.plotArea.ticksHeight) * ((dataTableHeight > 0 ? innerHeight2 - dataTableHeight : innerHeight2) / 100) * (formatOptions.xAxisLabel.xAxisPosition == "1" ? 1 : -1) : 0 : 0
27831
+ getVerticalGridLinesTickSize(formatOptions, innerHeight2, dataTableHeight, true)
27614
27832
  ).tickSizeOuter(0).tickValues(responsiveXaxisLabel(filteredDimension, innerWidth2));
27615
27833
  };
27616
27834
  const getChartType = (lineData) => {
@@ -28331,7 +28549,7 @@ const PieChart = ({ data, formatOptions, chartId, isReportEditable }) => {
28331
28549
  ${value2}
28332
28550
  </span>`;
28333
28551
  }
28334
- if (chartFormatOptions.plotArea.plotAreaAbsoluteValue && d.data[0].value !== void 0) {
28552
+ if (chartFormatOptions.plotArea.plotAreaAbsoluteValue && d.data.data[0].value !== void 0) {
28335
28553
  htmlString += `<span style="
28336
28554
  font-size: ${d.data.properties.valueFontSize}px;
28337
28555
  color: ${d.data.properties.valueFontColor};
@@ -28340,7 +28558,7 @@ const PieChart = ({ data, formatOptions, chartId, isReportEditable }) => {
28340
28558
  font-weight: ${d.data.properties.valueFontStyle.includes(fontStyleOptions.bold) ? fontStyleOptions.bold : "300"};
28341
28559
  font-family: ${d.data.properties.valueFont};
28342
28560
  display: block;">
28343
- ${format(".2s")(d.data[0].value)}
28561
+ ${format(".2s")(d.data.data[0].value)}
28344
28562
  </span>`;
28345
28563
  }
28346
28564
  return htmlString;
@@ -28764,7 +28982,7 @@ const DonutChart = ({
28764
28982
  ${value2}
28765
28983
  </span>`;
28766
28984
  }
28767
- if (chartFormatOptions.plotArea.plotAreaAbsoluteValue && d.data[0].value !== void 0) {
28985
+ if (chartFormatOptions.plotArea.plotAreaAbsoluteValue && d.data.data[0].value !== void 0) {
28768
28986
  htmlString += `<span style="
28769
28987
  font-size: ${d.data.properties.valueFontSize}px;
28770
28988
  color: ${d.data.properties.valueFontColor};
@@ -28775,7 +28993,7 @@ const DonutChart = ({
28775
28993
  font-weight: ${d.data.properties.valueFontStyle.includes(fontStyleOptions.bold) ? fontStyleOptions.bold : "300"};
28776
28994
  font-family: ${d.data.properties.valueFont};
28777
28995
  display: block;">
28778
- ${format(".2s")(d.data[0].value)}
28996
+ ${format(".2s")(d.data.data[0].value)}
28779
28997
  </span>`;
28780
28998
  }
28781
28999
  return htmlString;
@@ -35319,8 +35537,9 @@ const SankeyChart = ({
35319
35537
  data,
35320
35538
  chartId
35321
35539
  }) => {
35322
- let sankeyLinks = JSON.parse(JSON.stringify(data.sankeyLinks));
35323
- let sankeyNodes = JSON.parse(JSON.stringify(data.sankeyNodes));
35540
+ let sankeyLinks = JSON.parse(JSON.stringify(data?.sankeyLinks));
35541
+ let sankeyNodes = JSON.parse(JSON.stringify(data?.sankeyNodes));
35542
+ if (!data) return null;
35324
35543
  const svgRef = useRef();
35325
35544
  let chartFormatOptions;
35326
35545
  let width;
@@ -54039,8 +54258,8 @@ const BubbleChart = ({
54039
54258
  formatOptions.xAxisLabel.xAxisLabelDecimalPrecision ?? "2"
54040
54259
  )
54041
54260
  ).tickSize(
54042
- getVerticalGridLinesTickSize(formatOptions, innerHeight2, 0)
54043
- ).tickValues(autoLabelFlag ? void 0 : xAxisLabelArray.length > 0 ? xAxisLabelArray : null).ticks(customTickValue).tickPadding(8).tickSizeOuter(0);
54261
+ getVerticalGridLinesTickSize(formatOptions, innerHeight2, 0, true)
54262
+ ).tickValues(xAxisLabelArray.length > 0 ? xAxisLabelArray : null).ticks(customTickValue).tickPadding(8).tickSizeOuter(0);
54044
54263
  initXaxis(
54045
54264
  chartAreaTagG,
54046
54265
  chartFormatOptions,
@@ -54073,7 +54292,7 @@ const BubbleChart = ({
54073
54292
  formatOptions.yAxisLabel.yAxisLabelDecimalPrecision ?? "2"
54074
54293
  )
54075
54294
  ).tickSize(
54076
- chartFormatOptions.plotArea.gridLinesVisibility ? chartFormatOptions.plotArea.gridLinesHorizontal ? -innerWidth2 : 0 : 0
54295
+ getHorizontalGridLinesTickSize(formatOptions, innerWidth2)
54077
54296
  ).tickValues(yAxisLabelArray.length > 0 ? yAxisLabelArray : null).ticks(customTickValue).tickPadding(8).tickSizeOuter(0);
54078
54297
  initYaxis(
54079
54298
  chartAreaTagG,
@@ -56064,9 +56283,668 @@ const TornadoChart = ({
56064
56283
  }
56065
56284
  ) });
56066
56285
  };
56286
+ const ClevelandDotPlot = ({
56287
+ isDateType,
56288
+ formatOptions,
56289
+ data,
56290
+ isReportEditable,
56291
+ onDataLabelCoordinatesChange
56292
+ }) => {
56293
+ const chartId = crypto.randomUUID();
56294
+ let columnWidth = 0;
56295
+ const chartType = chartTypes.ClevelandDotPlot;
56296
+ const svgRef = useRef();
56297
+ const seriesData = generalizedChartData(
56298
+ data.ChartData,
56299
+ data.DimensionList
56300
+ );
56301
+ const dimensionList = data.DimensionList;
56302
+ const barChart = true;
56303
+ const isSecondaryAxisDrawn = false;
56304
+ let customYaxisMinValue = formatOptions.yAxisLabel.yAxisIntervalsVisibility ? parseFloat(formatOptions.yAxisLabel.yAxisMinText) : void 0;
56305
+ let customYaxisMaxValue = formatOptions.yAxisLabel.yAxisIntervalsVisibility ? parseFloat(formatOptions.yAxisLabel.yAxisMaxText) : void 0;
56306
+ let margin;
56307
+ let yLabel;
56308
+ let xLabel;
56309
+ let yTitle;
56310
+ let xTitle;
56311
+ let dimensionHeightWidthArray;
56312
+ let chartTitleHeight;
56313
+ let secondaryAxisTitleWidth;
56314
+ let legendMargin;
56315
+ let secondaryYLabel;
56316
+ let maxNumberForPrimaryAxis;
56317
+ let maxNumberForSecondaryAxis;
56318
+ let innerWidth2;
56319
+ let innerHeight2;
56320
+ let width;
56321
+ let height;
56322
+ let svg;
56323
+ let gTag;
56324
+ let xScaleBottom;
56325
+ let yScale;
56326
+ let calculatedRange;
56327
+ let xAxisBottom;
56328
+ let yAxis;
56329
+ let filteredDimension;
56330
+ let filteredData = [];
56331
+ let scrollPosition = 0;
56332
+ let visibleBars = 2;
56333
+ let scrollbarVisible = false;
56334
+ let stackChartData = [];
56335
+ const isNormalizedChart = false;
56336
+ let chartJSON = {
56337
+ dimensionList,
56338
+ chartType,
56339
+ chartData: [],
56340
+ formatOptions,
56341
+ legendList: [],
56342
+ secondaryAxisDrawn: false,
56343
+ yMaxLeft: 0,
56344
+ yMaxRight: 0,
56345
+ yMinLeft: 0,
56346
+ yMinRight: 0,
56347
+ hideZeroValues: false,
56348
+ formattedDimensionListMap: /* @__PURE__ */ new Map()
56349
+ };
56350
+ useEffect(() => {
56351
+ try {
56352
+ createStackHorizontalBarChart();
56353
+ } catch (error) {
56354
+ logError$2(
56355
+ "StackStackHorizontalBarchart",
56356
+ "createStackHorizontalBarChart",
56357
+ error
56358
+ );
56359
+ }
56360
+ }, [formatOptions]);
56361
+ const createStackHorizontalBarChart = () => {
56362
+ ({ formatOptions, svg, width, height } = firstFunctionBeforeRender$1(
56363
+ svgRef,
56364
+ formatOptions
56365
+ ));
56366
+ preProcessChartData();
56367
+ ({ maxNumberForPrimaryAxis, maxNumberForSecondaryAxis } = customYscaleLabelFormatting$1(
56368
+ // for calculating primary/secondary axis max number so that we can calculate margin accordinglt
56369
+ formatOptions,
56370
+ chartJSON.yMinLeft,
56371
+ chartJSON.yMaxLeft,
56372
+ chartJSON.yMinRight,
56373
+ chartJSON.yMaxRight
56374
+ ));
56375
+ ({
56376
+ margin,
56377
+ yLabel,
56378
+ xLabel,
56379
+ yTitle,
56380
+ xTitle,
56381
+ dimensionHeightWidthArray,
56382
+ chartTitleHeight,
56383
+ secondaryAxisTitleWidth,
56384
+ legendMargin,
56385
+ secondaryYLabel,
56386
+ visibleBars,
56387
+ columnWidth,
56388
+ scrollbarVisible
56389
+ } = marginCalculation(
56390
+ // for all margin related calculations
56391
+ width,
56392
+ height,
56393
+ maxNumberForPrimaryAxis,
56394
+ maxNumberForSecondaryAxis,
56395
+ chartJSON.yMaxLeft,
56396
+ formatOptions,
56397
+ chartJSON.legendList,
56398
+ chartJSON.dimensionList,
56399
+ chartJSON.yMaxRight,
56400
+ isSecondaryAxisDrawn,
56401
+ isNormalizedChart,
56402
+ isDateType,
56403
+ barChart,
56404
+ chartJSON
56405
+ ));
56406
+ setSVGContainer(margin);
56407
+ initSvg$1(
56408
+ // for svg creation
56409
+ svg,
56410
+ width,
56411
+ height,
56412
+ formatOptions
56413
+ );
56414
+ gTag = initChartArea$1(svg, margin);
56415
+ initPlotArea(gTag, formatOptions, 0, innerWidth2, innerHeight2, chartType);
56416
+ initScale();
56417
+ initAxis();
56418
+ initXaxisBar(
56419
+ formatOptions,
56420
+ gTag,
56421
+ yLabel,
56422
+ innerHeight2,
56423
+ innerWidth2,
56424
+ xAxisBottom
56425
+ );
56426
+ setXaxistitle$1(
56427
+ formatOptions,
56428
+ barChart,
56429
+ svg,
56430
+ margin,
56431
+ xLabel,
56432
+ height,
56433
+ xTitle,
56434
+ chartJSON.chartType,
56435
+ yLabel,
56436
+ innerWidth2,
56437
+ innerHeight2
56438
+ );
56439
+ yAxistitle$1(
56440
+ innerHeight2,
56441
+ formatOptions,
56442
+ 0,
56443
+ barChart,
56444
+ svg,
56445
+ margin,
56446
+ yTitle,
56447
+ yLabel
56448
+ );
56449
+ setChartTitle(svg, formatOptions, width, chartTitleHeight);
56450
+ drawLegends(
56451
+ height,
56452
+ svg,
56453
+ dimensionHeightWidthArray,
56454
+ chartTitleHeight,
56455
+ width,
56456
+ legendMargin,
56457
+ formatOptions,
56458
+ seriesData,
56459
+ chartId,
56460
+ staticLegendShape.rectangle
56461
+ );
56462
+ horizontalScrollBar(
56463
+ seriesData,
56464
+ height,
56465
+ width,
56466
+ svg,
56467
+ margin,
56468
+ innerWidth2,
56469
+ scrollbarVisible,
56470
+ visibleBars,
56471
+ chartJSON,
56472
+ scrollPosition,
56473
+ false,
56474
+ setAndUpdateChartData,
56475
+ barChart
56476
+ );
56477
+ };
56478
+ const preProcessChartData = () => {
56479
+ const allChartData = [];
56480
+ const legendList = [];
56481
+ let formatedDimensionList = [];
56482
+ let yMaxLeft = -Infinity;
56483
+ let yMinLeft = Infinity;
56484
+ let yMaxRight = -Infinity;
56485
+ let yMinRight = Infinity;
56486
+ seriesData.forEach((series) => {
56487
+ legendList.push(series.properties.legendUniqueId);
56488
+ series.data.forEach((point2) => {
56489
+ allChartData.push(point2);
56490
+ yMaxLeft = Math.max(yMaxLeft, point2.value);
56491
+ yMinLeft = Math.min(yMinLeft, point2.value);
56492
+ });
56493
+ });
56494
+ chartJSON.chartData = allChartData;
56495
+ chartJSON.legendList = legendList;
56496
+ chartJSON.yMaxLeft = yMaxLeft;
56497
+ chartJSON.yMinLeft = yMinLeft > 0 ? 0 : yMinLeft;
56498
+ chartJSON.yMaxRight = yMaxRight;
56499
+ chartJSON.yMinRight = yMinRight;
56500
+ formatedDimensionList = isDateType ? setDateFormats(
56501
+ formatOptions.xAxisLabel.xAxisNumberFormat,
56502
+ chartJSON.dimensionList
56503
+ ).map((d) => d) : chartJSON.dimensionList;
56504
+ formatedDimensionList = isDateType ? setDateFormats(
56505
+ formatOptions.xAxisLabel.xAxisNumberFormat,
56506
+ chartJSON.dimensionList
56507
+ ).map((d) => d) : chartJSON.dimensionList;
56508
+ chartJSON.dimensionList.forEach((dim, i) => {
56509
+ chartJSON.formattedDimensionListMap.set(dim, formatedDimensionList[i]);
56510
+ chartJSON.formattedDimensionListMap.set(dim, formatedDimensionList[i]);
56511
+ });
56512
+ filteredData = JSON.parse(JSON.stringify(seriesData));
56513
+ if (!formatOptions.plotArea.fitChart) {
56514
+ filteredDimension = chartJSON.dimensionList.slice(
56515
+ scrollPosition,
56516
+ scrollPosition + visibleBars
56517
+ );
56518
+ } else {
56519
+ filteredDimension = chartJSON.dimensionList;
56520
+ }
56521
+ if (formatOptions.plotArea.hideZeroValues) {
56522
+ chartJSON.hideZeroValues = true;
56523
+ }
56524
+ };
56525
+ const initScale = () => {
56526
+ let yAxisLabelArray = responsiveYaxisLabel$1(
56527
+ customYaxisMaxValue ? customYaxisMaxValue : chartJSON.yMaxLeft,
56528
+ chartJSON.yMinLeft,
56529
+ innerHeight2,
56530
+ formatOptions,
56531
+ chartJSON,
56532
+ customYaxisMinValue,
56533
+ customYaxisMaxValue,
56534
+ barChart,
56535
+ innerWidth2
56536
+ ).yAxisLabelArray;
56537
+ chartJSON.yMaxLeft = yAxisLabelArray[yAxisLabelArray.length - 1];
56538
+ chartJSON.yMinLeft = yAxisLabelArray[0];
56539
+ {
56540
+ xScaleBottom = linear$1().domain([
56541
+ chartJSON.yMinLeft >= 0 ? customYaxisMinValue !== void 0 && !Number.isNaN(customYaxisMinValue) ? customYaxisMinValue : 0 : chartJSON.yMinLeft < 0 ? chartJSON.yMinLeft * 1.1 : chartJSON.yMinLeft * 0.9,
56542
+ chartJSON.yMaxLeft <= 0 ? 0 : customYaxisMaxValue !== void 0 && !Number.isNaN(customYaxisMaxValue) ? customYaxisMaxValue : chartJSON.yMaxLeft * 1.1
56543
+ ]).range([0, innerWidth2]);
56544
+ }
56545
+ calculatedRange = [innerHeight2, 0];
56546
+ getYScale();
56547
+ };
56548
+ const getYScale = () => {
56549
+ band().domain(["layeredLegend"]).range([0, columnWidth]).paddingInner(
56550
+ chartJSON.legendList.length > 1 ? 0.3 * parseFloat(formatOptions.plotArea.plotAreaSeriesWidth) / 100 : 0
56551
+ );
56552
+ yScale = point$7().domain(filteredDimension).range(calculatedRange).padding(0.5);
56553
+ };
56554
+ const initAxis = () => {
56555
+ getYAxis();
56556
+ {
56557
+ let responsiveLablesObj = responsiveYaxisLabel$1(
56558
+ customYaxisMaxValue ? customYaxisMaxValue : chartJSON.yMaxLeft,
56559
+ chartJSON.yMinLeft,
56560
+ innerHeight2,
56561
+ formatOptions,
56562
+ chartJSON,
56563
+ customYaxisMinValue,
56564
+ customYaxisMaxValue,
56565
+ barChart,
56566
+ innerWidth2
56567
+ );
56568
+ xAxisBottom = axisBottom(xScaleBottom).tickFormat(
56569
+ (d) => getNumberWithFormat(
56570
+ d,
56571
+ formatOptions.yAxisLabel.yAxisDisplayUnits,
56572
+ formatOptions.yAxisLabel.yAxisNumberFormat,
56573
+ formatOptions.yAxisLabel.yAxisLabelDecimalPrecision
56574
+ )
56575
+ ).tickSize(
56576
+ formatOptions.plotArea.gridLinesVisibility ? formatOptions.plotArea.gridLinesHorizontal ? -innerHeight2 : 0 : 0
56577
+ ).tickValues(
56578
+ responsiveLablesObj.autoLabelFlag ? void 0 : responsiveLablesObj.yAxisLabelArray
56579
+ ).ticks(responsiveLablesObj.customTickValue).tickPadding(8).tickSizeOuter(0);
56580
+ }
56581
+ };
56582
+ const getYAxis = () => {
56583
+ yAxis = axisLeft(yScale).tickSize(
56584
+ formatOptions.plotArea.gridLinesVisibility ? formatOptions.plotArea.gridLinesHorizontal ? parseFloat(formatOptions.plotArea.ticksHeight) * innerWidth2 * (formatOptions.xAxisLabel.xAxisPosition == "1" ? 1 : -1) * 0.01 : 0 : 0
56585
+ ).tickSizeOuter(0).tickValues(responsiveXaxisLabel(filteredDimension, innerHeight2));
56586
+ };
56587
+ const getChartType = (lineData) => {
56588
+ lineData.forEach((lData) => {
56589
+ lData.data.forEach((cData) => {
56590
+ cData.hideZero = lData.properties.hideZeroValues;
56591
+ cData.axis = lData.properties.axis;
56592
+ cData["properties"] = lData.properties;
56593
+ });
56594
+ });
56595
+ lineData.forEach((data2, index2) => {
56596
+ let column = gTag.selectAll(".parentGroup").data([data2], (d) => d.properties.legendUniqueId);
56597
+ column = column.enter().append("g").attr("class", `column parentGroup`).merge(column);
56598
+ let columnGroups = column.selectAll(".column-group").data(data2.data, (d) => d.dimension);
56599
+ let columnGroupsEnter = columnGroups.enter().append("g").attr("class", "column-group").attr(
56600
+ "hoverId",
56601
+ (data2.properties.alias || data2.properties.name || "Legend").replace(
56602
+ /\s+/g,
56603
+ "-"
56604
+ )
56605
+ ).attr(
56606
+ "transform",
56607
+ (d) => `translate(0,${yScale(d.dimension)})`
56608
+ );
56609
+ columnGroupsEnter.merge(columnGroups).attr(
56610
+ "transform",
56611
+ (d) => `translate(0,${yScale(d.dimension)})`
56612
+ );
56613
+ columnGroupsEnter.append("line").attr("class", "cleveland-line").attr("x1", (d) => xScaleBottom(0)).attr("x2", (d) => xScaleBottom(d.value)).attr("y1", 0).attr("y2", 0).attr("stroke", "#c7c7c7").attr("stroke-width", 2);
56614
+ columnGroupsEnter.append("circle").attr("class", "cleveland-dot").attr("cx", (d) => xScaleBottom(d.value)).attr("cy", 0).attr("r", 6).attr("fill", data2.properties.color).attr("opacity", 0.9).on("mousemove", (event2, d) => {
56615
+ showTooltipOnMouseMove(
56616
+ [
56617
+ {
56618
+ key: formatOptions.xAxisTitle.xAxisTitleText,
56619
+ value: chartJSON.formattedDimensionListMap.get(d.dimension)
56620
+ },
56621
+ {
56622
+ key: formatOptions.yAxisTitle.yAxisTitleText,
56623
+ value: getNumberWithFormat(
56624
+ d.value,
56625
+ formatOptions.toolTip.toolTipDisplayUnits,
56626
+ formatOptions.toolTip.toolTipNumberFormat,
56627
+ formatOptions.toolTip.toolTipDecimalPrecision
56628
+ )
56629
+ },
56630
+ {
56631
+ key: "Legend",
56632
+ value: d.legend
56633
+ }
56634
+ ],
56635
+ formatOptions,
56636
+ event2,
56637
+ data2.properties
56638
+ );
56639
+ let legend = (data2.properties.alias || data2.properties.name || "Legend").replace(/ /g, "-");
56640
+ selectAll(".parentGroup").classed("highlight", false).classed("unhighlight", true);
56641
+ selectAll('[hoverId="' + legend + '"]').classed("highlight", true).classed("unhighlight", false);
56642
+ }).on("mouseout", () => {
56643
+ selectAll(".parentGroup").classed("highlight", false).classed("unhighlight", false);
56644
+ hideTooltipOnMouseOut();
56645
+ });
56646
+ columnGroups.exit().remove();
56647
+ });
56648
+ gTag.selectAll(".parentGroup").raise();
56649
+ };
56650
+ const setSVGContainer = (margin2) => {
56651
+ innerWidth2 = width - margin2.left - margin2.right;
56652
+ innerHeight2 = height - margin2.bottom - margin2.top;
56653
+ };
56654
+ const setAndUpdateChartData = (fDimension, fData, fVisibleBars) => {
56655
+ filteredData = fData;
56656
+ filteredDimension = fDimension;
56657
+ visibleBars = fVisibleBars;
56658
+ drawLineChart();
56659
+ };
56660
+ const drawLineChart = () => {
56661
+ getYScale();
56662
+ getYAxis();
56663
+ initYaxisBar(
56664
+ formatOptions,
56665
+ gTag,
56666
+ xLabel,
56667
+ innerHeight2,
56668
+ innerWidth2,
56669
+ yAxis,
56670
+ void 0,
56671
+ xScaleBottom,
56672
+ chartJSON.yMaxLeft,
56673
+ filteredDimension,
56674
+ chartType,
56675
+ isDateType,
56676
+ width,
56677
+ dimensionHeightWidthArray,
56678
+ columnWidth,
56679
+ yScale
56680
+ );
56681
+ createStackLineData();
56682
+ getChartType(filteredData);
56683
+ commonAnnotations(
56684
+ filteredData,
56685
+ yScale,
56686
+ xScaleBottom,
56687
+ void 0,
56688
+ // need to pass secondary axis scale if secondary axis is drawn
56689
+ margin,
56690
+ d3Annotation,
56691
+ [],
56692
+ //this.labelExcludeList,
56693
+ [],
56694
+ //this.individualLabelColor,
56695
+ // [], //this.attributes.Id ? formatOptions.plotArea.dataLabelsCoordinates : this.parentReference.objService.tempAnnotationArray
56696
+ formatOptions,
56697
+ chartType,
56698
+ height,
56699
+ width,
56700
+ innerWidth2,
56701
+ filteredDimension,
56702
+ innerHeight2,
56703
+ chartId,
56704
+ svg,
56705
+ onDataLabelCoordinatesChange,
56706
+ yScale,
56707
+ columnWidth,
56708
+ false,
56709
+ isReportEditable,
56710
+ barChart
56711
+ );
56712
+ getConnectors();
56713
+ };
56714
+ const createStackLineData = () => {
56715
+ let stackLineData2 = getStackedData(
56716
+ filteredDimension,
56717
+ filteredData,
56718
+ isNormalizedChart
56719
+ );
56720
+ stackChartData = stack().keys(chartJSON.legendList).offset(diverging)(stackLineData2);
56721
+ filteredData.forEach(
56722
+ (data2, index2) => data2.data.forEach((axisData, position) => {
56723
+ axisData["0"] = stackChartData[index2][position][0];
56724
+ axisData["1"] = stackChartData[index2][position][1];
56725
+ })
56726
+ );
56727
+ let seriesColor = formatOptions.annotation.annotationSetLabelColor;
56728
+ stackChartData.forEach(
56729
+ (K2, j) => K2.forEach((d) => {
56730
+ d["key"] = K2.key;
56731
+ K2["color"] = JSON.parse(JSON.stringify(seriesData[j].properties.color));
56732
+ d.data.labelPosition = seriesData[j].properties.dataLabelPosition;
56733
+ d.data["labelColor"] = seriesColor == "2" ? JSON.parse(JSON.stringify(seriesData[j].properties.color)) : seriesData[j].properties.labelColor;
56734
+ d["hideZero"] = JSON.parse(
56735
+ JSON.stringify(seriesData[j].properties.hideZeroValues)
56736
+ );
56737
+ })
56738
+ );
56739
+ };
56740
+ const getConnectors = () => {
56741
+ try {
56742
+ const connectorVisibility = Number(
56743
+ formatOptions.connector?.connectorVisibility
56744
+ );
56745
+ if (!formatOptions.connector || connectorVisibility === 2) return;
56746
+ const pathLineData = [];
56747
+ const nextBarHeight = [];
56748
+ const xaxisLabelExcludeList = [];
56749
+ let stepSize;
56750
+ const heightArray = [];
56751
+ if (connectorVisibility === 1) {
56752
+ stepSize = 1;
56753
+ } else if (connectorVisibility === 3) {
56754
+ const follow = Number(formatOptions.connector.connectorFollow);
56755
+ if (follow === 1)
56756
+ stepSize = Number(formatOptions.connector.connectorStepSize);
56757
+ else if (follow === 2) {
56758
+ (formatOptions.connector.connectorExclude || []).forEach(
56759
+ (e) => xaxisLabelExcludeList.push(e)
56760
+ );
56761
+ stepSize = 1;
56762
+ }
56763
+ }
56764
+ const connectorLabelExcludeList = [];
56765
+ const differenceBarData = [];
56766
+ const totalDifference = [];
56767
+ const customLabelShowList = formatOptions.connector?.connectorCustomRange || [];
56768
+ xaxisLabelExcludeList.forEach((ele) => {
56769
+ const sub = ele.split("-");
56770
+ if (sub.length) connectorLabelExcludeList.push(sub[0]);
56771
+ });
56772
+ const stack0 = stackChartData?.[0] || [];
56773
+ const lineData = stack0.map((d, i) => ({
56774
+ Dimension: d.data.Dimension,
56775
+ Total: d.data.Total,
56776
+ CustomTotal: d.data.Total - (totalDifference[i] ?? 0),
56777
+ Index: i
56778
+ }));
56779
+ if (stepSize != null) {
56780
+ for (let i = 0; i < lineData.length; i++) {
56781
+ if (stepSize === 1 || i % stepSize === 0 && stepSize !== 1)
56782
+ pathLineData.push(lineData[i]);
56783
+ }
56784
+ for (let i = stepSize; i < lineData.length; i += stepSize) {
56785
+ const end = Math.min(i + stepSize, lineData.length);
56786
+ let maxH = -Infinity;
56787
+ for (let j = i; j < end; j++) {
56788
+ if (lineData[j].Total > maxH) maxH = lineData[j].Total;
56789
+ }
56790
+ if (maxH !== -Infinity) heightArray.push(maxH);
56791
+ }
56792
+ for (let i = 1; i < pathLineData.length; i++)
56793
+ nextBarHeight.push(pathLineData[i]);
56794
+ } else {
56795
+ const validPairs = [];
56796
+ (customLabelShowList || []).forEach((k2) => {
56797
+ if (k2?.from && k2?.to) {
56798
+ const startExists = lineData.some((ld) => ld.Dimension === k2.from);
56799
+ const endExists = lineData.some((ld) => ld.Dimension === k2.to);
56800
+ if (startExists && endExists)
56801
+ validPairs.push({ from: k2.from, to: k2.to });
56802
+ }
56803
+ });
56804
+ validPairs.forEach((pair) => {
56805
+ const startIndex = lineData.findIndex(
56806
+ (ld) => ld.Dimension === pair.from
56807
+ );
56808
+ const endIndex = lineData.findIndex((ld) => ld.Dimension === pair.to);
56809
+ if (startIndex >= 0 && endIndex >= 0) {
56810
+ const s2 = Math.min(startIndex, endIndex);
56811
+ const e = Math.max(startIndex, endIndex);
56812
+ pathLineData.push(lineData[s2]);
56813
+ let maxH = lineData[s2]?.Total ?? -Infinity;
56814
+ for (let j = s2; j <= e; j++) {
56815
+ if (lineData[j].Total > maxH) maxH = lineData[j].Total;
56816
+ }
56817
+ if (maxH !== -Infinity) heightArray.push(maxH);
56818
+ nextBarHeight.push(lineData[e]);
56819
+ }
56820
+ });
56821
+ }
56822
+ gTag.append("defs").append("marker").attr("id", "arrow").attr("viewBox", "0 0 10 10").attr("refX", 5).attr("refY", 5).attr("markerWidth", 10).attr("markerHeight", 7).attr("orient", "auto").append("path").attr("d", "M 0 0 L 10 5 L 0 10 z").style(
56823
+ "fill",
56824
+ formatOptions.connector.connectorMarkerColor !== commonColors.white ? formatOptions.connector.connectorMarkerColor : "none"
56825
+ );
56826
+ getConnectorPath(
56827
+ pathLineData,
56828
+ heightArray,
56829
+ nextBarHeight,
56830
+ stepSize,
56831
+ connectorLabelExcludeList
56832
+ );
56833
+ getConnectorTextAddition(
56834
+ pathLineData,
56835
+ heightArray,
56836
+ nextBarHeight,
56837
+ stepSize,
56838
+ connectorLabelExcludeList
56839
+ );
56840
+ } catch (e) {
56841
+ console.error(e);
56842
+ }
56843
+ };
56844
+ const getConnectorPath = (pathLineData, heightArray, nextBarHeight, stepSize, connectorLabelExcludeList) => {
56845
+ try {
56846
+ gTag.append("g").selectAll("path").data(pathLineData).enter().filter(
56847
+ (d, i) => stepSize != null ? i < pathLineData.length - 1 : i < pathLineData.length
56848
+ ).append("path").attr(
56849
+ "d",
56850
+ (d, i) => formatOptions.total.totalVisibility ? `M ${xScaleBottom(d.Total) + 50},
56851
+ ${yScale(d.Dimension) + yScale.bandwidth() / 2 - 5}
56852
+ H ${60 + Math.max(
56853
+ xScaleBottom(heightArray[i]),
56854
+ xScaleBottom(nextBarHeight[i].Total),
56855
+ xScaleBottom(d.Total)
56856
+ )}
56857
+ V ${yScale(nextBarHeight[i].Dimension) + yScale.bandwidth() / 2 + 5}
56858
+ H ${30 + xScaleBottom(nextBarHeight[i].Total)}` : `M ${xScaleBottom(d.Total) + 30},
56859
+ ${yScale(d.Dimension) + yScale.bandwidth() / 2 - 5}
56860
+ H ${45 + Math.max(
56861
+ xScaleBottom(heightArray[i]),
56862
+ xScaleBottom(nextBarHeight[i].Total),
56863
+ xScaleBottom(d.Total)
56864
+ )}
56865
+ V ${yScale(nextBarHeight[i].Dimension) + yScale.bandwidth() / 2 + 5}
56866
+ H ${10 + xScaleBottom(nextBarHeight[i].Total)}
56867
+ `
56868
+ ).style(
56869
+ "stroke",
56870
+ formatOptions.connector.connectorLineColor !== commonColors.white ? formatOptions.connector.connectorLineColor : "none"
56871
+ ).attr("fill", "none").attr("stroke-width", formatOptions.connector.connectorLineThickness).attr("marker-end", "url(#arrow)").style(
56872
+ "visibility",
56873
+ (d) => connectorLabelExcludeList.includes(d.Dimension) || d.Total == 0 && formatOptions.yAxisLabel.hideZeroValues ? "hidden" : "visible"
56874
+ );
56875
+ } catch (e) {
56876
+ console.error(e);
56877
+ }
56878
+ };
56879
+ const getConnectorTextAddition = (pathLineData, heightArray, nextBarHeight, stepSize, connectorLabelExcludeList) => {
56880
+ try {
56881
+ let fontStyle = formatOptions.connector.connectorFontStyle;
56882
+ let numberFormat = formatOptions.connector.connectorNumberFormat;
56883
+ let tickCount = innerHeight2 / 30 < filteredDimension.length ? Math.round(innerHeight2 / 30) : filteredDimension.length;
56884
+ if (formatOptions.connector.connectorKPI == "2" || formatOptions.connector.connectorKPI == "3") {
56885
+ numberFormat = ".2s";
56886
+ }
56887
+ gTag.append("g").selectAll("text1").data(pathLineData).enter().filter(
56888
+ (d, i) => stepSize != null ? i < pathLineData.length - 1 : i < pathLineData.length
56889
+ ).append("text").attr(
56890
+ "y",
56891
+ (d, i) => stepSize == null ? yScale(nextBarHeight[i].Dimension) / 2 + yScale(d.Dimension) / 2 + 15 : stepSize == 1 ? tickCount < 6 && yScale.bandwidth() > 40 ? yScale(nextBarHeight[i].Dimension) + yScale.bandwidth() / 2 + yScale.bandwidth() / 2 + 13 : yScale(nextBarHeight[i].Dimension) + yScale.bandwidth() / 2 + yScale.bandwidth() / 2 + 7 : yScale(nextBarHeight[i].Dimension) + yScale.bandwidth() / 2 + yScale.bandwidth() / 2 * stepSize + 12
56892
+ ).attr(
56893
+ "x",
56894
+ (d, i) => formatOptions.total.totalVisibility ? 70 + Math.max(
56895
+ xScaleBottom(heightArray[i]),
56896
+ xScaleBottom(nextBarHeight[i].Total),
56897
+ xScaleBottom(d.Total)
56898
+ ) : 50 + Math.max(
56899
+ xScaleBottom(heightArray[i]),
56900
+ xScaleBottom(nextBarHeight[i].Total),
56901
+ xScaleBottom(d.Total)
56902
+ )
56903
+ ).text((d, i) => {
56904
+ if (d.CustomTotal == 0 && nextBarHeight[i].CustomTotal != 0) {
56905
+ d.CustomTotal = 1;
56906
+ }
56907
+ return connectorNumberFormat(
56908
+ // legendExcludeList.length == 0 ?
56909
+ nextBarHeight[i].Total,
56910
+ // : nextBarHeight[i].CustomTotal,
56911
+ // legendExcludeList.length == 0 ?
56912
+ d.Total,
56913
+ // : d.CustomTotal,
56914
+ parseInt(formatOptions.connector.connectorDecimalPrecision),
56915
+ numberFormat,
56916
+ parseInt(d.Dimension),
56917
+ parseInt(nextBarHeight[i].Dimension),
56918
+ formatOptions
56919
+ );
56920
+ }).attr("text-anchor", "start").style("font-size", formatOptions.connector.connectorFontSize).style("font-family", formatOptions.connector.connectorFontFamily).style("font-style", formatOptions.connector.connectorFontStyle).style(
56921
+ "fill",
56922
+ formatOptions.connector.connectorFontColor !== commonColors.white ? formatOptions.connector.connectorFontColor : "none"
56923
+ ).style("font-weight", "lighter").style("font-style", fontStyle.includes("Italic") ? "Italic" : "").style(
56924
+ "text-decoration",
56925
+ fontStyle.includes("Underline") ? "Underline" : ""
56926
+ ).style("font-weight", fontStyle.includes("Bold") ? "Bold" : "").style(
56927
+ "visibility",
56928
+ (d) => connectorLabelExcludeList.includes(d.Dimension) || d.Total == 0 && formatOptions.yAxisLabel.hideZeroValues ? "hidden" : "visible"
56929
+ );
56930
+ } catch (e) {
56931
+ console.error(e);
56932
+ }
56933
+ };
56934
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
56935
+ "svg",
56936
+ {
56937
+ className: "chartSVG",
56938
+ ref: svgRef,
56939
+ id: chartId,
56940
+ style: { width: "100%", height: "100%" }
56941
+ }
56942
+ ) });
56943
+ };
56067
56944
  export {
56068
56945
  AreaChart,
56069
56946
  BubbleChart,
56947
+ ClevelandDotPlot,
56070
56948
  ColumnChart,
56071
56949
  ColumnHistogramChart,
56072
56950
  CustomColumnChart,