pace-chart-lib 1.0.56 → 1.0.57

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.
@@ -2395,7 +2395,7 @@
2395
2395
  }
2396
2396
  }));
2397
2397
  const constant$9 = (x2) => () => x2;
2398
- function linear$2(a2, d) {
2398
+ function linear$3(a2, d) {
2399
2399
  return function(t) {
2400
2400
  return a2 + t * d;
2401
2401
  };
@@ -2412,7 +2412,7 @@
2412
2412
  }
2413
2413
  function nogamma$1(a2, b) {
2414
2414
  var d = b - a2;
2415
- return d ? linear$2(a2, d) : constant$9(isNaN(a2) ? b : a2);
2415
+ return d ? linear$3(a2, d) : constant$9(isNaN(a2) ? b : a2);
2416
2416
  }
2417
2417
  const interpolateRgb$1 = (function rgbGamma(y2) {
2418
2418
  var color2 = gamma$1(y2);
@@ -2637,7 +2637,7 @@
2637
2637
  ];
2638
2638
  };
2639
2639
  } else {
2640
- var d1 = Math.sqrt(d2), b0 = (w1 * w1 - w0 * w0 + rho4 * d2) / (2 * w0 * rho2 * d1), b1 = (w1 * w1 - w0 * w0 - rho4 * d2) / (2 * w1 * rho2 * d1), r0 = Math.log(Math.sqrt(b0 * b0 + 1) - b0), r1 = Math.log(Math.sqrt(b1 * b1 + 1) - b1);
2640
+ var d1 = Math.sqrt(d2), b02 = (w1 * w1 - w0 * w0 + rho4 * d2) / (2 * w0 * rho2 * d1), b12 = (w1 * w1 - w0 * w0 - rho4 * d2) / (2 * w1 * rho2 * d1), r0 = Math.log(Math.sqrt(b02 * b02 + 1) - b02), r1 = Math.log(Math.sqrt(b12 * b12 + 1) - b12);
2641
2641
  S = (r1 - r0) / rho;
2642
2642
  i = function(t) {
2643
2643
  var s2 = t * S, coshr0 = cosh(r0), u = w0 / (rho2 * d1) * (coshr0 * tanh(rho * s2 + r0) - sinh(r0));
@@ -3361,12 +3361,48 @@
3361
3361
  end: transition_end$1,
3362
3362
  [Symbol.iterator]: selection_prototype$1[Symbol.iterator]
3363
3363
  };
3364
+ const linear$2 = (t) => +t;
3365
+ function cubicIn(t) {
3366
+ return t * t * t;
3367
+ }
3368
+ function cubicOut(t) {
3369
+ return --t * t * t + 1;
3370
+ }
3364
3371
  function cubicInOut$1(t) {
3365
3372
  return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2;
3366
3373
  }
3367
3374
  function tpmt(x2) {
3368
3375
  return (Math.pow(2, -10 * x2) - 9765625e-10) * 1.0009775171065494;
3369
3376
  }
3377
+ var b1 = 4 / 11, b2 = 6 / 11, b3 = 8 / 11, b4 = 3 / 4, b5 = 9 / 11, b6 = 10 / 11, b7 = 15 / 16, b8 = 21 / 22, b9 = 63 / 64, b0 = 1 / b1 / b1;
3378
+ function bounceOut(t) {
3379
+ return (t = +t) < b1 ? b0 * t * t : t < b3 ? b0 * (t -= b2) * t + b4 : t < b6 ? b0 * (t -= b5) * t + b7 : b0 * (t -= b8) * t + b9;
3380
+ }
3381
+ var overshoot = 1.70158;
3382
+ (function custom(s2) {
3383
+ s2 = +s2;
3384
+ function backIn(t) {
3385
+ return (t = +t) * t * (s2 * (t - 1) + t);
3386
+ }
3387
+ backIn.overshoot = custom;
3388
+ return backIn;
3389
+ })(overshoot);
3390
+ var backOut = (function custom(s2) {
3391
+ s2 = +s2;
3392
+ function backOut2(t) {
3393
+ return --t * t * ((t + 1) * s2 + t) + 1;
3394
+ }
3395
+ backOut2.overshoot = custom;
3396
+ return backOut2;
3397
+ })(overshoot);
3398
+ (function custom(s2) {
3399
+ s2 = +s2;
3400
+ function backInOut(t) {
3401
+ return ((t *= 2) < 1 ? t * t * ((s2 + 1) * t - s2) : (t -= 2) * t * ((s2 + 1) * t + s2) + 2) / 2;
3402
+ }
3403
+ backInOut.overshoot = custom;
3404
+ return backInOut;
3405
+ })(overshoot);
3370
3406
  var tau$5 = 2 * Math.PI, amplitude = 1, period = 0.3;
3371
3407
  (function custom(a2, p) {
3372
3408
  var s2 = Math.asin(1 / (a2 = Math.max(1, a2))) * (p /= tau$5);
@@ -4397,12 +4433,12 @@
4397
4433
  function polygonInside() {
4398
4434
  var winding = 0;
4399
4435
  for (var i = 0, n = polygon.length; i < n; ++i) {
4400
- for (var ring2 = polygon[i], j = 1, m = ring2.length, point3 = ring2[0], a0, a1, b0 = point3[0], b1 = point3[1]; j < m; ++j) {
4401
- a0 = b0, a1 = b1, point3 = ring2[j], b0 = point3[0], b1 = point3[1];
4436
+ for (var ring2 = polygon[i], j = 1, m = ring2.length, point3 = ring2[0], a0, a1, b02 = point3[0], b12 = point3[1]; j < m; ++j) {
4437
+ a0 = b02, a1 = b12, point3 = ring2[j], b02 = point3[0], b12 = point3[1];
4402
4438
  if (a1 <= y12) {
4403
- if (b1 > y12 && (b0 - a0) * (y12 - a1) > (b1 - a1) * (x02 - a0)) ++winding;
4439
+ if (b12 > y12 && (b02 - a0) * (y12 - a1) > (b12 - a1) * (x02 - a0)) ++winding;
4404
4440
  } else {
4405
- if (b1 <= y12 && (b0 - a0) * (y12 - a1) < (b1 - a1) * (x02 - a0)) --winding;
4441
+ if (b12 <= y12 && (b02 - a0) * (y12 - a1) < (b12 - a1) * (x02 - a0)) --winding;
4406
4442
  }
4407
4443
  }
4408
4444
  }
@@ -4876,19 +4912,19 @@
4876
4912
  });
4877
4913
  }
4878
4914
  function resample$1(project, delta2) {
4879
- function resampleLineTo(x02, y02, lambda0, a0, b0, c0, x12, y12, lambda1, a1, b1, c1, depth, stream) {
4915
+ function resampleLineTo(x02, y02, lambda0, a0, b02, c0, x12, y12, lambda1, a1, b12, c1, depth, stream) {
4880
4916
  var dx = x12 - x02, dy = y12 - y02, d2 = dx * dx + dy * dy;
4881
4917
  if (d2 > 4 * delta2 && depth--) {
4882
- var a2 = a0 + a1, b = b0 + b1, c2 = c0 + c1, m = sqrt$1(a2 * a2 + b * b + c2 * c2), phi2 = asin$2(c2 /= m), lambda2 = abs$1(abs$1(c2) - 1) < epsilon$3 || abs$1(lambda0 - lambda1) < epsilon$3 ? (lambda0 + lambda1) / 2 : atan2$1(b, a2), p = project(lambda2, phi2), x2 = p[0], y2 = p[1], dx2 = x2 - x02, dy2 = y2 - y02, dz = dy * dx2 - dx * dy2;
4883
- if (dz * dz / d2 > delta2 || abs$1((dx * dx2 + dy * dy2) / d2 - 0.5) > 0.3 || a0 * a1 + b0 * b1 + c0 * c1 < cosMinDistance) {
4884
- resampleLineTo(x02, y02, lambda0, a0, b0, c0, x2, y2, lambda2, a2 /= m, b /= m, c2, depth, stream);
4918
+ var a2 = a0 + a1, b = b02 + b12, c2 = c0 + c1, m = sqrt$1(a2 * a2 + b * b + c2 * c2), phi2 = asin$2(c2 /= m), lambda2 = abs$1(abs$1(c2) - 1) < epsilon$3 || abs$1(lambda0 - lambda1) < epsilon$3 ? (lambda0 + lambda1) / 2 : atan2$1(b, a2), p = project(lambda2, phi2), x2 = p[0], y2 = p[1], dx2 = x2 - x02, dy2 = y2 - y02, dz = dy * dx2 - dx * dy2;
4919
+ if (dz * dz / d2 > delta2 || abs$1((dx * dx2 + dy * dy2) / d2 - 0.5) > 0.3 || a0 * a1 + b02 * b12 + c0 * c1 < cosMinDistance) {
4920
+ resampleLineTo(x02, y02, lambda0, a0, b02, c0, x2, y2, lambda2, a2 /= m, b /= m, c2, depth, stream);
4885
4921
  stream.point(x2, y2);
4886
- resampleLineTo(x2, y2, lambda2, a2, b, c2, x12, y12, lambda1, a1, b1, c1, depth, stream);
4922
+ resampleLineTo(x2, y2, lambda2, a2, b, c2, x12, y12, lambda1, a1, b12, c1, depth, stream);
4887
4923
  }
4888
4924
  }
4889
4925
  }
4890
4926
  return function(stream) {
4891
- var lambda00, x002, y002, a00, b00, c00, lambda0, x02, y02, a0, b0, c0;
4927
+ var lambda00, x002, y002, a00, b00, c00, lambda0, x02, y02, a0, b02, c0;
4892
4928
  var resampleStream = {
4893
4929
  point: point2,
4894
4930
  lineStart,
@@ -4913,7 +4949,7 @@
4913
4949
  }
4914
4950
  function linePoint(lambda, phi2) {
4915
4951
  var c2 = cartesian([lambda, phi2]), p = project(lambda, phi2);
4916
- resampleLineTo(x02, y02, lambda0, a0, b0, c0, x02 = p[0], y02 = p[1], lambda0 = lambda, a0 = c2[0], b0 = c2[1], c0 = c2[2], maxDepth, stream);
4952
+ resampleLineTo(x02, y02, lambda0, a0, b02, c0, x02 = p[0], y02 = p[1], lambda0 = lambda, a0 = c2[0], b02 = c2[1], c0 = c2[2], maxDepth, stream);
4917
4953
  stream.point(x02, y02);
4918
4954
  }
4919
4955
  function lineEnd() {
@@ -4926,11 +4962,11 @@
4926
4962
  resampleStream.lineEnd = ringEnd;
4927
4963
  }
4928
4964
  function ringPoint(lambda, phi2) {
4929
- linePoint(lambda00 = lambda, phi2), x002 = x02, y002 = y02, a00 = a0, b00 = b0, c00 = c0;
4965
+ linePoint(lambda00 = lambda, phi2), x002 = x02, y002 = y02, a00 = a0, b00 = b02, c00 = c0;
4930
4966
  resampleStream.point = linePoint;
4931
4967
  }
4932
4968
  function ringEnd() {
4933
- resampleLineTo(x02, y02, lambda0, a0, b0, c0, x002, y002, lambda00, a00, b00, c00, maxDepth, stream);
4969
+ resampleLineTo(x02, y02, lambda0, a0, b02, c0, x002, y002, lambda00, a00, b00, c00, maxDepth, stream);
4934
4970
  resampleStream.lineEnd = lineEnd;
4935
4971
  lineEnd();
4936
4972
  }
@@ -10952,6 +10988,15 @@
10952
10988
  waterfallKeys2["down"] = "down";
10953
10989
  return waterfallKeys2;
10954
10990
  })(waterfallKeys || {});
10991
+ const effectsMap = {
10992
+ "easeLinear": linear$2,
10993
+ "easeCubicIn": cubicIn,
10994
+ "easeCubicOut": cubicOut,
10995
+ "easeCubicInOut": cubicInOut$1,
10996
+ "easeBounceOut": bounceOut,
10997
+ "easeElasticOut": elasticOut$1,
10998
+ "easeBackOut": backOut
10999
+ };
10955
11000
  const defaultChartFormatOptions = {
10956
11001
  chartDescription: {
10957
11002
  chartDescriptionVisibility: false,
@@ -11554,6 +11599,20 @@
11554
11599
  chartPadding: {
11555
11600
  paddingArrayLTRB: [0, 0, 0, 0]
11556
11601
  // left, top, right, bottom
11602
+ },
11603
+ statisticalTest: {
11604
+ zTest: false,
11605
+ runZTest: [],
11606
+ zTestInputData: []
11607
+ },
11608
+ cjsOptions: {
11609
+ cjsTension: 0,
11610
+ cjsBorderRadius: 0
11611
+ },
11612
+ animation: {
11613
+ animationEnabled: false,
11614
+ animationDuration: 1500,
11615
+ animationEffect: "easeCubicOut"
11557
11616
  }
11558
11617
  };
11559
11618
  const chartMargins = {
@@ -13492,6 +13551,21 @@
13492
13551
  connectorType,
13493
13552
  barChart
13494
13553
  );
13554
+ if (formatOptions.animation?.animationEnabled) {
13555
+ const duration = formatOptions.animation.animationDuration;
13556
+ const ease = effectsMap[formatOptions.animation.animationEffect];
13557
+ const accessors = makeAnnotations.accessors();
13558
+ annotations.selectAll(".annotation").attr("transform", function(d) {
13559
+ const x2 = accessors.x(d.data);
13560
+ const yScale = d.data?.y?.axis === axisTypes.primary ? yScaleLeft : yScaleRight;
13561
+ const startY = yScale(0);
13562
+ return `translate(${x2}, ${startY})`;
13563
+ }).transition().duration(duration).ease(ease).attr("transform", function(d) {
13564
+ const x2 = accessors.x(d.data);
13565
+ const y2 = accessors.y(d.data);
13566
+ return `translate(${x2}, ${y2})`;
13567
+ });
13568
+ }
13495
13569
  }
13496
13570
  } catch (error) {
13497
13571
  throw error;
@@ -13988,6 +14062,28 @@
13988
14062
  }).notePadding(0).annotations(finalAnnotationList);
13989
14063
  if (!formatOptions.plotArea.fitChart) svg.selectAll(".annotation-group").remove();
13990
14064
  let annotations = appendAnnotations(svg, formatOptions, margin, fontStyle, makeAnnotations, connectorType, false);
14065
+ if (formatOptions.animation?.animationEnabled) {
14066
+ const duration = formatOptions.animation.animationDuration;
14067
+ const ease = effectsMap[formatOptions.animation.animationEffect];
14068
+ const accessors = makeAnnotations.accessors();
14069
+ annotations.selectAll(".annotation").attr("transform", function(d) {
14070
+ const x2 = accessors.x(d.data);
14071
+ const chartType = d.data.type || d.type;
14072
+ const axis2 = d.data?.x?.axis || d.data?.axis;
14073
+ const yScale = axis2 === axisTypes.primary ? yScaleLeft : yScaleRight;
14074
+ let startY;
14075
+ if (chartType === chartTypes.StackColumnChart || chartType === chartTypes.StackAreaChart) {
14076
+ startY = yScale(d.data.prevValue ?? 0);
14077
+ } else {
14078
+ startY = yScale(0);
14079
+ }
14080
+ return `translate(${x2}, ${startY})`;
14081
+ }).transition().duration(duration).ease(ease).attr("transform", function(d) {
14082
+ const x2 = accessors.x(d.data);
14083
+ const y2 = accessors.y(d.data);
14084
+ return `translate(${x2}, ${y2})`;
14085
+ });
14086
+ }
13991
14087
  }
13992
14088
  } catch (error) {
13993
14089
  throw error;
@@ -15403,6 +15499,21 @@
15403
15499
  }).notePadding(0).annotations(finalAnnotationList);
15404
15500
  if (true) svg.selectAll(".annotation-group").remove();
15405
15501
  let annotations = appendAnnotations(svg, formatOptions, margin, fontStyle, makeAnnotations, connectorType, barChart);
15502
+ if (formatOptions.animation?.animationEnabled) {
15503
+ const duration = formatOptions.animation.animationDuration;
15504
+ const ease = effectsMap[formatOptions.animation.animationEffect];
15505
+ const accessors = makeAnnotations.accessors();
15506
+ annotations.selectAll(".annotation").attr("transform", function(d) {
15507
+ const x2 = accessors.x(d.data);
15508
+ const yScale = d.data?.y?.axis === axisTypes.primary ? yScaleLeft : yScaleRight;
15509
+ const startY = yScale ? yScale(0) : 0;
15510
+ return `translate(${x2}, ${startY})`;
15511
+ }).transition().duration(duration).ease(ease).attr("transform", function(d) {
15512
+ const x2 = accessors.x(d.data);
15513
+ const y2 = accessors.y(d.data);
15514
+ return `translate(${x2}, ${y2})`;
15515
+ });
15516
+ }
15406
15517
  }
15407
15518
  } catch (error) {
15408
15519
  throw error;
@@ -16146,7 +16257,7 @@
16146
16257
  const group2 = select$2(this);
16147
16258
  let markers = group2.selectAll("path").data(groupData.data);
16148
16259
  let markersEnter = markers.enter().append("path").attr("fill", (d) => d.markerColor);
16149
- markersEnter.merge(markers).attr("d", (d) => {
16260
+ const mergedMarkers = markersEnter.merge(markers).attr("d", (d) => {
16150
16261
  return Symbol$1().type(Markershapes(d.markerShape)).size(d.markerSize * 50)();
16151
16262
  }).attr("visibility", (d) => {
16152
16263
  const hideByX = !xScale(d.dimension) && xScale(d.dimension) !== 0;
@@ -16214,6 +16325,26 @@
16214
16325
  return `translate(${x2},${y2}) scale(1)`;
16215
16326
  });
16216
16327
  });
16328
+ if (formatOptions.animation.animationEnabled) {
16329
+ const duration = formatOptions.animation.animationDuration;
16330
+ const ease = effectsMap[formatOptions.animation.animationEffect] ?? linear$2;
16331
+ const xRange = xScale.range();
16332
+ const xRangeMin = Math.min(xRange[0], xRange[1]);
16333
+ const xRangeSpan = Math.max(xRange[0], xRange[1]) - xRangeMin;
16334
+ const invertEase = (progress, steps = 100) => {
16335
+ for (let i = 0; i <= steps; i++) {
16336
+ const t = i / steps;
16337
+ if (ease(t) >= progress) return t;
16338
+ }
16339
+ return 1;
16340
+ };
16341
+ mergedMarkers.attr("opacity", 0).each(function(d) {
16342
+ const x2 = xScale(d.dimension) ?? xRangeMin;
16343
+ const fraction = xRangeSpan > 0 ? Math.max(0, Math.min(1, (x2 - xRangeMin) / xRangeSpan)) : 0;
16344
+ const delay = invertEase(fraction) * duration;
16345
+ select$2(this).transition().delay(delay).duration(0).attr("opacity", 1);
16346
+ });
16347
+ }
16217
16348
  });
16218
16349
  } catch (error) {
16219
16350
  logError$2(fileName$b, "lineMarkers", error);
@@ -17620,7 +17751,7 @@
17620
17751
  "visibility",
17621
17752
  (d) => d.value === 0 && formatOptions.xAxisLabel.hideZeroValues ? "hidden" : "visible"
17622
17753
  );
17623
- const finalBars = bars;
17754
+ const finalBars = formatOptions.animation.animationEnabled ? bars.transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]) : bars;
17624
17755
  finalBars.attr("y", (d) => {
17625
17756
  const yScale = data2.properties.axis === axisTypes.primary ? yScaleLeft : yScaleRight;
17626
17757
  return d.value > 0 ? yScale(d.value) : yScale(0);
@@ -17698,6 +17829,7 @@
17698
17829
  filteredDimension,
17699
17830
  xScale
17700
17831
  );
17832
+ getChartType(filteredData);
17701
17833
  commonAnnotations(
17702
17834
  seriesData,
17703
17835
  xScale,
@@ -17749,7 +17881,6 @@
17749
17881
  margin,
17750
17882
  innerHeight2
17751
17883
  );
17752
- getChartType(filteredData);
17753
17884
  };
17754
17885
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
17755
17886
  "svg",
@@ -17832,6 +17963,7 @@
17832
17963
  let requiredData = [];
17833
17964
  let scrollPosition = 0;
17834
17965
  let visibleBars;
17966
+ let annotationTimeoutId;
17835
17967
  let chartJSON = {
17836
17968
  dimensionList,
17837
17969
  chartType,
@@ -18337,13 +18469,10 @@
18337
18469
  "transform",
18338
18470
  (d) => `translate(${xScale(d.dimension) - columnWidth / 2}, 0)`
18339
18471
  );
18340
- columnGroupsEnter.append("rect").attr("x", (d) => xScaleForLegends(d.legendUniqueId)).attr("width", xScaleForLegends.bandwidth()).attr("y", (d) => {
18341
- const yScale = data2.properties.axis === axisTypes.primary ? yScaleLeft : yScaleRight;
18342
- return d.value > 0 ? yScale(d.value) : yScale(0);
18343
- }).attr("height", (d) => {
18472
+ const bars = columnGroupsEnter.append("rect").attr("x", (d) => xScaleForLegends(d.legendUniqueId)).attr("width", xScaleForLegends.bandwidth()).attr("y", (d) => {
18344
18473
  const yScale = data2.properties.axis === axisTypes.primary ? yScaleLeft : yScaleRight;
18345
- return Math.abs(yScale(d.value) - yScale(0));
18346
- }).attr("fill", data2.properties.color).attr("stroke-dasharray", (d) => data2.properties.stackBorderStyle == 2 ? "5,3" : "0").attr("stroke-width", (d) => `${data2.properties.stackBorderWidth}px`).attr(
18474
+ return yScale(0);
18475
+ }).attr("height", 0).attr("fill", data2.properties.color).attr("stroke-dasharray", (d) => data2.properties.stackBorderStyle == 2 ? "5,3" : "0").attr("stroke-width", (d) => `${data2.properties.stackBorderWidth}px`).attr(
18347
18476
  "stroke",
18348
18477
  (d) => data2.properties.stackBorderStyle == 0 ? "none" : formatOptions.column.stackBorderVisibility ? data2.properties.stackBorderColor : "none"
18349
18478
  ).style("clip-path", "inset(0px) fill-box").style("shape-rendering", "crispEdges").attr(
@@ -18381,6 +18510,14 @@
18381
18510
  seriesData.filter((e) => e.legend === d.legend)[0].properties
18382
18511
  );
18383
18512
  }).on("mouseout", hideTooltipOnMouseOut);
18513
+ const finalBars = formatOptions.animation.animationEnabled ? bars.transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]) : bars;
18514
+ finalBars.attr("y", (d) => {
18515
+ const yScale = data2.properties.axis === axisTypes.primary ? yScaleLeft : yScaleRight;
18516
+ return d.value > 0 ? yScale(d.value) : yScale(0);
18517
+ }).attr("height", (d) => {
18518
+ const yScale = data2.properties.axis === axisTypes.primary ? yScaleLeft : yScaleRight;
18519
+ return Math.abs(yScale(d.value) - yScale(0));
18520
+ });
18384
18521
  columnGroups.exit().remove();
18385
18522
  };
18386
18523
  const drawLineChart = (lineData) => {
@@ -18426,6 +18563,14 @@
18426
18563
  "stroke-width",
18427
18564
  (d) => d.properties.lineStyle !== "None" ? d.properties.lineWidth : "0"
18428
18565
  );
18566
+ if (formatOptions.animation.animationEnabled) {
18567
+ lineGroupsEnter.merge(lineGroups).select("path").each(function() {
18568
+ const path2 = select$2(this);
18569
+ const totalLength = this.getTotalLength();
18570
+ path2.attr("stroke-dasharray", totalLength + " " + totalLength).attr("stroke-dashoffset", totalLength);
18571
+ path2.transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]).attr("stroke-dashoffset", 0);
18572
+ });
18573
+ }
18429
18574
  lineGroups.exit().remove();
18430
18575
  lineMarkers(
18431
18576
  lines,
@@ -18466,6 +18611,10 @@
18466
18611
  )
18467
18612
  // : yScaleRight((d as TDataPoint).value)
18468
18613
  ).defined((d) => d.hideZero ? Boolean(d.value) : true).curve(getCurveType(formatOptions));
18614
+ const areaGeneratorStart = area().x(
18615
+ (d) => xScale(d.dimension) ? xScale(d.dimension) : null
18616
+ ).y0(() => yScaleLeft(0)).y1(() => yScaleLeft(0)).defined((d) => d.hideZero ? Boolean(d.value) : true).curve(getCurveType(formatOptions));
18617
+ const enableAreaTransition = formatOptions.animation.animationEnabled;
18469
18618
  let areas = gTag.selectAll(".areas.parentGroup").data([1]);
18470
18619
  let focus = gTag.append("g").attr("class", "focusClass");
18471
18620
  areas = areas.enter().append("g").attr("class", "areas parentGroup").attr("clip-path", `url(#${chartId}-clip)`).merge(areas);
@@ -18480,8 +18629,13 @@
18480
18629
  ).attr("class", "area parentGroup").attr(
18481
18630
  "fill",
18482
18631
  (d) => d.properties.color !== commonColors.white ? d.properties.color : "none"
18483
- ).style("fill-opacity", formatOptions.plotArea.fillOpacity);
18484
- areaGroupsEnter.merge(areaGroups).select("path").attr("d", (d) => areaGenerator(d.data)).attr(
18632
+ ).style("fill-opacity", formatOptions.plotArea.fillOpacity).attr("d", (d) => enableAreaTransition ? areaGeneratorStart(d.data) : areaGenerator(d.data)).each(function(d) {
18633
+ if (enableAreaTransition) {
18634
+ select$2(this).transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]).attr("d", areaGenerator(d.data));
18635
+ }
18636
+ });
18637
+ areaGroups.select("path").attr("d", (d) => areaGenerator(d.data));
18638
+ areaGroupsEnter.merge(areaGroups).select("path").attr(
18485
18639
  "stroke",
18486
18640
  (d) => d.properties.areaBorderColor !== commonColors.white ? d.properties.areaBorderColor : "none"
18487
18641
  ).attr("stroke-dasharray", (d) => {
@@ -18542,6 +18696,10 @@
18542
18696
  ).y1(
18543
18697
  (d) => d.data.axis === axisTypes.primary ? yScaleLeft(d[1]) : yScaleRight(d[1])
18544
18698
  ).defined((d) => d.hideZero ? Boolean(d.key) : true).curve(getCurveType(formatOptions));
18699
+ const stackAreaGeneratorStart = area().x(
18700
+ (d) => xScale(d.data.dimension) ? xScale(d.data.dimension) : null
18701
+ ).y0(() => yScaleLeft(0)).y1(() => yScaleLeft(0)).defined((d) => d.hideZero ? Boolean(d.key) : true).curve(getCurveType(formatOptions));
18702
+ const enableStackAreaTransition = formatOptions.animation.animationEnabled;
18545
18703
  let areas = gTag.selectAll(".parentGroup").data([stackAreaData]);
18546
18704
  gTag.append("g").attr("class", "focusClass");
18547
18705
  areas = areas.enter().append("g").attr("class", "areas parentGroup").attr("clip-path", `url(#${chartId}-clip)`).merge(areas);
@@ -18550,8 +18708,13 @@
18550
18708
  areaGroupsEnter.append("path").attr(
18551
18709
  "hoverId",
18552
18710
  (d) => (data2.data.filter((e) => e.legend === d.key)[0].properties.alias || data2.data.filter((e) => e.legend === d.key)[0].properties.name || "Legend").replace(/\s+/g, "-")
18553
- ).attr("class", "area parentGroup").attr("fill", (d) => d.color !== commonColors.white ? d.color : "none");
18554
- areaGroupsEnter.merge(areaGroups).select("path").attr("d", (d, i) => areaGenerator(d)).style("opacity", formatOptions.plotArea.fillOpacity).attr(
18711
+ ).attr("class", "area parentGroup").attr("fill", (d) => d.color !== commonColors.white ? d.color : "none").attr("d", (d) => enableStackAreaTransition ? stackAreaGeneratorStart(d) : areaGenerator(d)).each(function(d) {
18712
+ if (enableStackAreaTransition) {
18713
+ select$2(this).transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]).attr("d", areaGenerator(d));
18714
+ }
18715
+ });
18716
+ areaGroups.select("path").attr("d", (d) => areaGenerator(d));
18717
+ areaGroupsEnter.merge(areaGroups).select("path").style("opacity", formatOptions.plotArea.fillOpacity).attr(
18555
18718
  "stroke",
18556
18719
  (d) => d.color !== commonColors.white ? d.color : "none"
18557
18720
  ).attr(
@@ -18588,19 +18751,24 @@
18588
18751
  let stackColumnGroupsEnter = stackColumnGroups.enter().append("g").attr("class", (d) => "stackcolumns-group ");
18589
18752
  stackColumnGroups = stackColumnGroupsEnter.merge(stackColumnGroups);
18590
18753
  let rects = stackColumnGroups.selectAll("rect").data((d) => d);
18591
- rects.enter().append("rect").attr(
18592
- "transform",
18593
- (d) => `translate(${xScale(d.data.dimension) - columnWidth / 2},0)`
18594
- ).merge(rects).attr(
18595
- "hoverId",
18596
- (d) => d.alias.includes("~$~") ? d.alias.split("~$~")[1].replace(/ /g, "-") : d.alias.replace(/ /g, "-")
18597
- ).attr("x", (d) => xScaleForLegends(chartTypes.StackColumnChart)).attr(
18754
+ rects.attr(
18598
18755
  "y",
18599
18756
  (d) => d.data.axis === axisTypes.primary ? yScaleLeft(d[1]) : yScaleRight(d[1])
18600
18757
  ).attr(
18601
18758
  "height",
18602
18759
  (d) => d.data.axis === axisTypes.primary ? customYaxisMaxValue && d[1] > customYaxisMaxValue ? yScaleLeft(d[0]) - yScaleLeft(customYaxisMaxValue) : yScaleLeft(d[0]) - yScaleLeft(d[1]) : secondaryCustomYaxisMaxValue && d[1] > secondaryCustomYaxisMaxValue ? yScaleRight(d[0]) - yScaleRight(secondaryCustomYaxisMaxValue) : yScaleRight(d[0]) - yScaleRight(d[1])
18603
- ).attr("width", xScaleForLegends.bandwidth()).attr("fill", (d, i, nodes) => {
18760
+ );
18761
+ const rectsEnter = rects.enter().append("rect").attr(
18762
+ "transform",
18763
+ (d) => `translate(${xScale(d.data.dimension) - columnWidth / 2},0)`
18764
+ ).attr(
18765
+ "y",
18766
+ (d) => d.data.axis === axisTypes.primary ? yScaleLeft(0) : yScaleRight(0)
18767
+ ).attr("height", 0);
18768
+ rectsEnter.merge(rects).attr(
18769
+ "hoverId",
18770
+ (d) => d.alias.includes("~$~") ? d.alias.split("~$~")[1].replace(/ /g, "-") : d.alias.replace(/ /g, "-")
18771
+ ).attr("x", (d) => xScaleForLegends(chartTypes.StackColumnChart)).attr("width", xScaleForLegends.bandwidth()).attr("fill", (d, i, nodes) => {
18604
18772
  const seriesIndex = Array.from(seriesData).findIndex(
18605
18773
  (sdata) => sdata.legend === d.key
18606
18774
  );
@@ -18647,6 +18815,14 @@
18647
18815
  seriesData.filter((e) => e.legend === d.key)[0].properties
18648
18816
  );
18649
18817
  }).on("mouseout", hideTooltipOnMouseOut);
18818
+ const finalStackRects = formatOptions.animation.animationEnabled ? rectsEnter.transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]) : rectsEnter;
18819
+ finalStackRects.attr(
18820
+ "y",
18821
+ (d) => d.data.axis === axisTypes.primary ? yScaleLeft(d[1]) : yScaleRight(d[1])
18822
+ ).attr(
18823
+ "height",
18824
+ (d) => d.data.axis === axisTypes.primary ? customYaxisMaxValue && d[1] > customYaxisMaxValue ? yScaleLeft(d[0]) - yScaleLeft(customYaxisMaxValue) : yScaleLeft(d[0]) - yScaleLeft(d[1]) : secondaryCustomYaxisMaxValue && d[1] > secondaryCustomYaxisMaxValue ? yScaleRight(d[0]) - yScaleRight(secondaryCustomYaxisMaxValue) : yScaleRight(d[0]) - yScaleRight(d[1])
18825
+ );
18650
18826
  stackColumnGroups.exit().remove();
18651
18827
  };
18652
18828
  const setSVGContainer = (margin2) => {
@@ -18724,48 +18900,60 @@
18724
18900
  filteredDimension,
18725
18901
  xScale
18726
18902
  );
18727
- commonAnnotationsForCustomChart(
18728
- filteredData,
18729
- xScale,
18730
- yScaleLeft,
18731
- yScaleRight,
18732
- // need to pass secondary axis scale if secondary axis is drawn
18733
- margin,
18734
- d3Annotation,
18735
- stackColumnData,
18736
- stackAreaData,
18737
- [],
18738
- //labelExcludeList
18739
- [],
18740
- // individualLabelColor
18741
- columnWidth,
18742
- // [], //old annotation list
18743
- formatOptions,
18744
- height,
18745
- width,
18746
- innerWidth2,
18747
- filteredDimension,
18748
- innerHeight2,
18749
- chartId,
18750
- svg,
18751
- onDataLabelCoordinatesChange,
18752
- xScaleForLegends,
18753
- isReportEditable
18754
- );
18755
- addTotalValue(
18756
- totalValueMap,
18757
- xScale,
18758
- yScaleLeft,
18759
- margin,
18760
- d3Annotation,
18761
- [],
18762
- formatOptions,
18763
- chartType,
18764
- height,
18765
- width,
18766
- svg,
18767
- isReportEditable
18768
- );
18903
+ clearTimeout(annotationTimeoutId);
18904
+ const renderAnnotationsAndTotals = () => {
18905
+ commonAnnotationsForCustomChart(
18906
+ filteredData,
18907
+ xScale,
18908
+ yScaleLeft,
18909
+ yScaleRight,
18910
+ // need to pass secondary axis scale if secondary axis is drawn
18911
+ margin,
18912
+ d3Annotation,
18913
+ stackColumnData,
18914
+ stackAreaData,
18915
+ [],
18916
+ //labelExcludeList
18917
+ [],
18918
+ // individualLabelColor
18919
+ columnWidth,
18920
+ // [], //old annotation list
18921
+ formatOptions,
18922
+ height,
18923
+ width,
18924
+ innerWidth2,
18925
+ filteredDimension,
18926
+ innerHeight2,
18927
+ chartId,
18928
+ svg,
18929
+ onDataLabelCoordinatesChange,
18930
+ xScaleForLegends,
18931
+ isReportEditable
18932
+ );
18933
+ addTotalValue(
18934
+ totalValueMap,
18935
+ xScale,
18936
+ yScaleLeft,
18937
+ margin,
18938
+ d3Annotation,
18939
+ [],
18940
+ formatOptions,
18941
+ chartType,
18942
+ height,
18943
+ width,
18944
+ svg,
18945
+ isReportEditable
18946
+ );
18947
+ };
18948
+ if (formatOptions.animation.animationEnabled) {
18949
+ svg.selectAll(".annotation-group").remove();
18950
+ annotationTimeoutId = setTimeout(
18951
+ renderAnnotationsAndTotals,
18952
+ formatOptions.animation.animationDuration
18953
+ );
18954
+ } else {
18955
+ renderAnnotationsAndTotals();
18956
+ }
18769
18957
  };
18770
18958
  const createStackData = (requiredStackChatData) => {
18771
18959
  let legendList = requiredStackChatData.data.map((d) => d.legend);
@@ -18897,7 +19085,6 @@
18897
19085
  let yScaleLeft;
18898
19086
  let yScaleRight;
18899
19087
  let xScale;
18900
- let xScaleForLegends;
18901
19088
  let calculatedRange;
18902
19089
  let yAxisLeft;
18903
19090
  let xAxis;
@@ -19153,7 +19340,7 @@
19153
19340
  calculatedRange = [0, innerWidth2];
19154
19341
  };
19155
19342
  const getXScale = () => {
19156
- xScaleForLegends = band().domain(["layeredLegend"]).range([0, columnWidth]).paddingInner(
19343
+ band().domain(["layeredLegend"]).range([0, columnWidth]).paddingInner(
19157
19344
  chartJSON.legendList.length > 1 ? 0.3 * parseFloat(formatOptions.plotArea.plotAreaSeriesWidth) / 100 : 0
19158
19345
  );
19159
19346
  xScale = point$7().domain(filteredDimension).range(calculatedRange).padding(0.5);
@@ -19212,15 +19399,12 @@
19212
19399
  });
19213
19400
  });
19214
19401
  lineData.forEach((data2, index2) => {
19215
- let column = gTag.selectAll(".parentGroup").data([data2], (d) => d.properties.legendUniqueId);
19216
- column = column.enter().append("g").attr("class", `column parentGroup`).attr("clip-path", `url(#${chartId}-clip)`).merge(column);
19217
- let columnGroups = column.selectAll(".column-group").data(data2.data, (d) => d.properties.legendUniqueId);
19402
+ let column = gTag.selectAll(`.parentGroup-${data2.properties.legendUniqueId}`).data([data2], (d) => d.properties.legendUniqueId);
19403
+ column = column.enter().append("g").attr("class", `column parentGroup parentGroup-${data2.properties.legendUniqueId}`).attr("clip-path", `url(#${chartId}-clip)`).merge(column);
19404
+ let columnGroups = column.selectAll(".column-group").data(data2.data, (d) => d.dimension + "_" + data2.properties.legendUniqueId);
19218
19405
  let columnGroupsEnter = columnGroups.enter().append("g").attr("class", "column-group").attr(
19219
19406
  "hoverId",
19220
- (data2.properties.alias || data2.properties.name || "Legend").replace(
19221
- /\s+/g,
19222
- "-"
19223
- )
19407
+ (data2.properties.alias || data2.properties.name || "Legend").replace(/\s+/g, "-")
19224
19408
  ).attr(
19225
19409
  "transform",
19226
19410
  (d) => index2 === 0 ? `translate(${xScale(d.dimension) - columnWidth / 2}, 0)` : `translate(${xScale(d.dimension) - columnWidth / (2 + index2 * 2)}, 0)`
@@ -19233,22 +19417,38 @@
19233
19417
  "transform",
19234
19418
  (d) => index2 === 0 ? `translate(${xScale(d.dimension) - columnWidth / 2}, 0)` : `translate(${xScale(d.dimension) - columnWidth / (2 + index2 * 2)}, 0)`
19235
19419
  );
19236
- columnGroupsEnter.append("rect").attr("x", (d) => xScaleForLegends(d.dimension)).attr("width", index2 === 0 ? columnWidth : columnWidth / 2 + index2 * 2).attr("y", (d) => {
19237
- const yScale = data2.properties.axis === axisTypes.primary ? yScaleLeft : yScaleRight;
19238
- return d.value > 0 ? yScale(d.value) : yScale(0);
19239
- }).attr("height", (d) => {
19420
+ const bars = columnGroupsEnter.append("rect").attr("x", () => 0).attr("width", index2 === 0 ? columnWidth : columnWidth / 2 + index2 * 2).attr("y", (d) => {
19240
19421
  const yScale = data2.properties.axis === axisTypes.primary ? yScaleLeft : yScaleRight;
19241
- return Math.abs(yScale(d.value) - yScale(0));
19242
- }).attr("fill", (d) => colorScaleMap.get(data2.properties.legendUniqueId)?.(d.value) ?? data2.properties.color).attr(
19422
+ return yScale(0);
19423
+ }).attr("height", 0).attr(
19424
+ "fill",
19425
+ (d) => colorScaleMap.get(data2.properties.legendUniqueId)?.(d.value) ?? data2.properties.color
19426
+ ).attr(
19243
19427
  "stroke-dasharray",
19244
- (d) => data2.properties.stackBorderStyle == 2 ? "5,3" : "0"
19245
- ).attr("stroke-width", () => `${data2.properties.stackBorderWidth}px`).attr(
19428
+ () => data2.properties.stackBorderStyle == 2 ? "5,3" : "0"
19429
+ ).attr("stroke-width", `${data2.properties.stackBorderWidth}px`).attr(
19246
19430
  "stroke",
19247
19431
  () => data2.properties.stackBorderStyle == 0 ? "none" : formatOptions.column.stackBorderVisibility ? data2.properties.stackBorderColor : "none"
19248
19432
  ).style("clip-path", "inset(0px) fill-box").style("shape-rendering", "crispEdges").attr("opacity", 0.7).attr(
19249
19433
  "visibility",
19250
19434
  (d) => d.value === 0 && formatOptions.xAxisLabel.hideZeroValues ? "hidden" : "visible"
19251
- ).on("mousemove", (event2, d) => {
19435
+ );
19436
+ const finalBars = formatOptions.animation.animationEnabled ? bars.transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]) : bars;
19437
+ finalBars.attr("y", (d) => {
19438
+ const yScale = data2.properties.axis === axisTypes.primary ? yScaleLeft : yScaleRight;
19439
+ return d.value > 0 ? yScale(d.value) : yScale(0);
19440
+ }).attr("height", (d) => {
19441
+ const yScale = data2.properties.axis === axisTypes.primary ? yScaleLeft : yScaleRight;
19442
+ return Math.abs(yScale(d.value) - yScale(0));
19443
+ });
19444
+ columnGroups.select("rect").transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]).attr("y", (d) => {
19445
+ const yScale = data2.properties.axis === axisTypes.primary ? yScaleLeft : yScaleRight;
19446
+ return d.value > 0 ? yScale(d.value) : yScale(0);
19447
+ }).attr("height", (d) => {
19448
+ const yScale = data2.properties.axis === axisTypes.primary ? yScaleLeft : yScaleRight;
19449
+ return Math.abs(yScale(d.value) - yScale(0));
19450
+ });
19451
+ columnGroupsEnter.merge(columnGroups).on("mousemove", (event2, d) => {
19252
19452
  showTooltipOnMouseMove(
19253
19453
  [
19254
19454
  {
@@ -19290,6 +19490,7 @@
19290
19490
  });
19291
19491
  columnGroups.exit().remove();
19292
19492
  });
19493
+ gTag.selectAll(".parentGroup").raise();
19293
19494
  };
19294
19495
  const setSVGContainer = (margin2) => {
19295
19496
  innerWidth2 = width - margin2.left - margin2.right;
@@ -19782,7 +19983,7 @@
19782
19983
  }).on("mouseout", (event2, d) => {
19783
19984
  hideTooltipOnMouseOut();
19784
19985
  });
19785
- const finalRects = baseRects;
19986
+ const finalRects = formatOptions.animation.animationEnabled ? baseRects.transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]) : baseRects;
19786
19987
  finalRects.attr("y", (d) => d[1] >= d[0] ? yScaleLeft(d[1]) : yScaleLeft(d[0])).attr("height", (d) => Math.abs(yScaleLeft(d[0]) - yScaleLeft(d[1])));
19787
19988
  columnGroups.exit().remove();
19788
19989
  gTag.selectAll(".parentGroup").raise();
@@ -20518,7 +20719,8 @@
20518
20719
  const { props } = getPropsForRect(nodes, i);
20519
20720
  return d.data[d.key] === 0 && props?.hideZeroValues ? "hidden" : "visible";
20520
20721
  });
20521
- const applyTransition = (sel) => sel;
20722
+ const shouldAnimate = formatOptions.animation.animationEnabled;
20723
+ const applyTransition = (sel) => shouldAnimate ? sel.transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]) : sel;
20522
20724
  applyTransition(rectsEnter).attr("y", (d) => d[1] >= d[0] ? yScaleLeft(d[1]) : yScaleLeft(d[0])).attr("height", (d) => Math.abs(yScaleLeft(d[0]) - yScaleLeft(d[1])));
20523
20725
  rectsEnter.merge(rects).on("mousemove", (event2, d) => {
20524
20726
  showTooltipOnMouseMove(
@@ -21325,6 +21527,15 @@
21325
21527
  }).annotations(finalAnnotationList);
21326
21528
  const annotations = svg.append("g").attr("class", "annotation-group parentGroup").attr("transform", getPiePosition).call(makeAnnotations);
21327
21529
  annotations.selectAll("rect,.annotation-subject").remove();
21530
+ if (formatOptions.animation?.animationEnabled) {
21531
+ const duration = formatOptions.animation.animationDuration;
21532
+ const ease = effectsMap[formatOptions.animation.animationEffect];
21533
+ const labels = annotations.selectAll(".annotation-note-label");
21534
+ labels.interrupt().style("opacity", 0);
21535
+ setTimeout(() => {
21536
+ labels.transition().delay((d, i) => i * 30).duration(duration).ease(ease).style("opacity", 1);
21537
+ }, 50);
21538
+ }
21328
21539
  annotations.selectAll(".connector").style("stroke", formatOptions.plotArea.connectorColor ?? "#ccc").attr(
21329
21540
  "stroke-dasharray",
21330
21541
  connectedStyle2[formatOptions.plotArea.connectorStyle?.toLowerCase()]
@@ -21756,7 +21967,8 @@
21756
21967
  formatOptions.bins.binsCalculation === "Automatic" ? xAxis.ticks(thresholds) : xAxis.tickValues(periods).ticks(innerWidth2 / 50);
21757
21968
  };
21758
21969
  const getChartType = (lineData) => {
21759
- gTag.append("g").attr("class", "parentGroup").selectAll("#scaling-svg" + chartId + " .rect").data(bins).enter().append("g").selectAll("rect").data((d) => d).enter().append("rect").attr("class", "rect").attr(
21970
+ const shouldAnimate = formatOptions.animation.animationEnabled;
21971
+ const bars = gTag.append("g").attr("class", "parentGroup").selectAll("#scaling-svg" + chartId + " .rect").data(bins).enter().append("g").selectAll("rect").data((d) => d).enter().append("rect").attr("class", "rect").attr(
21760
21972
  "stroke",
21761
21973
  formatOptions.bins.binsBorderVisibility && formatOptions.bins.binsBorderColor
21762
21974
  ).attr(
@@ -21766,12 +21978,10 @@
21766
21978
  "stroke-opacity",
21767
21979
  formatOptions.bins.binsBorderVisibility && formatOptions.bins.binsBorderOpacity
21768
21980
  ).attr("x", 1).attr("transform", function(d) {
21769
- return "translate(" + xScale(d.x0) + "," + (yScaleLeft(d.length) > 0 ? yScaleLeft(d.length) : 0) + ")";
21981
+ return "translate(" + xScale(d.x0) + "," + innerHeight2 + ")";
21770
21982
  }).attr("width", function(d) {
21771
21983
  return xScale(d.x1) - xScale(d.x0) - parseFloat(formatOptions.bins.binsGapWidth) < 0 ? 0 : xScale(d.x1) - xScale(d.x0) - parseFloat(formatOptions.bins.binsGapWidth);
21772
- }).attr("height", function(d) {
21773
- return innerHeight2 - yScaleLeft(d.length);
21774
- }).style("fill", (d) => d.color !== commonColors.white ? d.color : "none").style("opacity", formatOptions.bins.binsFillOpacity).style("shape-rendering", "crispEdges").on("mousemove", (event2, d) => {
21984
+ }).attr("height", 0).style("fill", (d) => d.color !== commonColors.white ? d.color : "none").style("opacity", formatOptions.bins.binsFillOpacity).style("shape-rendering", "crispEdges").on("mousemove", (event2, d) => {
21775
21985
  showTooltipOnMouseMove(
21776
21986
  [
21777
21987
  {
@@ -21793,6 +22003,12 @@
21793
22003
  event2
21794
22004
  );
21795
22005
  }).on("mouseout", hideTooltipOnMouseOut);
22006
+ const finalBars = shouldAnimate ? bars.transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]) : bars;
22007
+ finalBars.attr("transform", function(d) {
22008
+ return "translate(" + xScale(d.x0) + "," + (yScaleLeft(d.length) > 0 ? yScaleLeft(d.length) : 0) + ")";
22009
+ }).attr("height", function(d) {
22010
+ return innerHeight2 - yScaleLeft(d.length);
22011
+ });
21796
22012
  gTag.selectAll(".parentGroup").raise();
21797
22013
  };
21798
22014
  const setSVGContainer = (margin2) => {
@@ -22300,6 +22516,8 @@
22300
22516
  ).defined(
22301
22517
  (d) => d.hideZero || chartJSON.hideZeroValues ? Boolean(d.value) : true
22302
22518
  ).curve(getCurveType(formatOptions));
22519
+ const shouldAnimate = formatOptions.animation.animationEnabled;
22520
+ const applyTransition = (sel) => shouldAnimate ? sel.transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]) : sel;
22303
22521
  let lines = gTag.selectAll(".parentGroup").data([reversedLineData]);
22304
22522
  lines = lines.enter().append("g").attr("class", "lines parentGroup").merge(lines);
22305
22523
  let lineGroups = lines.selectAll(".line-group").data((d) => d);
@@ -22307,7 +22525,7 @@
22307
22525
  lineGroupsEnter.append("path").attr("class", "visibleLine").attr("fill", "none");
22308
22526
  lineGroupsEnter.merge(lineGroups).each(function(d) {
22309
22527
  const g = select$2(this);
22310
- g.selectAll("path.visibleLine").data([d]).join("path").attr("class", "visibleLine").attr("d", (d2) => lineGenerator(d2.data)).attr(
22528
+ const pathSel = g.selectAll("path.visibleLine").data([d]).join("path").attr("class", "visibleLine").attr("d", (d2) => lineGenerator(d2.data)).attr(
22311
22529
  "stroke",
22312
22530
  (d2) => d2.properties.color !== commonColors.white ? d2.properties.color : "none"
22313
22531
  ).attr("stroke-dasharray", (d2) => {
@@ -22330,6 +22548,14 @@
22330
22548
  "hoverId",
22331
22549
  (d.properties.alias || d.properties.name || "Legend").replace(/\s+/g, "-")
22332
22550
  ).attr("clip-path", `url(#${chartId}-clip)`).attr("d", (d2) => lineGenerator(d2.data));
22551
+ if (shouldAnimate) {
22552
+ pathSel.each(function() {
22553
+ const path2 = select$2(this);
22554
+ const totalLength = this.getTotalLength();
22555
+ path2.attr("stroke-dasharray", totalLength + " " + totalLength).attr("stroke-dashoffset", totalLength);
22556
+ applyTransition(path2).attr("stroke-dashoffset", 0);
22557
+ });
22558
+ }
22333
22559
  });
22334
22560
  lineGroups.exit().remove();
22335
22561
  lineMarkers(
@@ -22860,7 +23086,13 @@
22860
23086
  "stroke-width",
22861
23087
  seriesData[i].properties.lineStyle !== staticLineStyle.none ? seriesData[i].properties.lineWidth : 0
22862
23088
  ).attr("fill", "none");
22863
- pathSel.node().getTotalLength();
23089
+ const enableTransition = formatOptions.animation.animationEnabled;
23090
+ const totalLength = pathSel.node().getTotalLength();
23091
+ if (enableTransition) {
23092
+ pathSel.attr("stroke-dasharray", totalLength + " " + totalLength).attr("stroke-dashoffset", totalLength).transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]).attr("stroke-dashoffset", 0);
23093
+ } else {
23094
+ pathSel.attr("stroke-dasharray", totalLength + " " + totalLength).attr("stroke-dashoffset", 0);
23095
+ }
22864
23096
  g.selectAll("path.hoverLine").data([d]).join("path").attr("class", "hoverLine").attr("d", lineGenerator(d)).attr("stroke", commonColors.transparent).attr("stroke-width", 20).attr("fill", "none").style("pointer-events", "stroke").on("mouseenter", function() {
22865
23097
  svg.selectAll(".parentGroup").classed("highlight", false).classed("unhighlight", true);
22866
23098
  svg.selectAll(
@@ -23364,7 +23596,7 @@
23364
23596
  ).append("path").attr("class", "line").attr("fill", "none");
23365
23597
  lineGroupsEnter.merge(lineGroups).each(function(d, i) {
23366
23598
  const g = select$2(this);
23367
- g.selectAll("path.visibleLine").data([d]).join("path").attr("class", "visibleLine").attr("d", lineGenerator(d)).attr("stroke", d.color !== commonColors.white ? d.color : "none").attr("stroke-dasharray", (d2) => {
23599
+ const pathSel = g.selectAll("path.visibleLine").data([d]).join("path").attr("class", "visibleLine").attr("d", lineGenerator(d)).attr("stroke", d.color !== commonColors.white ? d.color : "none").attr("stroke-dasharray", (d2) => {
23368
23600
  const lineWidth = parseInt(
23369
23601
  seriesData[i].properties.lineWidth.toString()
23370
23602
  );
@@ -23383,6 +23615,13 @@
23383
23615
  "stroke-width",
23384
23616
  seriesData[i].properties.lineStyle !== staticLineStyle.none ? seriesData[i].properties.lineWidth : 0
23385
23617
  ).attr("fill", "none");
23618
+ const enableTransition = formatOptions.animation.animationEnabled;
23619
+ const totalLength = pathSel.node().getTotalLength();
23620
+ if (enableTransition) {
23621
+ pathSel.attr("stroke-dasharray", totalLength + " " + totalLength).attr("stroke-dashoffset", totalLength).transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]).attr("stroke-dashoffset", 0);
23622
+ } else {
23623
+ pathSel.attr("stroke-dasharray", totalLength + " " + totalLength).attr("stroke-dashoffset", 0);
23624
+ }
23386
23625
  g.selectAll("path.hoverLine").data([d]).join("path").attr("class", "hoverLine").attr("d", lineGenerator(d)).attr("stroke", commonColors.transparent).attr("stroke-width", 20).attr("fill", "none").style("pointer-events", "stroke").on("mouseenter", function(event2, d2) {
23387
23626
  svg.selectAll(".parentGroup").classed("highlight", false).classed("unhighlight", true);
23388
23627
  svg.selectAll(
@@ -23972,7 +24211,7 @@
23972
24211
  "visibility",
23973
24212
  (d) => d.value === 0 && formatOptions.xAxisLabel.hideZeroValues ? "hidden" : "visible"
23974
24213
  );
23975
- const finalBars = bars;
24214
+ const finalBars = formatOptions.animation.animationEnabled ? bars.transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]) : bars;
23976
24215
  finalBars.attr("x", (d) => {
23977
24216
  const xScaleUsed = data2.properties.axis === axisTypes.primary ? xScaleBottom : xScaleTop;
23978
24217
  return d.value >= 0 ? xScaleUsed(0) : xScaleUsed(d.value);
@@ -24495,7 +24734,7 @@
24495
24734
  hideTooltipOnMouseOut();
24496
24735
  });
24497
24736
  baseRects.attr("x", (d) => xScaleBottom(0));
24498
- const finalRects = baseRects;
24737
+ const finalRects = formatOptions.animation.animationEnabled ? baseRects.transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]) : baseRects;
24499
24738
  finalRects.attr("x", (d) => Math.min(xScaleBottom(d[0]), xScaleBottom(d[1]))).attr("width", (d) => Math.abs(xScaleBottom(d[1]) - xScaleBottom(d[0])));
24500
24739
  columnGroups.exit().remove();
24501
24740
  gTag.selectAll(".parentGroup").raise();
@@ -25198,7 +25437,7 @@
25198
25437
  selectAll('[hoverId="' + legend + '"]').classed("highlight", false).classed("unhighlight", false);
25199
25438
  hideTooltipOnMouseOut();
25200
25439
  });
25201
- const finalRects = baseRects;
25440
+ const finalRects = formatOptions.animation.animationEnabled ? baseRects.transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]) : baseRects;
25202
25441
  finalRects.attr("x", (d) => Math.min(xScaleBottom(d[0]), xScaleBottom(d[1]))).attr("width", (d) => Math.abs(xScaleBottom(d[1]) - xScaleBottom(d[0])));
25203
25442
  columnGroups.exit().remove();
25204
25443
  gTag.selectAll(".parentGroup").raise();
@@ -25342,7 +25581,6 @@
25342
25581
  let gTag;
25343
25582
  let xScaleBottom;
25344
25583
  let yScale;
25345
- let yScaleLegend;
25346
25584
  let calculatedRange;
25347
25585
  let xAxisBottom;
25348
25586
  let yAxis;
@@ -25582,7 +25820,7 @@
25582
25820
  getYScale();
25583
25821
  };
25584
25822
  const getYScale = () => {
25585
- yScaleLegend = band().domain(["layeredLegend"]).range([0, columnWidth]).paddingInner(
25823
+ band().domain(["layeredLegend"]).range([0, columnWidth]).paddingInner(
25586
25824
  chartJSON.legendList.length > 1 ? 0.3 * parseFloat(formatOptions.plotArea.plotAreaSeriesWidth) / 100 : 0
25587
25825
  );
25588
25826
  yScale = point$7().domain(filteredDimension).range(calculatedRange).padding(0.5);
@@ -25629,58 +25867,63 @@
25629
25867
  });
25630
25868
  });
25631
25869
  lineData.forEach((data2, index2) => {
25632
- let column = gTag.selectAll(".parentGroup").data([data2], (d) => d.properties.legendUniqueId);
25633
- column = column.enter().append("g").attr("class", `column parentGroup`).attr("clip-path", `url(#${chartId}-clip)`).merge(column);
25634
- let columnGroups = column.selectAll(".column-group").data(data2.data, (d) => d.properties.legendUniqueId);
25870
+ let column = gTag.selectAll(`.parentGroup-${data2.properties.legendUniqueId}`).data([data2], (d) => d.properties.legendUniqueId);
25871
+ column = column.enter().append("g").attr("class", `column parentGroup parentGroup-${data2.properties.legendUniqueId}`).attr("clip-path", `url(#${chartId}-clip)`).merge(column);
25872
+ let columnGroups = column.selectAll(".column-group").data(data2.data, (d) => d.dimension + "_" + data2.properties.legendUniqueId);
25635
25873
  let columnGroupsEnter = columnGroups.enter().append("g").attr("class", "column-group").attr(
25636
25874
  "hoverId",
25637
- (data2.properties.alias || data2.properties.name || "Legend").replace(
25638
- /\s+/g,
25639
- "-"
25640
- )
25875
+ (data2.properties.alias || data2.properties.name || "Legend").replace(/\s+/g, "-")
25641
25876
  ).attr(
25642
25877
  "transform",
25643
- (d) => index2 === 0 ? `translate(0,${yScale(d.dimension) - columnWidth / 2})` : `translate(0,${yScale(d.dimension) - columnWidth / (2 + index2 * 2)})`
25878
+ (d) => index2 === 0 ? `translate(0, ${yScale(d.dimension) - columnWidth / 2})` : `translate(0, ${yScale(d.dimension) - columnWidth / (2 + index2 * 2)})`
25644
25879
  );
25645
25880
  columnGroups.attr(
25646
25881
  "transform",
25647
- (d) => index2 === 0 ? `translate(0,${yScale(d.dimension) - columnWidth / 2})` : `translate(0,${yScale(d.dimension) - columnWidth / (2 + index2 * 2)})`
25882
+ (d) => index2 === 0 ? `translate(0, ${yScale(d.dimension) - columnWidth / 2})` : `translate(0, ${yScale(d.dimension) - columnWidth / (2 + index2 * 2)})`
25648
25883
  );
25649
25884
  columnGroupsEnter.merge(columnGroups).attr(
25650
25885
  "transform",
25651
- (d) => index2 === 0 ? `translate(0,${yScale(d.dimension) - columnWidth / 2})` : `translate(0,${yScale(d.dimension) - columnWidth / (2 + index2 * 2)})`
25886
+ (d) => index2 === 0 ? `translate(0, ${yScale(d.dimension) - columnWidth / 2})` : `translate(0, ${yScale(d.dimension) - columnWidth / (2 + index2 * 2)})`
25652
25887
  );
25653
- columnGroupsEnter.append("rect").attr("y", (d) => yScaleLegend(d.dimension)).attr("height", index2 === 0 ? columnWidth : columnWidth / 2).attr("x", (d) => {
25654
- return d.value > 0 ? xScaleBottom(0) : xScaleBottom(d.value);
25655
- }).attr(
25656
- "width",
25657
- (d) => d.value > 0 ? customYaxisMaxValue && d.value > customYaxisMaxValue ? xScaleBottom(customYaxisMaxValue) - xScaleBottom(0) : xScaleBottom(d.value) - xScaleBottom(0) : Math.abs(xScaleBottom(0) - xScaleBottom(d.value))
25658
- ).attr("fill", (d) => colorScaleMap.get(data2.properties.legendUniqueId)?.(d.value) ?? data2.properties.color).attr(
25888
+ const bars = columnGroupsEnter.append("rect").attr("y", 0).attr("height", index2 === 0 ? columnWidth : columnWidth / 2).attr("x", () => xScaleBottom(0)).attr("width", 0).attr(
25889
+ "fill",
25890
+ (d) => colorScaleMap.get(data2.properties.legendUniqueId)?.(d.value) ?? data2.properties.color
25891
+ ).attr(
25659
25892
  "stroke-dasharray",
25660
- (d) => d.stackBorderStyle === 2 ? "5,3" : "0"
25661
- ).attr("stroke-width", (d) => `${d.stackBorderWidth}px`).attr(
25893
+ () => data2.properties.stackBorderStyle == 2 ? "5,3" : "0"
25894
+ ).attr("stroke-width", `${data2.properties.stackBorderWidth}px`).attr(
25662
25895
  "stroke",
25663
- (d) => data2.properties.stackBorderStyle === 0 ? "none" : formatOptions.column.stackBorderVisibility ? data2.properties.stackBorderStyle : "none"
25896
+ () => data2.properties.stackBorderStyle == 0 ? "none" : formatOptions.column.stackBorderVisibility ? data2.properties.stackBorderColor : "none"
25664
25897
  ).style("clip-path", "inset(0px) fill-box").style("shape-rendering", "crispEdges").attr("opacity", 0.7).attr(
25665
25898
  "visibility",
25666
25899
  (d) => d.value === 0 && formatOptions.xAxisLabel.hideZeroValues ? "hidden" : "visible"
25667
- ).on("mousemove", (event2, d) => {
25900
+ );
25901
+ const finalBars = formatOptions.animation.animationEnabled ? bars.transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]) : bars;
25902
+ finalBars.attr(
25903
+ "x",
25904
+ (d) => d.value > 0 ? xScaleBottom(0) : xScaleBottom(d.value)
25905
+ ).attr(
25906
+ "width",
25907
+ (d) => d.value > 0 ? xScaleBottom(d.value) - xScaleBottom(0) : Math.abs(xScaleBottom(0) - xScaleBottom(d.value))
25908
+ );
25909
+ columnGroups.select("rect").transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]).attr(
25910
+ "x",
25911
+ (d) => d.value > 0 ? xScaleBottom(0) : xScaleBottom(d.value)
25912
+ ).attr(
25913
+ "width",
25914
+ (d) => d.value > 0 ? xScaleBottom(d.value) - xScaleBottom(0) : Math.abs(xScaleBottom(0) - xScaleBottom(d.value))
25915
+ );
25916
+ columnGroupsEnter.merge(columnGroups).on("mousemove", (event2, d) => {
25668
25917
  showTooltipOnMouseMove(
25669
25918
  [
25670
25919
  {
25671
25920
  key: formatOptions.xAxisTitle.xAxisTitleHTML !== "" ? new DOMParser().parseFromString(formatOptions.xAxisTitle.xAxisTitleHTML, "text/html").body.textContent?.trim() : formatOptions.xAxisTitle.xAxisTitleText.includes("~$~") ? formatOptions.xAxisTitle.xAxisTitleText.split("~$~")[1] : formatOptions.xAxisTitle.xAxisTitleText,
25672
- value: chartJSON.formattedDimensionListMap.get(
25673
- Array.isArray(d.dimension) ? d.dimension[0] : d.dimension
25674
- )
25921
+ value: chartJSON.formattedDimensionListMap.get(d.dimension)
25675
25922
  },
25676
25923
  {
25677
- key: formatOptions.yAxisTitle.yAxisTitleHTML !== "" ? new DOMParser().parseFromString(formatOptions.yAxisTitle.yAxisTitleHTML, "text/html").body.textContent?.trim() : d.properties?.currentMeasure ? d.properties.currentMeasure : formatOptions.yAxisTitle.yAxisTitleText || d.value,
25924
+ key: formatOptions.yAxisTitle.yAxisTitleHTML !== "" ? new DOMParser().parseFromString(formatOptions.yAxisTitle.yAxisTitleHTML, "text/html").body.textContent?.trim() : d.properties?.currentMeasure || formatOptions.yAxisTitle.yAxisTitleText || d.value,
25678
25925
  value: getNumberWithFormat(
25679
- [
25680
- chartTypes.NormalizedStackLineChart,
25681
- chartTypes.NormalizedStackAreaChart,
25682
- ""
25683
- ].includes(chartType) ? d[1] - d[0] : d.value,
25926
+ d.value,
25684
25927
  formatOptions.toolTip.toolTipDisplayUnits,
25685
25928
  formatOptions.toolTip.toolTipNumberFormat,
25686
25929
  formatOptions.toolTip.toolTipDecimalPrecision
@@ -25695,13 +25938,7 @@
25695
25938
  event2,
25696
25939
  data2.properties
25697
25940
  );
25698
- let legend = (data2.properties.alias || data2.properties.name || "Legend").replace(/ /g, "-");
25699
- selectAll(".parentGroup").classed("highlight", false).classed("unhighlight", true);
25700
- selectAll('[hoverId="' + legend + '"]').classed("highlight", true).classed("unhighlight", false);
25701
- }).on("mouseout", (e, d) => {
25702
- let legend = (data2.properties.alias || data2.properties.name || "Legend").replace(/ /g, "-");
25703
- selectAll(".parentGroup").classed("highlight", false).classed("unhighlight", false);
25704
- selectAll('[hoverId="' + legend + '"]').classed("highlight", false).classed("unhighlight", false);
25941
+ }).on("mouseout", () => {
25705
25942
  hideTooltipOnMouseOut();
25706
25943
  });
25707
25944
  columnGroups.exit().remove();
@@ -26388,7 +26625,8 @@
26388
26625
  formatOptions.bins.binsCalculation === "Automatic" ? yAxisLeft.ticks(thresholds) : yAxisLeft.tickValues(periods).ticks(innerHeight2 / 50);
26389
26626
  };
26390
26627
  const getChartType = (lineData) => {
26391
- gTag.append("g").attr("class", "parentGroup").selectAll("#scaling-svg" + chartId + " .rect").data(bins).enter().append("g").selectAll("rect").data((d) => d).enter().append("rect").attr("class", "rect").attr(
26628
+ const shouldAnimate = formatOptions.animation.animationEnabled;
26629
+ const bars = gTag.append("g").attr("class", "parentGroup").selectAll("#scaling-svg" + chartId + " .rect").data(bins).enter().append("g").selectAll("rect").data((d) => d).enter().append("rect").attr("class", "rect").attr(
26392
26630
  "stroke",
26393
26631
  formatOptions.bins.binsBorderVisibility && formatOptions.bins.binsBorderColor
26394
26632
  ).attr(
@@ -26406,7 +26644,7 @@
26406
26644
  const y12 = yScaleLeft(d.x1);
26407
26645
  const gap = parseFloat(formatOptions.bins.binsGapWidth) || 0;
26408
26646
  return Math.max(1, Math.abs(y12 - y02) - gap);
26409
- }).attr("width", (d) => xScale(d.length)).style("fill", (d) => d.color !== commonColors.white ? d.color : "none").style("opacity", formatOptions.bins.binsFillOpacity).style("shape-rendering", "crispEdges").on("mousemove", (event2, d) => {
26647
+ }).attr("width", 0).style("fill", (d) => d.color !== commonColors.white ? d.color : "none").style("opacity", formatOptions.bins.binsFillOpacity).style("shape-rendering", "crispEdges").on("mousemove", (event2, d) => {
26410
26648
  showTooltipOnMouseMove(
26411
26649
  [
26412
26650
  {
@@ -26428,6 +26666,8 @@
26428
26666
  event2
26429
26667
  );
26430
26668
  }).on("mouseout", hideTooltipOnMouseOut);
26669
+ const finalBars = shouldAnimate ? bars.transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]) : bars;
26670
+ finalBars.attr("width", (d) => xScale(d.length));
26431
26671
  gTag.selectAll(".parentGroup").raise();
26432
26672
  };
26433
26673
  const setSVGContainer = (margin2) => {
@@ -26923,6 +27163,7 @@
26923
27163
  const areaGeneratorStart = area().x(
26924
27164
  (d) => xScale(d.dimension) ? xScale(d.dimension) : null
26925
27165
  ).y0(() => yScaleLeft(0)).y1(() => yScaleLeft(0)).defined((d) => d.hideZero ? Boolean(d.value) : true).curve(getCurveType(formatOptions));
27166
+ const enableTransition = formatOptions.animation.animationEnabled;
26926
27167
  let areas = gTag.selectAll(".parentGroup").data([lineData]);
26927
27168
  let focus = gTag.append("g").attr("class", "focusClass");
26928
27169
  areas = areas.enter().append("g").attr("class", "areas lineGroup").attr("clip-path", `url(#${chartId}-clip)`).merge(areas);
@@ -26938,7 +27179,9 @@
26938
27179
  "-"
26939
27180
  )
26940
27181
  ).attr("d", (d) => areaGeneratorStart(d.data)).each(function(d) {
26941
- {
27182
+ if (enableTransition) {
27183
+ select$2(this).transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]).attr("d", areaGenerator(d.data));
27184
+ } else {
26942
27185
  select$2(this).attr("d", areaGenerator(d.data));
26943
27186
  }
26944
27187
  });
@@ -27459,6 +27702,7 @@
27459
27702
  ).tickSizeOuter(0).tickValues(responsiveXaxisLabel(filteredDimension, innerWidth2));
27460
27703
  };
27461
27704
  const getChartType = (lineData) => {
27705
+ const enableTransition = formatOptions.animation.animationEnabled;
27462
27706
  const isLinesAndMarkersVisible = formatOptions.plotArea.plotAreaHideLineAndMarkers;
27463
27707
  lineData.forEach((lData) => {
27464
27708
  lData.data.forEach((cData) => {
@@ -27485,7 +27729,9 @@
27485
27729
  "hoverId",
27486
27730
  (d) => (lineData[d.index].properties.alias || lineData[d.index].properties.name || "Legend").replace(/\s+/g, "-")
27487
27731
  ).attr("class", "area parentGroup").attr("fill", (d) => d.color !== commonColors.white ? d.color : "none").style("fill-opacity", formatOptions.plotArea.fillOpacity).style("pointer-events", "none").attr("d", (d) => areaGeneratorStart(d)).each(function(d) {
27488
- {
27732
+ if (enableTransition) {
27733
+ select$2(this).transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]).attr("d", areaGenerator(d));
27734
+ } else {
27489
27735
  select$2(this).attr("d", areaGenerator(d));
27490
27736
  }
27491
27737
  });
@@ -28014,6 +28260,7 @@
28014
28260
  ).tickSizeOuter(0).tickValues(responsiveXaxisLabel(filteredDimension, innerWidth2));
28015
28261
  };
28016
28262
  const getChartType = (lineData) => {
28263
+ const enableTransition = formatOptions.animation.animationEnabled;
28017
28264
  const isLinesAndMarkersVisible = formatOptions.plotArea.plotAreaHideLineAndMarkers;
28018
28265
  stackChartData.forEach(
28019
28266
  (data2, i) => data2.forEach((item, position) => {
@@ -28048,7 +28295,9 @@
28048
28295
  (d) => (lineData[d.index]?.properties?.alias || lineData[d.index]?.properties?.name || "Legend").replace(/\s+/g, "-")
28049
28296
  ).attr("class", "area parentGroup").attr("fill", (d) => d.color !== commonColors.white ? d.color : "none").style("fill-opacity", formatOptions.plotArea.fillOpacity).style("pointer-events", "none").attr("d", (d) => columnGeneratorStart(d)).each(function(d) {
28050
28297
  const path2 = select$2(this);
28051
- {
28298
+ if (enableTransition) {
28299
+ path2.transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]).attr("d", columnGenerator(d));
28300
+ } else {
28052
28301
  path2.attr("d", columnGenerator(d));
28053
28302
  }
28054
28303
  });
@@ -28483,13 +28732,13 @@
28483
28732
  try {
28484
28733
  const arc2 = arc$1().innerRadius(0).outerRadius(radius);
28485
28734
  const arcOver = arc$1().innerRadius(0).outerRadius(radius + 10);
28486
- chartAreaTagG.append("g").attr("class", "parentGroup").attr("fill-opacity", chartFormatOptions.plotArea.opacity).attr("transform", `${getPiePosition()}`).selectAll("path").data(pieChartData).enter().append("path").attr("class", (d) => "path").attr(
28735
+ const paths = chartAreaTagG.append("g").attr("class", "parentGroup").attr("fill-opacity", chartFormatOptions.plotArea.opacity).attr("transform", `${getPiePosition()}`).selectAll("path").data(pieChartData).enter().append("path").attr("class", (d) => "path").attr(
28487
28736
  "hoverId",
28488
28737
  (d) => (d.data?.properties?.alias || d.data?.properties?.name || "Legend").replace(/\s+/g, "-")
28489
28738
  ).attr(
28490
28739
  "fill",
28491
28740
  (d) => d.data.properties.color !== commonColors.white ? d.data.properties.color : "none"
28492
- ).attr("d", (d) => arc2(d)).on("mouseover.arc", function(d) {
28741
+ ).on("mouseover.arc", function(d) {
28493
28742
  select$2(this).transition().duration(100).attr("d", arcOver);
28494
28743
  }).on("mousemove. ", (d) => {
28495
28744
  showTooltipOnMouseMove(
@@ -28520,6 +28769,17 @@
28520
28769
  select$2(this).transition().duration(100).attr("d", arc2);
28521
28770
  hideTooltipOnMouseOut();
28522
28771
  });
28772
+ if (chartFormatOptions.animation.animationEnabled) {
28773
+ paths.transition().duration(chartFormatOptions.animation.animationDuration).ease(effectsMap[chartFormatOptions.animation.animationEffect]).attrTween("d", function(d) {
28774
+ const interpolate2 = interpolate$4(
28775
+ { startAngle: d.startAngle, endAngle: d.startAngle },
28776
+ d
28777
+ );
28778
+ return (t) => arc2(interpolate2(t));
28779
+ });
28780
+ } else {
28781
+ paths.attr("d", (d) => arc2(d));
28782
+ }
28523
28783
  } catch (error) {
28524
28784
  logError$2(fileName$8, "drawPieChart", error);
28525
28785
  }
@@ -28892,7 +29152,7 @@
28892
29152
  };
28893
29153
  const drawDonutChart = () => {
28894
29154
  try {
28895
- const enableTransition = false;
29155
+ const enableTransition = chartFormatOptions.animation.animationEnabled;
28896
29156
  const arc2 = arc$1().innerRadius(innerRadius).outerRadius(radius);
28897
29157
  const arcOver = arc$1().innerRadius(innerRadius).outerRadius(radius + 10);
28898
29158
  const parentGroup = chartAreaTagG.append("g").attr("class", "parentGroup").attr("fill-opacity", chartFormatOptions.plotArea.opacity).attr("transform", `${getPiePosition()}`);
@@ -28906,8 +29166,9 @@
28906
29166
  const thisPath = d;
28907
29167
  thisPath._current = { startAngle: 0, endAngle: 0 };
28908
29168
  }).on("mouseover.arc", function() {
28909
- if (enableTransition) ;
28910
- else {
29169
+ if (enableTransition) {
29170
+ select$2(this).transition().duration(150).attr("d", arcOver);
29171
+ } else {
28911
29172
  select$2(this).attr("d", arcOver);
28912
29173
  }
28913
29174
  }).on("mousemove.text", (d) => {
@@ -28934,13 +29195,23 @@
28934
29195
  d.currentTarget.__data__.data.properties
28935
29196
  );
28936
29197
  }).on("mouseout.text", () => hideTooltipOnMouseOut()).on("mouseout.arc", function() {
28937
- if (enableTransition) ;
28938
- else {
29198
+ if (enableTransition) {
29199
+ select$2(this).transition().duration(150).attr("d", arc2);
29200
+ } else {
28939
29201
  select$2(this).attr("d", arc2);
28940
29202
  }
28941
29203
  });
28942
- if (enableTransition) ;
28943
- else {
29204
+ if (enableTransition) {
29205
+ paths.transition().duration(chartFormatOptions.animation.animationDuration).ease(effectsMap[chartFormatOptions.animation.animationEffect]).attrTween("d", function(d) {
29206
+ const interpolate2 = interpolate$4(
29207
+ { startAngle: d.startAngle, endAngle: d.startAngle },
29208
+ d
29209
+ );
29210
+ return function(t) {
29211
+ return arc2(interpolate2(t));
29212
+ };
29213
+ });
29214
+ } else {
28944
29215
  paths.attr("d", (d) => arc2(d));
28945
29216
  }
28946
29217
  } catch (error) {
@@ -29388,8 +29659,9 @@
29388
29659
  };
29389
29660
  const initChartRect = () => {
29390
29661
  try {
29662
+ const shouldAnimate = chartFormatOptions.animation.animationEnabled;
29391
29663
  const leaf = chartAreaTagG.selectAll("g").data(chartData).enter().append("g").attr("transform", (d) => `translate(${d.x0},${d.y0})`);
29392
- leaf.append("rect").attr("fill", (d) => getColor(d.data)).attr("fill-opacity", 0.7).attr("width", (d) => d.x1 - d.x0).attr("height", (d) => d.y1 - d.y0).on("mousemove", (d, data2) => {
29664
+ const rects = leaf.append("rect").attr("fill", (d) => getColor(d.data)).attr("fill-opacity", shouldAnimate ? 0 : 0.7).attr("width", (d) => d.x1 - d.x0).attr("height", (d) => d.y1 - d.y0).on("mousemove", (d, data2) => {
29393
29665
  showTooltipOnMouseMove(
29394
29666
  [
29395
29667
  {
@@ -29407,6 +29679,9 @@
29407
29679
  getMarkerColorForTooltip(d)
29408
29680
  );
29409
29681
  }).on("mouseout", () => hideTooltipOnMouseOut());
29682
+ if (shouldAnimate) {
29683
+ rects.transition().duration(chartFormatOptions.animation.animationDuration).ease(effectsMap[chartFormatOptions.animation.animationEffect]).attr("fill-opacity", 0.7);
29684
+ }
29410
29685
  leaf.append("clipPath").attr("id", (d, i) => `clip-${i}-${chartId}`).append("rect").attr("width", (d) => d.x1 - d.x0).attr("height", (d) => d.y1 - d.y0);
29411
29686
  if (chartFormatOptions.plotArea.dataLabels) {
29412
29687
  leaf.append("text").style("fill", (d) => d.data.properties.labelFontColor).style("font-family", (d) => d.data.properties.fontFamily).style("font-size", (d) => d.data.properties.fontSize).style(
@@ -29567,10 +29842,10 @@
29567
29842
  try {
29568
29843
  const arc2 = arc$1().innerRadius(0).outerRadius(radius);
29569
29844
  const arcOver = arc$1().innerRadius(0).outerRadius(radius + 10);
29570
- chartAreaTagG.append("g").attr("class", "parentGroup").attr("fill-opacity", chartFormatOptions.plotArea.opacity).attr("transform", `${getParentPiePosition()}`).selectAll("path").data(pieOfPieData).enter().append("path").attr("class", (d) => "path " + d.data.legend).attr("hoverId", (d) => d.data.legend.replace(/ /g, "-")).attr(
29845
+ const paths = chartAreaTagG.append("g").attr("class", "parentGroup").attr("fill-opacity", chartFormatOptions.plotArea.opacity).attr("transform", `${getParentPiePosition()}`).selectAll("path").data(pieOfPieData).enter().append("path").attr("class", (d) => "path " + d.data.legend).attr("hoverId", (d) => d.data.legend.replace(/ /g, "-")).attr(
29571
29846
  "fill",
29572
29847
  (d) => d.data.properties.color !== commonColors.white ? d.data.properties.color : "none"
29573
- ).attr("d", (d) => arc2(d)).on("mouseover.arc", function(d) {
29848
+ ).on("mouseover.arc", function(d) {
29574
29849
  select$2(this).transition().duration(100).attr("d", arcOver);
29575
29850
  }).on("mousemove.text", (d) => {
29576
29851
  showTooltipOnMouseMove(
@@ -29615,14 +29890,25 @@
29615
29890
  logError$2(fileName$5, "drawPieChart_onClick", error);
29616
29891
  }
29617
29892
  });
29893
+ if (chartFormatOptions.animation.animationEnabled) {
29894
+ paths.transition().duration(chartFormatOptions.animation.animationDuration).ease(effectsMap[chartFormatOptions.animation.animationEffect]).attrTween("d", function(d) {
29895
+ const interpolate2 = interpolate$4(
29896
+ { startAngle: d.startAngle, endAngle: d.startAngle },
29897
+ d
29898
+ );
29899
+ return (t) => arc2(interpolate2(t));
29900
+ });
29901
+ } else {
29902
+ paths.attr("d", (d) => arc2(d));
29903
+ }
29618
29904
  } catch (error) {
29619
29905
  logError$2(fileName$5, "drawPieChart", error);
29620
29906
  }
29621
29907
  };
29622
29908
  const drawChildPie = (childData, rotate2, parentArc) => {
29623
29909
  try {
29624
- chartAreaTagG.select(".parentGroup").transition().attr("transform", `${getParentPiePosition()} rotate(${rotate2})`).duration(1e3);
29625
- chartAreaTagG.selectAll(".parentLabels").transition().attr("transform", `${getParentPiePosition()} rotate(${rotate2})`).duration(1e3);
29910
+ chartAreaTagG.select(".parentGroup").transition().duration(chartFormatOptions.animation.animationDuration).ease(effectsMap[chartFormatOptions.animation.animationEffect]).attr("transform", `${getParentPiePosition()} rotate(${rotate2})`);
29911
+ chartAreaTagG.selectAll(".parentLabels").transition().duration(chartFormatOptions.animation.animationDuration).ease(effectsMap[chartFormatOptions.animation.animationEffect]).attr("transform", `${getParentPiePosition()} rotate(${rotate2})`);
29626
29912
  const childPie = pie().value((d) => d.data[0].value);
29627
29913
  let childPieData = childPie(childData).map((d, i) => ({
29628
29914
  ...d,
@@ -29850,8 +30136,8 @@
29850
30136
  let radius2 = angleData.y1;
29851
30137
  let y2 = radius2 * Math.sin(arcAngle);
29852
30138
  let x2 = y2 / Math.tan(arcAngle);
29853
- chartAreaTagG.append("line").transition().style("stroke", chartFormatOptions.pieofPie.pieOfPieLineColor).style("stroke-width", chartFormatOptions.pieofPie.pieOfPieLineWidth).style("stroke-dasharray", "3, 3").attr("opacity", 0.5).attr("x1", parentPieX + x2).attr("y1", parentPieY - y2).attr("x2", childPieX).attr("y2", childPieY - childRadius).duration(1e3);
29854
- chartAreaTagG.append("line").transition().style("stroke", chartFormatOptions.pieofPie.pieOfPieLineColor).style("stroke-width", chartFormatOptions.pieofPie.pieOfPieLineWidth).style("stroke-dasharray", "3, 3").attr("opacity", 0.5).attr("x1", parentPieX + x2).attr("y1", parentPieY + y2).attr("x2", childPieX).attr("y2", childPieY + childRadius).duration(1e3);
30139
+ chartAreaTagG.append("line").style("stroke", chartFormatOptions.pieofPie.pieOfPieLineColor).style("stroke-width", chartFormatOptions.pieofPie.pieOfPieLineWidth).style("stroke-dasharray", "3, 3").attr("opacity", 0.5).attr("x1", parentPieX + x2).attr("y1", parentPieY - y2).attr("x2", childPieX).attr("y2", childPieY - childRadius);
30140
+ chartAreaTagG.append("line").style("stroke", chartFormatOptions.pieofPie.pieOfPieLineColor).style("stroke-width", chartFormatOptions.pieofPie.pieOfPieLineWidth).style("stroke-dasharray", "3, 3").attr("opacity", 0.5).attr("x1", parentPieX + x2).attr("y1", parentPieY + y2).attr("x2", childPieX).attr("y2", childPieY + childRadius);
29855
30141
  } catch (error) {
29856
30142
  logError$2(fileName$5, "drawLines", error);
29857
30143
  }
@@ -29991,7 +30277,8 @@
29991
30277
  const bottomWidth = pyramidSide * (inversionConstant - stackHeightArray[i + 1] / pyramidHeight);
29992
30278
  const centerX = innerWidth2 / 2;
29993
30279
  const pyramidContainer = chartAreaTagG.append("g").attr("id", "PyramidChart").attr("class", "parentGroup");
29994
- pyramidContainer.append("polygon").attr("class", "segment").attr("hoverId", d.legend.replace(/\s+/g, "-")).attr(
30280
+ const shouldAnimate = chartFormatOptions.animation.animationEnabled;
30281
+ const polygon = pyramidContainer.append("polygon").attr("class", "segment").attr("hoverId", d.legend.replace(/\s+/g, "-")).attr(
29995
30282
  "points",
29996
30283
  `
29997
30284
  ${centerX - topWidth / 2},${yTop}
@@ -29999,7 +30286,7 @@
29999
30286
  ${centerX + bottomWidth / 2},${yBottom}
30000
30287
  ${centerX - bottomWidth / 2},${yBottom}
30001
30288
  `
30002
- ).attr("fill", d.properties.color || "#4cb2ff").on("mousemove", function() {
30289
+ ).attr("fill", d.properties.color || "#4cb2ff").attr("opacity", shouldAnimate ? 0 : 1).on("mousemove", function() {
30003
30290
  try {
30004
30291
  showTooltipOnMouseMove(
30005
30292
  [
@@ -30032,6 +30319,9 @@
30032
30319
  logError$2(fileName$4, "drawPyramidChart.onMouseOut", error);
30033
30320
  }
30034
30321
  });
30322
+ if (shouldAnimate) {
30323
+ polygon.transition().duration(chartFormatOptions.animation.animationDuration).ease(effectsMap[chartFormatOptions.animation.animationEffect]).attr("opacity", 1);
30324
+ }
30035
30325
  } catch (error) {
30036
30326
  logError$2(fileName$4, "drawPyramidChart.forEach", error);
30037
30327
  }
@@ -30433,7 +30723,7 @@
30433
30723
  }).attr(
30434
30724
  "transform",
30435
30725
  "translate(" + innerWidth2 / 2 + "," + innerHeight2 / 2 + ")"
30436
- ).transition().duration(1e3).attrTween("d", function(d) {
30726
+ ).transition().duration(chartFormatOptions.animation.animationEnabled ? chartFormatOptions.animation.animationDuration : 0).ease(effectsMap[chartFormatOptions.animation.animationEffect]).attrTween("d", function(d) {
30437
30727
  try {
30438
30728
  const interpolate2 = interpolate$4(0, progressAngle);
30439
30729
  return function(t) {
@@ -30841,7 +31131,7 @@
30841
31131
  }
30842
31132
  let ratio = scale2(newValue);
30843
31133
  let newAngle = config.minAngle + ratio * range2;
30844
- pointer2.transition().duration(config.transitionMs).ease(elasticOut$1).attr("transform", "rotate(" + newAngle + ")");
31134
+ pointer2.transition().duration(chartFormatOptions.animation.animationEnabled ? chartFormatOptions.animation.animationDuration : 0).ease(effectsMap[chartFormatOptions.animation.animationEffect]).attr("transform", "rotate(" + newAngle + ")");
30845
31135
  } catch (error) {
30846
31136
  logError$2(fileName2, "gauge.update", error);
30847
31137
  }
@@ -31258,9 +31548,7 @@
31258
31548
  }).on("mouseout", () => {
31259
31549
  hideTooltipOnMouseOut();
31260
31550
  });
31261
- arcs.transition().delay(
31262
- (d, i) => chartFormatOptions.plotArea.arcTransition ? i * 200 : 0
31263
- ).duration(chartFormatOptions.plotArea.arcTransition ? 500 : 0).attrTween("d", arcTween);
31551
+ arcs.transition().duration(chartFormatOptions.animation.animationEnabled ? chartFormatOptions.animation.animationDuration : 0).ease(effectsMap[chartFormatOptions.animation.animationEffect]).attrTween("d", arcTween);
31264
31552
  if (chartFormatOptions.plotArea.dataLabels) {
31265
31553
  const labelsData = getModifiedDataForLabels(ChartData);
31266
31554
  svg2.selectAll(".arc-label-" + chartId).data(labelsData).enter().append("text").attr("class", "arc-label-" + chartId).attr("class", "parentGroup").attr("text-anchor", "start").attr("dy", (d, i) => (getOuterRadius(d.index ?? i) - getInnerRadius(d.index ?? i)) / 1.75).append("textPath").attr("xlink:href", (d, i) => `#arc-path-${d.index ?? i}-` + chartId).style("startOffset", "50%").attr("hoverId", (d) => d.legend.replaceAll(" ", "-")).text(
@@ -31650,11 +31938,11 @@
31650
31938
  return false;
31651
31939
  }
31652
31940
  function cloudBounds(bounds, d) {
31653
- var b0 = bounds[0], b1 = bounds[1];
31654
- if (d.x + d.x0 < b0.x) b0.x = d.x + d.x0;
31655
- if (d.y + d.y0 < b0.y) b0.y = d.y + d.y0;
31656
- if (d.x + d.x1 > b1.x) b1.x = d.x + d.x1;
31657
- if (d.y + d.y1 > b1.y) b1.y = d.y + d.y1;
31941
+ var b02 = bounds[0], b12 = bounds[1];
31942
+ if (d.x + d.x0 < b02.x) b02.x = d.x + d.x0;
31943
+ if (d.y + d.y0 < b02.y) b02.y = d.y + d.y0;
31944
+ if (d.x + d.x1 > b12.x) b12.x = d.x + d.x1;
31945
+ if (d.y + d.y1 > b12.y) b12.y = d.y + d.y1;
31658
31946
  }
31659
31947
  function collideRects(a2, b) {
31660
31948
  return a2.x + a2.x1 > b[0].x && a2.x + a2.x0 < b[1].x && a2.y + a2.y1 > b[0].y && a2.y + a2.y0 < b[1].y;
@@ -32332,8 +32620,8 @@
32332
32620
  pairs[[b, a2]] = true;
32333
32621
  }
32334
32622
  }
32335
- ids.sort(function(a3, b2) {
32336
- return a3 > b2;
32623
+ ids.sort(function(a3, b10) {
32624
+ return a3 > b10;
32337
32625
  });
32338
32626
  for (i = 0; i < ids.length; ++i) {
32339
32627
  a2 = ids[i];
@@ -54377,7 +54665,8 @@
54377
54665
  let maxBubbleSize = 30;
54378
54666
  let sizeData = { minimumValue: minMeasure, maximumValue: maxMeasure };
54379
54667
  const circles = chartAreaTagG.append("g").attr("class", "circles").attr("class", "parentGroup");
54380
- circles.append("g").selectAll(".bubbleScatter").data(data).enter().append("g").attr(
54668
+ const shouldAnimate = chartFormatOptions.animation.animationEnabled;
54669
+ const bubblePaths = circles.append("g").selectAll(".bubbleScatter").data(data).enter().append("g").attr(
54381
54670
  "hoverId",
54382
54671
  (d) => d.legendName.replace(/ /g, "-")
54383
54672
  ).attr(
@@ -54400,7 +54689,7 @@
54400
54689
  );
54401
54690
  }).attr("transform", function(d) {
54402
54691
  return `translate(${xScale(d.dimension)}, ${yScale(d.measure)})`;
54403
- }).attr("opacity", chartFormatOptions.plotArea.fillOpacity).style(
54692
+ }).attr("opacity", shouldAnimate ? 0 : chartFormatOptions.plotArea.fillOpacity).style(
54404
54693
  "visibility",
54405
54694
  (d, i) => d.dimension[0] === 0 || d.measure === 0 && chartFormatOptions.plotArea.hideZeroValues || d.dimension < customXaxisMinValue || d.dimension > customXaxisMaxValue || d.measure < customYaxisMinValue || d.measure > customYaxisMaxValue ? "hidden" : "visible"
54406
54695
  ).on("mousemove", (event2, d) => {
@@ -54430,6 +54719,9 @@
54430
54719
  }).on("mouseout", () => {
54431
54720
  hideTooltipOnMouseOut();
54432
54721
  });
54722
+ if (shouldAnimate) {
54723
+ bubblePaths.transition().duration(chartFormatOptions.animation.animationDuration).ease(effectsMap[chartFormatOptions.animation.animationEffect]).attr("opacity", chartFormatOptions.plotArea.fillOpacity);
54724
+ }
54433
54725
  } catch (e) {
54434
54726
  logError$2("BubbleChart", "initCircles", e);
54435
54727
  }
@@ -54827,7 +55119,8 @@
54827
55119
  return Shape == "Square" ? square : Shape == "Circle" ? circle : Shape == "Cross" ? cross : Shape == "Triangle" ? triangle : Shape == "Star" ? star : Shape == "Diamond" ? diamond : Shape == "Wye" ? wye : circle;
54828
55120
  };
54829
55121
  const circles = chartAreaTagG.append("g").attr("class", "circles").attr("class", "parentGroup");
54830
- circles.append("g").selectAll(".bubbleScatter").data(data).enter().append("g").attr("fill", (d) => d.selectedColor).attr(
55122
+ const shouldAnimate = chartFormatOptions.animation.animationEnabled;
55123
+ const scatterPaths = circles.append("g").selectAll(".bubbleScatter").data(data).enter().append("g").attr("fill", (d) => d.selectedColor).attr(
54831
55124
  "colorId",
54832
55125
  (d) => d.legendName.includes("-") ? d.legendName.split("-")[0].replace(/ /g, "-") : d.legendName.replace(/ /g, "-")
54833
55126
  ).attr(
@@ -54844,7 +55137,7 @@
54844
55137
  );
54845
55138
  }).attr("transform", function(d) {
54846
55139
  return `translate(${xScale(d.dimension)}, ${yScale(d.measure)})`;
54847
- }).attr("opacity", chartFormatOptions.plotArea.fillOpacity).style(
55140
+ }).attr("opacity", shouldAnimate ? 0 : chartFormatOptions.plotArea.fillOpacity).style(
54848
55141
  "visibility",
54849
55142
  (d, i) => d.dimension[0] === 0 || d.measure === 0 && chartFormatOptions.plotArea.hideZeroValues || d.dimension < customXaxisMinValue || d.dimension > customXaxisMaxValue || d.measure < customYaxisMinValue || d.measure > customYaxisMaxValue ? "hidden" : "visible"
54850
55143
  ).on("mousemove", (event2, d) => {
@@ -54874,6 +55167,9 @@
54874
55167
  }).on("mouseout", () => {
54875
55168
  hideTooltipOnMouseOut();
54876
55169
  });
55170
+ if (shouldAnimate) {
55171
+ scatterPaths.transition().duration(chartFormatOptions.animation.animationDuration).ease(effectsMap[chartFormatOptions.animation.animationEffect]).attr("opacity", chartFormatOptions.plotArea.fillOpacity);
55172
+ }
54877
55173
  } catch (e) {
54878
55174
  logError$2(fileName, "initCircles", e);
54879
55175
  }
@@ -55713,6 +56009,7 @@
55713
56009
  (d) => d,
55714
56010
  (d) => d.key || d.Key
55715
56011
  );
56012
+ const shouldAnimate = formatOptions.animation.animationEnabled;
55716
56013
  const rectsEnter = rects.enter().append("rect").attr("class", "rect").attr(
55717
56014
  "class",
55718
56015
  (d) => d.key ? d.key.replace(/ /g, "-") : d.Key.replace(/ /g, "-")
@@ -55721,10 +56018,7 @@
55721
56018
  (d) => xScale(
55722
56019
  !isAdvancedWaterfall ? d.data.dimension || d.data.legend : d.data.xKey
55723
56020
  )
55724
- ).attr("y", (d) => d[1] ? yScaleLeft(d[1]) : 0).attr("clip-path", `url(#${chartId}-clip)`).attr(
55725
- "height",
55726
- (d) => d[1] ? yScaleLeft(d[0]) - yScaleLeft(d[1]) : 0
55727
- ).attr("width", xScale.bandwidth()).attr(
56021
+ ).attr("y", yScaleLeft(0) ?? 0).attr("clip-path", `url(#${chartId}-clip)`).attr("height", 0).attr("width", xScale.bandwidth()).attr(
55728
56022
  "visibility",
55729
56023
  (d) => k2 === 0 && d.data.dimension && stackTotalData ? "hidden" : "visible"
55730
56024
  ).style("shape-rendering", "crispEdges").on("mousemove", (event2, d) => {
@@ -55756,6 +56050,8 @@
55756
56050
  }).on("mouseout", () => {
55757
56051
  hideTooltipOnMouseOut();
55758
56052
  });
56053
+ const finalRects = shouldAnimate ? rectsEnter.transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]) : rectsEnter;
56054
+ finalRects.attr("y", (d) => d[1] ? yScaleLeft(d[1]) : 0).attr("height", (d) => d[1] ? yScaleLeft(d[0]) - yScaleLeft(d[1]) : 0);
55759
56055
  rects.exit().remove();
55760
56056
  rects = rectsEnter.merge(rects);
55761
56057
  if (formatOptions.plotArea.plotAreaDataLabel == "2" && k2 != 1) {
@@ -56399,7 +56695,8 @@
56399
56695
  const positiveBarColor = formatOptions.plotArea.plotAreaCalculatedHigh;
56400
56696
  const negativeBarColor = formatOptions.plotArea.plotAreaCalculatedLow;
56401
56697
  const parent = gTag.append("g").attr("class", "parentGroup");
56402
- parent.selectAll("rect").data(
56698
+ const shouldAnimate = formatOptions.animation.animationEnabled;
56699
+ const bars = parent.selectAll("rect").data(
56403
56700
  filteredData.flatMap(
56404
56701
  (d) => d.data.map((child) => ({
56405
56702
  ...child,
@@ -56410,7 +56707,7 @@
56410
56707
  ).enter().append("rect").attr("class", "rect").attr(
56411
56708
  "y",
56412
56709
  (d) => (d.legendText ? yScaleLeft(d.legendText) : yScaleLeft(chartTypes.TornadoDefaultEntry)) - columnWidth / 2
56413
- ).attr("height", columnWidth).attr("x", (d) => d.value >= 0 ? xScale(0) : xScale(d.value)).attr("width", (d) => Math.abs(xScale(d.value) - xScale(0))).style("shape-rendering", "crispEdges").attr(
56710
+ ).attr("height", columnWidth).attr("x", xScale(0)).attr("width", 0).style("shape-rendering", "crispEdges").attr(
56414
56711
  "stroke-dasharray",
56415
56712
  (d) => d.properties.stackBorderStyle == 2 ? "5,3" : "0"
56416
56713
  ).attr("stroke-width", (d) => `${d.properties.stackBorderWidth}px`).attr(
@@ -56446,6 +56743,8 @@
56446
56743
  !data.IsCalCSensitivity ? d.properties : d.properties.legend === "Calculated Low(-ve)" ? { markerColor: formatOptions.plotArea.plotAreaCalculatedLow } : { markerColor: formatOptions.plotArea.plotAreaCalculatedHigh }
56447
56744
  );
56448
56745
  }).on("mouseout", hideTooltipOnMouseOut);
56746
+ const finalBars = shouldAnimate ? bars.transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]) : bars;
56747
+ finalBars.attr("x", (d) => d.value >= 0 ? xScale(0) : xScale(d.value)).attr("width", (d) => Math.abs(xScale(d.value) - xScale(0)));
56449
56748
  };
56450
56749
  const setSVGContainer = (margin2) => {
56451
56750
  innerWidth2 = width - margin2.left - margin2.right;
@@ -56990,14 +57289,16 @@
56990
57289
  ).merge(column);
56991
57290
  let columnGroups = column.selectAll(".column-group").data(data2.data, (d) => d.dimension);
56992
57291
  let columnGroupsEnter = columnGroups.enter().append("g").attr("class", "column-group");
56993
- columnGroupsEnter.append("path").attr("class", "cleveland-dot").merge(columnGroups.select("path")).attr(
57292
+ const shouldAnimate = formatOptions.animation.animationEnabled;
57293
+ const enteringDots = columnGroupsEnter.append("path").attr("class", "cleveland-dot").attr("opacity", shouldAnimate ? 0 : 0.9);
57294
+ enteringDots.merge(columnGroups.select("path")).attr(
56994
57295
  "d",
56995
57296
  (d) => Symbol$1().type(Markershapes(d.markerShape)).size((d.markerSize || 6) * 70)()
56996
57297
  ).attr("transform", (d) => {
56997
57298
  const x2 = xScaleBottom(d.value);
56998
57299
  const y2 = yScale(d.dimension);
56999
57300
  return `translate(${x2},${y2})`;
57000
- }).attr("fill", (d) => data2.properties.color).attr("opacity", 0.9).attr(
57301
+ }).attr("fill", (d) => data2.properties.color).attr(
57001
57302
  "visibility",
57002
57303
  () => formatOptions.marker?.markerVisibility ? "visible" : "hidden"
57003
57304
  ).on("mousemove", (event2, d) => {
@@ -57030,6 +57331,9 @@
57030
57331
  selectAll(".halo").remove();
57031
57332
  hideTooltipOnMouseOut();
57032
57333
  });
57334
+ if (shouldAnimate) {
57335
+ enteringDots.transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]).attr("opacity", 0.9);
57336
+ }
57033
57337
  columnGroups.exit().remove();
57034
57338
  });
57035
57339
  gTag.selectAll(".parentGroup").raise();
@@ -57570,17 +57874,8 @@
57570
57874
  maintainAspectRatio: false,
57571
57875
  plugins: {
57572
57876
  // ---- Title ----
57573
- title: {
57574
- display: formatOptions.chartTitle?.chartTitleVisibility ?? true,
57575
- text: formatOptions.chartTitle?.dynamicTitleText || formatOptions.chartTitle?.chartTitleText || "",
57576
- color: formatOptions.chartTitle?.chartTitleColor ?? "#000000",
57577
- font: {
57578
- size: parseInt(formatOptions.chartTitle?.chartTitleFontSize ?? "15", 10),
57579
- family: formatOptions.chartTitle?.chartTitleFontFamily ?? "Helvetica",
57580
- style: getFontStyle(formatOptions.chartTitle?.chartTitleFontStyle),
57581
- weight: getFontWeight(formatOptions.chartTitle?.chartTitleFontStyle)
57582
- }
57583
- },
57877
+ // Title is rendered as a separate DOM element in ChartJSWrapper
57878
+ title: { display: false },
57584
57879
  // ---- Legend ----
57585
57880
  legend: {
57586
57881
  display: formatOptions.legends?.legendVisibility !== false && formatOptions.legends?.legendPosition !== "None",
@@ -57610,9 +57905,10 @@
57610
57905
  callbacks: {
57611
57906
  label(ctx) {
57612
57907
  const value2 = typeof ctx.raw === "number" ? ctx.raw : ctx.raw?.y ?? 0;
57613
- const formatted = formatValueForAxis(
57908
+ const formatted = getNumberWithFormat(
57614
57909
  value2,
57615
57910
  formatOptions.toolTip?.toolTipDisplayUnits ?? "None",
57911
+ formatOptions.toolTip?.toolTipNumberFormat ?? ",",
57616
57912
  formatOptions.toolTip?.toolTipDecimalPrecision ?? "2"
57617
57913
  );
57618
57914
  return ` ${ctx.dataset.label}: ${formatted}`;
@@ -57623,13 +57919,13 @@
57623
57919
  // This block is only active when chartjs-plugin-datalabels is registered in ChartJSWrapper.
57624
57920
  datalabels: buildDataLabelsConfig(formatOptions, chartType)
57625
57921
  },
57626
- animation: formatOptions.cjsOptions?.cjsAnimationEnabled === true ? {
57627
- duration: formatOptions.cjsOptions?.cjsAnimationDuration ?? 1e3
57922
+ animation: formatOptions.animation?.animationEnabled === true ? {
57923
+ duration: formatOptions.animation?.animationDuration ?? 1e3
57628
57924
  } : false
57629
57925
  };
57630
57926
  if (!isCircular) {
57631
57927
  const xScaleOptions = {
57632
- display: formatOptions.xAxisLabel?.xAxisLabelVisibility !== false,
57928
+ display: true,
57633
57929
  title: {
57634
57930
  display: formatOptions.xAxisTitle?.xAxisTitleVisibility !== false,
57635
57931
  text: formatOptions.xAxisTitle?.xAxisTitleText ?? "Dimension",
@@ -57641,14 +57937,16 @@
57641
57937
  }
57642
57938
  },
57643
57939
  ticks: {
57940
+ display: formatOptions.xAxisLabel?.xAxisLabelVisibility !== false,
57644
57941
  color: formatOptions.xAxisLabel?.xAxisLabelColor ?? "#000000",
57645
57942
  font: {
57646
57943
  size: parseInt(formatOptions.xAxisLabel?.xAxisLabelFontSize ?? "11", 10),
57647
57944
  family: formatOptions.xAxisLabel?.xAxisLabelFontFamily ?? "Helvetica",
57648
- style: getFontStyle(formatOptions.xAxisLabel?.xAxisLabelFontStyle)
57945
+ style: getFontStyle(formatOptions.xAxisLabel?.xAxisLabelFontStyle),
57946
+ weight: getFontWeight(formatOptions.xAxisLabel?.xAxisLabelFontStyle)
57649
57947
  },
57650
57948
  maxRotation: isHorizontal ? 0 : formatOptions.xAxisLabel?.xAxisLabelRotation ?? 0,
57651
- minRotation: 0
57949
+ minRotation: isHorizontal ? 0 : formatOptions.xAxisLabel?.xAxisLabelRotation ?? 0
57652
57950
  },
57653
57951
  grid: {
57654
57952
  display: formatOptions.plotArea?.gridLinesVisibility !== false && formatOptions.plotArea?.gridLinesVertical !== false,
@@ -57660,7 +57958,7 @@
57660
57958
  }
57661
57959
  };
57662
57960
  const yScaleOptions = {
57663
- display: formatOptions.yAxisLabel?.yAxisLabelVisibility !== false,
57961
+ display: true,
57664
57962
  position: "left",
57665
57963
  title: {
57666
57964
  display: formatOptions.yAxisTitle?.yAxisTitleVisibility !== false,
@@ -57673,11 +57971,13 @@
57673
57971
  }
57674
57972
  },
57675
57973
  ticks: {
57974
+ display: formatOptions.yAxisLabel?.yAxisLabelVisibility !== false,
57676
57975
  color: formatOptions.yAxisLabel?.yAxisLabelColor ?? "#000000",
57677
57976
  font: {
57678
57977
  size: parseInt(formatOptions.yAxisLabel?.yAxisLabelFontSize ?? "11", 10),
57679
57978
  family: formatOptions.yAxisLabel?.yAxisLabelFontFamily ?? "Helvetica",
57680
- style: getFontStyle(formatOptions.yAxisLabel?.yAxisLabelFontStyle)
57979
+ style: getFontStyle(formatOptions.yAxisLabel?.yAxisLabelFontStyle),
57980
+ weight: getFontWeight(formatOptions.yAxisLabel?.yAxisLabelFontStyle)
57681
57981
  },
57682
57982
  callback(value2) {
57683
57983
  return formatValueForAxis(
@@ -57692,7 +57992,7 @@
57692
57992
  color: gridColor
57693
57993
  },
57694
57994
  border: {
57695
- color: formatOptions.yAxisLabel?.yAxisColorInverted ?? "#cccccc",
57995
+ color: formatOptions.yAxisLabel?.yAxisColor ?? "#cccccc",
57696
57996
  width: parseFloat(formatOptions.yAxisLabel?.yAxisWidth ?? "0.5")
57697
57997
  }
57698
57998
  };
@@ -57707,12 +58007,17 @@
57707
58007
  if (opts.scales.y.title) {
57708
58008
  opts.scales.y.title.text = formatOptions.xAxisTitle?.xAxisTitleText ?? "Dimension";
57709
58009
  }
58010
+ const hRot = formatOptions.xAxisLabel?.xAxisLabelRotation ?? 0;
58011
+ if (opts.scales.x.ticks) {
58012
+ opts.scales.x.ticks.maxRotation = hRot;
58013
+ opts.scales.x.ticks.minRotation = hRot;
58014
+ }
57710
58015
  } else {
57711
58016
  opts.scales = { x: xScaleOptions, y: yScaleOptions };
57712
58017
  }
57713
58018
  if (hasSecondaryAxis) {
57714
58019
  opts.scales.y1 = {
57715
- display: formatOptions.secondaryYAxisLabel?.secondaryYAxisLabelVisibility !== false,
58020
+ display: true,
57716
58021
  position: "right",
57717
58022
  title: {
57718
58023
  display: formatOptions.secondaryYAxisTitle?.secondaryYAxisTitleVisibility !== false,
@@ -57724,9 +58029,13 @@
57724
58029
  }
57725
58030
  },
57726
58031
  ticks: {
58032
+ display: formatOptions.secondaryYAxisLabel?.secondaryYAxisLabelVisibility !== false,
57727
58033
  color: formatOptions.secondaryYAxisLabel?.secondaryYAxisLabelColor ?? "#000000",
57728
58034
  font: {
57729
- size: parseInt(formatOptions.secondaryYAxisLabel?.secondaryYAxisLabelFontSize ?? "11", 10)
58035
+ size: parseInt(formatOptions.secondaryYAxisLabel?.secondaryYAxisLabelFontSize ?? "11", 10),
58036
+ family: formatOptions.secondaryYAxisLabel?.secondaryYAxisLabelFontFamily ?? "Helvetica",
58037
+ style: getFontStyle(formatOptions.secondaryYAxisLabel?.secondaryYAxisLabelFontStyle),
58038
+ weight: getFontWeight(formatOptions.secondaryYAxisLabel?.secondaryYAxisLabelFontStyle)
57730
58039
  },
57731
58040
  callback(value2) {
57732
58041
  return formatValueForAxis(
@@ -57736,7 +58045,11 @@
57736
58045
  );
57737
58046
  }
57738
58047
  },
57739
- grid: { drawOnChartArea: false }
58048
+ grid: { drawOnChartArea: false },
58049
+ border: {
58050
+ color: formatOptions.secondaryYAxisLabel?.secondaryYAxisColor ?? "#000000",
58051
+ width: parseFloat(formatOptions.secondaryYAxisLabel?.secondaryYAxisWidth ?? "0.5")
58052
+ }
57740
58053
  };
57741
58054
  }
57742
58055
  const isStacked2 = chartType.toLowerCase().includes("stack");
@@ -57758,6 +58071,7 @@
57758
58071
  function buildDataLabelsConfig(formatOptions, chartType = "bar") {
57759
58072
  const annotation2 = formatOptions.annotation;
57760
58073
  const isCircular = chartType === "pie" || chartType === "doughnut" || chartType === "polarArea";
58074
+ const isHorizontal = chartType === "horizontalBar";
57761
58075
  const visibilityStr = annotation2?.annotationVisibility ?? "5";
57762
58076
  if (visibilityStr === "5" || !visibilityStr) {
57763
58077
  return { display: false };
@@ -57769,7 +58083,8 @@
57769
58083
  const fontStyle = getFontStyle(annotation2?.annotationFontStyle);
57770
58084
  const fontWeight = getFontWeight(annotation2?.annotationFontStyle);
57771
58085
  const labelColor = annotation2?.annotationColor ?? "#000000";
57772
- const decimalPrecision = parseInt(annotation2?.annotationDecimalPrecision ?? "2", 10);
58086
+ const useSeriesColor = annotation2?.annotationSetLabelColor === "2";
58087
+ const decimalPrecision = annotation2?.annotationDecimalPrecision ?? "2";
57773
58088
  const numberFormat = annotation2?.annotationNumberFormat ?? ",";
57774
58089
  const displayUnits = annotation2?.annotationDisplayUnits ?? "None";
57775
58090
  function display(ctx) {
@@ -57819,14 +58134,25 @@
57819
58134
  return positionStr === "2" ? "center" : "end";
57820
58135
  }
57821
58136
  const v = getCtxValue(ctx);
58137
+ if (isHorizontal) {
58138
+ switch (positionStr) {
58139
+ case "2":
58140
+ return "center";
58141
+ case "3":
58142
+ return "right";
58143
+ // baseline side → point into bar (rightward from zero for pos, rightward toward zero for neg)
58144
+ case "1":
58145
+ case "4":
58146
+ default:
58147
+ return v < 0 ? "left" : "right";
58148
+ }
58149
+ }
57822
58150
  switch (positionStr) {
57823
58151
  case "2":
57824
58152
  return "center";
57825
58153
  case "3":
57826
58154
  return v > 0 ? "top" : "bottom";
57827
- // always upward — inside bar in both cases:
57828
- // positive: above zero = inside bar base
57829
- // negative: above extreme = toward zero = inside bar
58155
+ // inside bar near baseline
57830
58156
  case "1":
57831
58157
  case "4":
57832
58158
  default:
@@ -57836,23 +58162,7 @@
57836
58162
  function formatter2(raw, ctx) {
57837
58163
  const v = getRawValue(raw);
57838
58164
  if (hideZero && v === 0) return null;
57839
- let scaled = v;
57840
- if (displayUnits === "Thousands") scaled = v / 1e3;
57841
- else if (displayUnits === "Millions") scaled = v / 1e6;
57842
- else if (displayUnits === "Billions") scaled = v / 1e9;
57843
- let formattedValue;
57844
- if (numberFormat === ",.0%") {
57845
- formattedValue = (scaled / 100).toLocaleString(void 0, {
57846
- style: "percent",
57847
- minimumFractionDigits: decimalPrecision,
57848
- maximumFractionDigits: decimalPrecision
57849
- });
57850
- } else {
57851
- formattedValue = scaled.toLocaleString(void 0, {
57852
- minimumFractionDigits: decimalPrecision,
57853
- maximumFractionDigits: decimalPrecision
57854
- });
57855
- }
58165
+ const formattedValue = getNumberWithFormat(v, displayUnits, numberFormat, decimalPrecision);
57856
58166
  if (isCircular) {
57857
58167
  const label = ctx?.chart?.data?.labels?.[ctx.dataIndex] ?? "";
57858
58168
  return label ? `${label}
@@ -57865,7 +58175,12 @@ ${formattedValue}` : formattedValue;
57865
58175
  anchor,
57866
58176
  align,
57867
58177
  offset: isCircular ? positionStr === "2" ? 0 : 8 : positionStr === "2" ? 0 : 4,
57868
- color: labelColor,
58178
+ color: useSeriesColor ? (ctx) => {
58179
+ const bg = ctx.dataset?.backgroundColor;
58180
+ const border = ctx.dataset?.borderColor;
58181
+ const c2 = Array.isArray(bg) ? bg[ctx.dataIndex] : bg;
58182
+ return typeof c2 === "string" && c2 ? c2 : typeof border === "string" && border ? border : labelColor;
58183
+ } : labelColor,
57869
58184
  font: {
57870
58185
  size: fontSize,
57871
58186
  family: fontFamily,
@@ -72928,7 +73243,13 @@ ${formattedValue}` : formattedValue;
72928
73243
  };
72929
73244
  }, [chartType, data, options, isChartStacked]);
72930
73245
  const bgColor = formatOptions.chartArea?.chartAreaColor ?? "#ffffff";
72931
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
73246
+ const titleFontStyle = Array.isArray(formatOptions.chartTitle?.chartTitleFontStyle) ? formatOptions.chartTitle.chartTitleFontStyle : [];
73247
+ const titleColor = formatOptions.chartTitle?.chartTitleColor && formatOptions.chartTitle.chartTitleColor !== "#ffffff" && formatOptions.chartTitle.chartTitleColor !== "#FFFFFF00" ? formatOptions.chartTitle.chartTitleColor : "rgba(119,119,119)";
73248
+ const titleFontSize = formatOptions.chartTitle?.chartTitleFontSize ? `${formatOptions.chartTitle.chartTitleFontSize}px` : "16px";
73249
+ const titleText = formatOptions.chartTitle?.dynamicTitleText || formatOptions.chartTitle?.chartTitleText || "";
73250
+ const titleHTML = formatOptions.chartTitle?.chartTitleHTML || titleText;
73251
+ const titleVisible = formatOptions.chartTitle?.chartTitleVisibility !== false;
73252
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(
72932
73253
  "div",
72933
73254
  {
72934
73255
  className,
@@ -72936,9 +73257,37 @@ ${formattedValue}` : formattedValue;
72936
73257
  width: "100%",
72937
73258
  height: "100%",
72938
73259
  backgroundColor: bgColor,
72939
- position: "relative"
73260
+ position: "relative",
73261
+ display: "flex",
73262
+ flexDirection: "column"
72940
73263
  },
72941
- children: /* @__PURE__ */ jsxRuntimeExports.jsx("canvas", { ref: canvasRef })
73264
+ children: [
73265
+ titleVisible && titleText && /* @__PURE__ */ jsxRuntimeExports.jsx(
73266
+ "div",
73267
+ {
73268
+ id: "chartTitleId",
73269
+ className: "chartTiltle",
73270
+ title: formatOptions.chartTitle?.chartTitleText,
73271
+ style: {
73272
+ color: titleColor,
73273
+ fontSize: titleFontSize,
73274
+ fontFamily: formatOptions.chartTitle?.chartTitleFontFamily,
73275
+ fontStyle: titleFontStyle.includes("Italic") ? "italic" : "normal",
73276
+ fontWeight: titleFontStyle.includes("Bold") ? "bold" : "normal",
73277
+ textDecoration: titleFontStyle.includes("Underline") ? "underline" : "none",
73278
+ whiteSpace: "pre",
73279
+ textOverflow: "ellipsis",
73280
+ overflow: "hidden",
73281
+ lineHeight: "1.3em",
73282
+ userSelect: "none",
73283
+ padding: "2px 4px",
73284
+ flexShrink: 0
73285
+ },
73286
+ dangerouslySetInnerHTML: { __html: titleHTML }
73287
+ }
73288
+ ),
73289
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { flex: 1, minHeight: 0 }, children: /* @__PURE__ */ jsxRuntimeExports.jsx("canvas", { ref: canvasRef, style: { width: "100%", height: "100%" } }) })
73290
+ ]
72942
73291
  }
72943
73292
  );
72944
73293
  };