pace-chart-lib 1.0.56 → 1.0.58

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.
@@ -2392,7 +2392,7 @@ define$1(Hcl, hcl, extend$1(Color$2, {
2392
2392
  }
2393
2393
  }));
2394
2394
  const constant$9 = (x2) => () => x2;
2395
- function linear$2(a2, d) {
2395
+ function linear$3(a2, d) {
2396
2396
  return function(t) {
2397
2397
  return a2 + t * d;
2398
2398
  };
@@ -2409,7 +2409,7 @@ function gamma$1(y2) {
2409
2409
  }
2410
2410
  function nogamma$1(a2, b) {
2411
2411
  var d = b - a2;
2412
- return d ? linear$2(a2, d) : constant$9(isNaN(a2) ? b : a2);
2412
+ return d ? linear$3(a2, d) : constant$9(isNaN(a2) ? b : a2);
2413
2413
  }
2414
2414
  const interpolateRgb$1 = (function rgbGamma(y2) {
2415
2415
  var color2 = gamma$1(y2);
@@ -2634,7 +2634,7 @@ const interpolateZoom = (function zoomRho(rho, rho2, rho4) {
2634
2634
  ];
2635
2635
  };
2636
2636
  } else {
2637
- 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);
2637
+ 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);
2638
2638
  S = (r1 - r0) / rho;
2639
2639
  i = function(t) {
2640
2640
  var s2 = t * S, coshr0 = cosh(r0), u = w0 / (rho2 * d1) * (coshr0 * tanh(rho * s2 + r0) - sinh(r0));
@@ -3358,49 +3358,85 @@ Transition$1.prototype = {
3358
3358
  end: transition_end$1,
3359
3359
  [Symbol.iterator]: selection_prototype$1[Symbol.iterator]
3360
3360
  };
3361
+ const linear$2 = (t) => +t;
3362
+ function cubicIn(t) {
3363
+ return t * t * t;
3364
+ }
3365
+ function cubicOut(t) {
3366
+ return --t * t * t + 1;
3367
+ }
3361
3368
  function cubicInOut$1(t) {
3362
3369
  return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2;
3363
3370
  }
3364
3371
  function tpmt(x2) {
3365
3372
  return (Math.pow(2, -10 * x2) - 9765625e-10) * 1.0009775171065494;
3366
3373
  }
3374
+ 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;
3375
+ function bounceOut(t) {
3376
+ 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;
3377
+ }
3378
+ var overshoot = 1.70158;
3379
+ (function custom(s2) {
3380
+ s2 = +s2;
3381
+ function backIn(t) {
3382
+ return (t = +t) * t * (s2 * (t - 1) + t);
3383
+ }
3384
+ backIn.overshoot = custom;
3385
+ return backIn;
3386
+ })(overshoot);
3387
+ var backOut = (function custom2(s2) {
3388
+ s2 = +s2;
3389
+ function backOut2(t) {
3390
+ return --t * t * ((t + 1) * s2 + t) + 1;
3391
+ }
3392
+ backOut2.overshoot = custom2;
3393
+ return backOut2;
3394
+ })(overshoot);
3395
+ (function custom3(s2) {
3396
+ s2 = +s2;
3397
+ function backInOut(t) {
3398
+ return ((t *= 2) < 1 ? t * t * ((s2 + 1) * t - s2) : (t -= 2) * t * ((s2 + 1) * t + s2) + 2) / 2;
3399
+ }
3400
+ backInOut.overshoot = custom3;
3401
+ return backInOut;
3402
+ })(overshoot);
3367
3403
  var tau$5 = 2 * Math.PI, amplitude = 1, period = 0.3;
3368
- (function custom(a2, p) {
3404
+ (function custom4(a2, p) {
3369
3405
  var s2 = Math.asin(1 / (a2 = Math.max(1, a2))) * (p /= tau$5);
3370
3406
  function elasticIn2(t) {
3371
3407
  return a2 * tpmt(- --t) * Math.sin((s2 - t) / p);
3372
3408
  }
3373
3409
  elasticIn2.amplitude = function(a3) {
3374
- return custom(a3, p * tau$5);
3410
+ return custom4(a3, p * tau$5);
3375
3411
  };
3376
3412
  elasticIn2.period = function(p2) {
3377
- return custom(a2, p2);
3413
+ return custom4(a2, p2);
3378
3414
  };
3379
3415
  return elasticIn2;
3380
3416
  })(amplitude, period);
3381
- var elasticOut$1 = (function custom2(a2, p) {
3417
+ var elasticOut$1 = (function custom5(a2, p) {
3382
3418
  var s2 = Math.asin(1 / (a2 = Math.max(1, a2))) * (p /= tau$5);
3383
3419
  function elasticOut2(t) {
3384
3420
  return 1 - a2 * tpmt(t = +t) * Math.sin((t + s2) / p);
3385
3421
  }
3386
3422
  elasticOut2.amplitude = function(a3) {
3387
- return custom2(a3, p * tau$5);
3423
+ return custom5(a3, p * tau$5);
3388
3424
  };
3389
3425
  elasticOut2.period = function(p2) {
3390
- return custom2(a2, p2);
3426
+ return custom5(a2, p2);
3391
3427
  };
3392
3428
  return elasticOut2;
3393
3429
  })(amplitude, period);
3394
- (function custom3(a2, p) {
3430
+ (function custom6(a2, p) {
3395
3431
  var s2 = Math.asin(1 / (a2 = Math.max(1, a2))) * (p /= tau$5);
3396
3432
  function elasticInOut(t) {
3397
3433
  return ((t = t * 2 - 1) < 0 ? a2 * tpmt(-t) * Math.sin((s2 - t) / p) : 2 - a2 * tpmt(t) * Math.sin((s2 + t) / p)) / 2;
3398
3434
  }
3399
3435
  elasticInOut.amplitude = function(a3) {
3400
- return custom3(a3, p * tau$5);
3436
+ return custom6(a3, p * tau$5);
3401
3437
  };
3402
3438
  elasticInOut.period = function(p2) {
3403
- return custom3(a2, p2);
3439
+ return custom6(a2, p2);
3404
3440
  };
3405
3441
  return elasticInOut;
3406
3442
  })(amplitude, period);
@@ -4394,12 +4430,12 @@ function clipRectangle(x02, y02, x12, y12) {
4394
4430
  function polygonInside() {
4395
4431
  var winding = 0;
4396
4432
  for (var i = 0, n = polygon.length; i < n; ++i) {
4397
- for (var ring2 = polygon[i], j = 1, m = ring2.length, point3 = ring2[0], a0, a1, b0 = point3[0], b1 = point3[1]; j < m; ++j) {
4398
- a0 = b0, a1 = b1, point3 = ring2[j], b0 = point3[0], b1 = point3[1];
4433
+ for (var ring2 = polygon[i], j = 1, m = ring2.length, point3 = ring2[0], a0, a1, b02 = point3[0], b12 = point3[1]; j < m; ++j) {
4434
+ a0 = b02, a1 = b12, point3 = ring2[j], b02 = point3[0], b12 = point3[1];
4399
4435
  if (a1 <= y12) {
4400
- if (b1 > y12 && (b0 - a0) * (y12 - a1) > (b1 - a1) * (x02 - a0)) ++winding;
4436
+ if (b12 > y12 && (b02 - a0) * (y12 - a1) > (b12 - a1) * (x02 - a0)) ++winding;
4401
4437
  } else {
4402
- if (b1 <= y12 && (b0 - a0) * (y12 - a1) < (b1 - a1) * (x02 - a0)) --winding;
4438
+ if (b12 <= y12 && (b02 - a0) * (y12 - a1) < (b12 - a1) * (x02 - a0)) --winding;
4403
4439
  }
4404
4440
  }
4405
4441
  }
@@ -4873,19 +4909,19 @@ function resampleNone(project) {
4873
4909
  });
4874
4910
  }
4875
4911
  function resample$1(project, delta2) {
4876
- function resampleLineTo(x02, y02, lambda0, a0, b0, c0, x12, y12, lambda1, a1, b1, c1, depth, stream) {
4912
+ function resampleLineTo(x02, y02, lambda0, a0, b02, c0, x12, y12, lambda1, a1, b12, c1, depth, stream) {
4877
4913
  var dx = x12 - x02, dy = y12 - y02, d2 = dx * dx + dy * dy;
4878
4914
  if (d2 > 4 * delta2 && depth--) {
4879
- 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;
4880
- if (dz * dz / d2 > delta2 || abs$1((dx * dx2 + dy * dy2) / d2 - 0.5) > 0.3 || a0 * a1 + b0 * b1 + c0 * c1 < cosMinDistance) {
4881
- resampleLineTo(x02, y02, lambda0, a0, b0, c0, x2, y2, lambda2, a2 /= m, b /= m, c2, depth, stream);
4915
+ 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;
4916
+ if (dz * dz / d2 > delta2 || abs$1((dx * dx2 + dy * dy2) / d2 - 0.5) > 0.3 || a0 * a1 + b02 * b12 + c0 * c1 < cosMinDistance) {
4917
+ resampleLineTo(x02, y02, lambda0, a0, b02, c0, x2, y2, lambda2, a2 /= m, b /= m, c2, depth, stream);
4882
4918
  stream.point(x2, y2);
4883
- resampleLineTo(x2, y2, lambda2, a2, b, c2, x12, y12, lambda1, a1, b1, c1, depth, stream);
4919
+ resampleLineTo(x2, y2, lambda2, a2, b, c2, x12, y12, lambda1, a1, b12, c1, depth, stream);
4884
4920
  }
4885
4921
  }
4886
4922
  }
4887
4923
  return function(stream) {
4888
- var lambda00, x002, y002, a00, b00, c00, lambda0, x02, y02, a0, b0, c0;
4924
+ var lambda00, x002, y002, a00, b00, c00, lambda0, x02, y02, a0, b02, c0;
4889
4925
  var resampleStream = {
4890
4926
  point: point2,
4891
4927
  lineStart,
@@ -4910,7 +4946,7 @@ function resample$1(project, delta2) {
4910
4946
  }
4911
4947
  function linePoint(lambda, phi2) {
4912
4948
  var c2 = cartesian([lambda, phi2]), p = project(lambda, phi2);
4913
- 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);
4949
+ 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);
4914
4950
  stream.point(x02, y02);
4915
4951
  }
4916
4952
  function lineEnd() {
@@ -4923,11 +4959,11 @@ function resample$1(project, delta2) {
4923
4959
  resampleStream.lineEnd = ringEnd;
4924
4960
  }
4925
4961
  function ringPoint(lambda, phi2) {
4926
- linePoint(lambda00 = lambda, phi2), x002 = x02, y002 = y02, a00 = a0, b00 = b0, c00 = c0;
4962
+ linePoint(lambda00 = lambda, phi2), x002 = x02, y002 = y02, a00 = a0, b00 = b02, c00 = c0;
4927
4963
  resampleStream.point = linePoint;
4928
4964
  }
4929
4965
  function ringEnd() {
4930
- resampleLineTo(x02, y02, lambda0, a0, b0, c0, x002, y002, lambda00, a00, b00, c00, maxDepth, stream);
4966
+ resampleLineTo(x02, y02, lambda0, a0, b02, c0, x002, y002, lambda00, a00, b00, c00, maxDepth, stream);
4931
4967
  resampleStream.lineEnd = lineEnd;
4932
4968
  lineEnd();
4933
4969
  }
@@ -5674,12 +5710,12 @@ function squarifyRatio(ratio, parent, x02, y02, x12, y12) {
5674
5710
  }
5675
5711
  return rows;
5676
5712
  }
5677
- const squarify = (function custom4(ratio) {
5713
+ const squarify = (function custom7(ratio) {
5678
5714
  function squarify2(parent, x02, y02, x12, y12) {
5679
5715
  squarifyRatio(ratio, parent, x02, y02, x12, y12);
5680
5716
  }
5681
5717
  squarify2.ratio = function(x2) {
5682
- return custom4((x2 = +x2) > 1 ? x2 : 1);
5718
+ return custom7((x2 = +x2) > 1 ? x2 : 1);
5683
5719
  };
5684
5720
  return squarify2;
5685
5721
  })(phi);
@@ -6737,12 +6773,12 @@ Cardinal$1.prototype = {
6737
6773
  this._y0 = this._y1, this._y1 = this._y2, this._y2 = y2;
6738
6774
  }
6739
6775
  };
6740
- const cardinal = (function custom5(tension) {
6776
+ const cardinal = (function custom8(tension) {
6741
6777
  function cardinal2(context) {
6742
6778
  return new Cardinal$1(context, tension);
6743
6779
  }
6744
6780
  cardinal2.tension = function(tension2) {
6745
- return custom5(+tension2);
6781
+ return custom8(+tension2);
6746
6782
  };
6747
6783
  return cardinal2;
6748
6784
  })(0);
@@ -8641,12 +8677,12 @@ Bundle.prototype = {
8641
8677
  this._y.push(+y2);
8642
8678
  }
8643
8679
  };
8644
- (function custom6(beta) {
8680
+ (function custom9(beta) {
8645
8681
  function bundle(context) {
8646
8682
  return beta === 1 ? new Basis(context) : new Bundle(context, beta);
8647
8683
  }
8648
8684
  bundle.beta = function(beta2) {
8649
- return custom6(+beta2);
8685
+ return custom9(+beta2);
8650
8686
  };
8651
8687
  return bundle;
8652
8688
  })(0.85);
@@ -8709,12 +8745,12 @@ Cardinal.prototype = {
8709
8745
  this._y0 = this._y1, this._y1 = this._y2, this._y2 = y2;
8710
8746
  }
8711
8747
  };
8712
- (function custom7(tension) {
8748
+ (function custom10(tension) {
8713
8749
  function cardinal2(context) {
8714
8750
  return new Cardinal(context, tension);
8715
8751
  }
8716
8752
  cardinal2.tension = function(tension2) {
8717
- return custom7(+tension2);
8753
+ return custom10(+tension2);
8718
8754
  };
8719
8755
  return cardinal2;
8720
8756
  })(0);
@@ -8772,12 +8808,12 @@ CardinalClosed.prototype = {
8772
8808
  this._y0 = this._y1, this._y1 = this._y2, this._y2 = y2;
8773
8809
  }
8774
8810
  };
8775
- (function custom8(tension) {
8811
+ (function custom11(tension) {
8776
8812
  function cardinal2(context) {
8777
8813
  return new CardinalClosed(context, tension);
8778
8814
  }
8779
8815
  cardinal2.tension = function(tension2) {
8780
- return custom8(+tension2);
8816
+ return custom11(+tension2);
8781
8817
  };
8782
8818
  return cardinal2;
8783
8819
  })(0);
@@ -8824,12 +8860,12 @@ CardinalOpen.prototype = {
8824
8860
  this._y0 = this._y1, this._y1 = this._y2, this._y2 = y2;
8825
8861
  }
8826
8862
  };
8827
- (function custom9(tension) {
8863
+ (function custom12(tension) {
8828
8864
  function cardinal2(context) {
8829
8865
  return new CardinalOpen(context, tension);
8830
8866
  }
8831
8867
  cardinal2.tension = function(tension2) {
8832
- return custom9(+tension2);
8868
+ return custom12(+tension2);
8833
8869
  };
8834
8870
  return cardinal2;
8835
8871
  })(0);
@@ -8901,12 +8937,12 @@ CatmullRom.prototype = {
8901
8937
  this._y0 = this._y1, this._y1 = this._y2, this._y2 = y2;
8902
8938
  }
8903
8939
  };
8904
- const curveCatmullRom = (function custom10(alpha2) {
8940
+ const curveCatmullRom = (function custom13(alpha2) {
8905
8941
  function catmullRom(context) {
8906
8942
  return alpha2 ? new CatmullRom(context, alpha2) : new Cardinal(context, 0);
8907
8943
  }
8908
8944
  catmullRom.alpha = function(alpha3) {
8909
- return custom10(+alpha3);
8945
+ return custom13(+alpha3);
8910
8946
  };
8911
8947
  return catmullRom;
8912
8948
  })(0.5);
@@ -8970,12 +9006,12 @@ CatmullRomClosed.prototype = {
8970
9006
  this._y0 = this._y1, this._y1 = this._y2, this._y2 = y2;
8971
9007
  }
8972
9008
  };
8973
- (function custom11(alpha2) {
9009
+ (function custom14(alpha2) {
8974
9010
  function catmullRom(context) {
8975
9011
  return alpha2 ? new CatmullRomClosed(context, alpha2) : new CardinalClosed(context, 0);
8976
9012
  }
8977
9013
  catmullRom.alpha = function(alpha3) {
8978
- return custom11(+alpha3);
9014
+ return custom14(+alpha3);
8979
9015
  };
8980
9016
  return catmullRom;
8981
9017
  })(0.5);
@@ -9028,12 +9064,12 @@ CatmullRomOpen.prototype = {
9028
9064
  this._y0 = this._y1, this._y1 = this._y2, this._y2 = y2;
9029
9065
  }
9030
9066
  };
9031
- (function custom12(alpha2) {
9067
+ (function custom15(alpha2) {
9032
9068
  function catmullRom(context) {
9033
9069
  return alpha2 ? new CatmullRomOpen(context, alpha2) : new CardinalOpen(context, 0);
9034
9070
  }
9035
9071
  catmullRom.alpha = function(alpha3) {
9036
- return custom12(+alpha3);
9072
+ return custom15(+alpha3);
9037
9073
  };
9038
9074
  return catmullRom;
9039
9075
  })(0.5);
@@ -10832,11 +10868,6 @@ const AnnotationTypeMap = {
10832
10868
  4: d3CalloutElbow,
10833
10869
  5: d3CalloutCurve
10834
10870
  };
10835
- const ConnectedStyle = {
10836
- "solid": "unset",
10837
- "Dotted": "2",
10838
- "Dashed": "7"
10839
- };
10840
10871
  var staticLegendPosition = /* @__PURE__ */ ((staticLegendPosition2) => {
10841
10872
  staticLegendPosition2["left"] = "Left";
10842
10873
  staticLegendPosition2["right"] = "Right";
@@ -10949,6 +10980,15 @@ var waterfallKeys = /* @__PURE__ */ ((waterfallKeys2) => {
10949
10980
  waterfallKeys2["down"] = "down";
10950
10981
  return waterfallKeys2;
10951
10982
  })(waterfallKeys || {});
10983
+ const effectsMap = {
10984
+ "easeLinear": linear$2,
10985
+ "easeCubicIn": cubicIn,
10986
+ "easeCubicOut": cubicOut,
10987
+ "easeCubicInOut": cubicInOut$1,
10988
+ "easeBounceOut": bounceOut,
10989
+ "easeElasticOut": elasticOut$1,
10990
+ "easeBackOut": backOut
10991
+ };
10952
10992
  const defaultChartFormatOptions = {
10953
10993
  chartDescription: {
10954
10994
  chartDescriptionVisibility: false,
@@ -11551,6 +11591,20 @@ const defaultChartFormatOptions = {
11551
11591
  chartPadding: {
11552
11592
  paddingArrayLTRB: [0, 0, 0, 0]
11553
11593
  // left, top, right, bottom
11594
+ },
11595
+ statisticalTest: {
11596
+ zTest: false,
11597
+ runZTest: [],
11598
+ zTestInputData: []
11599
+ },
11600
+ cjsOptions: {
11601
+ cjsTension: 0,
11602
+ cjsBorderRadius: 0
11603
+ },
11604
+ animation: {
11605
+ animationEnabled: false,
11606
+ animationDuration: 1500,
11607
+ animationEffect: "easeCubicOut"
11554
11608
  }
11555
11609
  };
11556
11610
  const chartMargins = {
@@ -13066,10 +13120,20 @@ function getCurveType(formatOptions) {
13066
13120
  }
13067
13121
  function getSlicedLegendForTornado(legend) {
13068
13122
  const index2 = legend.indexOf(" - ");
13069
- if (index2 == -1) return legend;
13123
+ if (index2 == -1) return tornadoEntryName.default;
13070
13124
  return legend.slice(index2 + 3);
13071
13125
  }
13072
13126
  const getHoverText = (d, isAATornado) => isAATornado ? d?.legend?.split(" - ")[0] : d?.properties?.alias || d?.properties?.name || "Legend";
13127
+ function getCurvePoints(dx, dy) {
13128
+ return [
13129
+ [0, 0],
13130
+ // start (anchor)
13131
+ [dx / 2, dy / 2],
13132
+ // control (curve bend)
13133
+ [dx, dy]
13134
+ // end (label)
13135
+ ];
13136
+ }
13073
13137
  function commonAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin, d3Annotation2, labelExcludeList, individualLabelColor, formatOptions, chartType, height, width, innerWidth2, dimensionList, innerHeight2, widgetId, svg, onDataLabelCoordinatesChange, xScaleForLegends, columnWidth, isReportEditable, isSensitivityChart, barChart, isAATornado) {
13074
13138
  try {
13075
13139
  const isTornadoChart = chartType === chartTypes.TornadoChart;
@@ -13077,6 +13141,7 @@ function commonAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin, d
13077
13141
  let annotationType = formatOptions.annotation.annotationType ?? "1";
13078
13142
  let annotationPosition = formatOptions.annotation.annotationPosition.toString() != "4" ? formatOptions.annotation.annotationPosition : null;
13079
13143
  let dataLabelColor = formatOptions?.annotation?.annotationSetLabelColor == "2" ? "color" : "labelColor";
13144
+ const isCurve = formatOptions.annotation.connectorType?.toLowerCase() === "curve";
13080
13145
  if (formatOptions.annotation.annotationVisibility) {
13081
13146
  let Disable = [annotationType == "1" ? "connector" : ""];
13082
13147
  let labelData = [];
@@ -13307,7 +13372,8 @@ function commonAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin, d
13307
13372
  dy: 0,
13308
13373
  connector: {
13309
13374
  end: connectorType,
13310
- curve: connecterCurve[formatOptions.annotation.connectorCurve]
13375
+ curve: connecterCurve[formatOptions.annotation.connectorCurve],
13376
+ points: isCurve ? getCurvePoints(0, 0) : [[0, 0], [0, 0]]
13311
13377
  },
13312
13378
  disable: Disable,
13313
13379
  subject: {
@@ -13365,12 +13431,10 @@ function commonAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin, d
13365
13431
  newAnnotation.dx = old.dx;
13366
13432
  newAnnotation.dy = old.dy;
13367
13433
  newAnnotation.data.isVisible = old.isVisible ?? true;
13368
- newAnnotation.connector.points = old.connectorPoints?.length ? old.connectorPoints : [[0, 0], [0, 0]];
13369
- if (formatOptions.annotation.annotationType == "5" && newAnnotation.dx == 0 && newAnnotation.dy == 0) {
13370
- newAnnotation.connector["points"] = [
13371
- [0, 0],
13372
- [0, 0]
13373
- ];
13434
+ if (old?.connectorPoints && old.connectorPoints.length >= (isCurve ? 3 : 2)) {
13435
+ newAnnotation.connector.points = old.connectorPoints;
13436
+ } else {
13437
+ newAnnotation.connector.points = isCurve ? getCurvePoints(newAnnotation.dx, newAnnotation.dy) : [[0, 0], [0, 0]];
13374
13438
  }
13375
13439
  }
13376
13440
  }
@@ -13433,7 +13497,7 @@ function commonAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin, d
13433
13497
  if (d.data?.legendUniqueId == annotation2.data.legendUniqueId || d.legendUniqueId == annotation2.data.legendUniqueId) {
13434
13498
  d.dx = annotation2._dx * width / d.width;
13435
13499
  d.dy = annotation2._dy * height / d.height;
13436
- d.connectorPoints = annotation2.connector.points;
13500
+ d.connectorPoints = annotation2.connector?.points?.map((p) => [...p]) || [];
13437
13501
  }
13438
13502
  });
13439
13503
  if (onDataLabelCoordinatesChange) {
@@ -13489,6 +13553,21 @@ function commonAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin, d
13489
13553
  connectorType,
13490
13554
  barChart
13491
13555
  );
13556
+ if (formatOptions.animation?.animationEnabled) {
13557
+ const duration = formatOptions.animation.animationDuration;
13558
+ const ease = effectsMap[formatOptions.animation.animationEffect];
13559
+ const accessors = makeAnnotations.accessors();
13560
+ annotations.selectAll(".annotation").attr("transform", function(d) {
13561
+ const x2 = accessors.x(d.data);
13562
+ const yScale = d.data?.y?.axis === axisTypes.primary ? yScaleLeft : yScaleRight;
13563
+ const startY = yScale(0);
13564
+ return `translate(${x2}, ${startY})`;
13565
+ }).transition().duration(duration).ease(ease).attr("transform", function(d) {
13566
+ const x2 = accessors.x(d.data);
13567
+ const y2 = accessors.y(d.data);
13568
+ return `translate(${x2}, ${y2})`;
13569
+ });
13570
+ }
13492
13571
  }
13493
13572
  } catch (error) {
13494
13573
  throw error;
@@ -13508,6 +13587,7 @@ function commonAnnotationsForCustomChart(chartData, xScale, yScaleLeft, yScaleRi
13508
13587
  let stackData = [];
13509
13588
  let getChartType = [];
13510
13589
  let connectorType = formatOptions.annotation.connectorType ? formatOptions.annotation.connectorType.toLowerCase() : "None";
13590
+ const isCurve = formatOptions.annotation.connectorType?.toLowerCase() === "curve";
13511
13591
  let oldAnnotationList = JSON.parse(JSON.stringify(formatOptions.plotArea.dataLabelsCoordinates));
13512
13592
  oldAnnotationList = conditionallyResetOldAnnotations(oldAnnotationList, formatOptions, chartTypes.CustomColumnChart);
13513
13593
  let annotationsList = [];
@@ -13839,7 +13919,8 @@ function commonAnnotationsForCustomChart(chartData, xScale, yScaleLeft, yScaleRi
13839
13919
  dy: 0,
13840
13920
  connector: {
13841
13921
  end: connectorType,
13842
- curve: connecterCurve[formatOptions.annotation.connectorCurve]
13922
+ curve: connecterCurve[formatOptions.annotation.connectorCurve],
13923
+ points: isCurve ? getCurvePoints(0, 0) : [[0, 0], [0, 0]]
13843
13924
  },
13844
13925
  disable: Disable,
13845
13926
  subject: {
@@ -13861,6 +13942,9 @@ function commonAnnotationsForCustomChart(chartData, xScale, yScaleLeft, yScaleRi
13861
13942
  !labelExcludeList.includes(d["key"]) && (d.data.axis == axisTypes.primary ? yScaleLeft(d[1]) <= innerHeight2 && yScaleLeft(d[1]) >= 0 : yScaleRight(d[1]) <= innerHeight2 && yScaleRight(d[1]) >= 0) ? annotationsList.push(singleAnnotation) : null
13862
13943
  );
13863
13944
  });
13945
+ if (formatOptions.annotation.annotationHideZeroValues) {
13946
+ annotationsList = annotationsList.filter((d) => d.data.y !== 0);
13947
+ }
13864
13948
  if (oldAnnotationList.length === 0) {
13865
13949
  oldAnnotationList = annotationsList;
13866
13950
  oldMap = new Map(
@@ -13895,7 +13979,11 @@ function commonAnnotationsForCustomChart(chartData, xScale, yScaleLeft, yScaleRi
13895
13979
  newAnnotation.dx = old.dx;
13896
13980
  newAnnotation.dy = old.dy;
13897
13981
  newAnnotation.data.isVisible = old.isVisible ?? true;
13898
- newAnnotation.connector.points = old.connectorPoints?.length ? old.connectorPoints : [[0, 0], [0, 0]];
13982
+ if (old?.connectorPoints && old.connectorPoints.length >= (isCurve ? 3 : 2)) {
13983
+ newAnnotation.connector.points = old.connectorPoints;
13984
+ } else {
13985
+ newAnnotation.connector.points = isCurve ? getCurvePoints(newAnnotation.dx, newAnnotation.dy) : [[0, 0], [0, 0]];
13986
+ }
13899
13987
  if (formatOptions.annotation.annotationType == "5" && newAnnotation.dx == 0 && newAnnotation.dy == 0) {
13900
13988
  newAnnotation.connector["points"] = [
13901
13989
  [0, 0],
@@ -13949,7 +14037,7 @@ function commonAnnotationsForCustomChart(chartData, xScale, yScaleLeft, yScaleRi
13949
14037
  if (d.data?.legendUniqueId == annotation2.data.legendUniqueId || d.legendUniqueId == annotation2.data.legendUniqueId) {
13950
14038
  d.dx = annotation2._dx * width / d.width;
13951
14039
  d.dy = annotation2._dy * height / d.height;
13952
- d.connectorPoints = annotation2.connector.points;
14040
+ d.connectorPoints = annotation2.connector?.points?.map((p) => [...p]) || [];
13953
14041
  }
13954
14042
  });
13955
14043
  if (onDataLabelCoordinatesChange) {
@@ -13985,6 +14073,28 @@ function commonAnnotationsForCustomChart(chartData, xScale, yScaleLeft, yScaleRi
13985
14073
  }).notePadding(0).annotations(finalAnnotationList);
13986
14074
  if (!formatOptions.plotArea.fitChart) svg.selectAll(".annotation-group").remove();
13987
14075
  let annotations = appendAnnotations(svg, formatOptions, margin, fontStyle, makeAnnotations, connectorType, false);
14076
+ if (formatOptions.animation?.animationEnabled) {
14077
+ const duration = formatOptions.animation.animationDuration;
14078
+ const ease = effectsMap[formatOptions.animation.animationEffect];
14079
+ const accessors = makeAnnotations.accessors();
14080
+ annotations.selectAll(".annotation").attr("transform", function(d) {
14081
+ const x2 = accessors.x(d.data);
14082
+ const chartType = d.data.type || d.type;
14083
+ const axis2 = d.data?.x?.axis || d.data?.axis;
14084
+ const yScale = axis2 === axisTypes.primary ? yScaleLeft : yScaleRight;
14085
+ let startY;
14086
+ if (chartType === chartTypes.StackColumnChart || chartType === chartTypes.StackAreaChart) {
14087
+ startY = yScale(d.data.prevValue ?? 0);
14088
+ } else {
14089
+ startY = yScale(0);
14090
+ }
14091
+ return `translate(${x2}, ${startY})`;
14092
+ }).transition().duration(duration).ease(ease).attr("transform", function(d) {
14093
+ const x2 = accessors.x(d.data);
14094
+ const y2 = accessors.y(d.data);
14095
+ return `translate(${x2}, ${y2})`;
14096
+ });
14097
+ }
13988
14098
  }
13989
14099
  } catch (error) {
13990
14100
  throw error;
@@ -15169,6 +15279,7 @@ function stacklineAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin
15169
15279
  let dataLabelColor = formatOptions?.annotation?.annotationSetLabelColor == "2" ? "color" : "labelColor";
15170
15280
  let fontStyle = formatOptions.annotation.annotationFontStyle;
15171
15281
  let connectorType = formatOptions.annotation.connectorType ? formatOptions.annotation.connectorType.toLowerCase() : "None";
15282
+ const isCurve = formatOptions.annotation.connectorType?.toLowerCase() === "curve";
15172
15283
  let oldAnnotationList = JSON.parse(JSON.stringify(formatOptions.plotArea.dataLabelsCoordinates));
15173
15284
  oldAnnotationList = conditionallyResetOldAnnotations(oldAnnotationList, formatOptions, chartType);
15174
15285
  let annotationsList = [];
@@ -15273,7 +15384,8 @@ function stacklineAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin
15273
15384
  dy: 0,
15274
15385
  connector: {
15275
15386
  end: connectorType,
15276
- curve: connecterCurve[formatOptions.annotation.connectorCurve]
15387
+ curve: connecterCurve[formatOptions.annotation.connectorCurve],
15388
+ points: isCurve ? getCurvePoints(0, 0) : [[0, 0], [0, 0]]
15277
15389
  },
15278
15390
  disable: Disable,
15279
15391
  subject: {
@@ -15323,12 +15435,10 @@ function stacklineAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin
15323
15435
  newAnnotation.dx = old.dx;
15324
15436
  newAnnotation.dy = old.dy;
15325
15437
  newAnnotation.data.isVisible = old.isVisible ?? true;
15326
- newAnnotation.connector.points = old.connectorPoints?.length ? old.connectorPoints : [[0, 0], [0, 0]];
15327
- if (formatOptions.annotation.annotationType == "5" && newAnnotation.dx == 0 && newAnnotation.dy == 0) {
15328
- newAnnotation.connector["points"] = [
15329
- [0, 0],
15330
- [0, 0]
15331
- ];
15438
+ if (old?.connectorPoints && old.connectorPoints.length >= (isCurve ? 3 : 2)) {
15439
+ newAnnotation.connector.points = old.connectorPoints;
15440
+ } else {
15441
+ newAnnotation.connector.points = isCurve ? getCurvePoints(newAnnotation.dx, newAnnotation.dy) : [[0, 0], [0, 0]];
15332
15442
  }
15333
15443
  }
15334
15444
  }
@@ -15364,7 +15474,7 @@ function stacklineAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin
15364
15474
  if (d.data?.legendUniqueId == annotation2.data.legendUniqueId || d.legendUniqueId == annotation2.data.legendUniqueId) {
15365
15475
  d.dx = annotation2._dx * width / d.width;
15366
15476
  d.dy = annotation2._dy * height / d.height;
15367
- d.connectorPoints = annotation2.connector.points;
15477
+ d.connectorPoints = annotation2.connector?.points?.map((p) => [...p]) || [];
15368
15478
  }
15369
15479
  });
15370
15480
  if (onDataLabelCoordinatesChange) {
@@ -15400,6 +15510,21 @@ function stacklineAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin
15400
15510
  }).notePadding(0).annotations(finalAnnotationList);
15401
15511
  if (true) svg.selectAll(".annotation-group").remove();
15402
15512
  let annotations = appendAnnotations(svg, formatOptions, margin, fontStyle, makeAnnotations, connectorType, barChart);
15513
+ if (formatOptions.animation?.animationEnabled) {
15514
+ const duration = formatOptions.animation.animationDuration;
15515
+ const ease = effectsMap[formatOptions.animation.animationEffect];
15516
+ const accessors = makeAnnotations.accessors();
15517
+ annotations.selectAll(".annotation").attr("transform", function(d) {
15518
+ const x2 = accessors.x(d.data);
15519
+ const yScale = d.data?.y?.axis === axisTypes.primary ? yScaleLeft : yScaleRight;
15520
+ const startY = yScale ? yScale(0) : 0;
15521
+ return `translate(${x2}, ${startY})`;
15522
+ }).transition().duration(duration).ease(ease).attr("transform", function(d) {
15523
+ const x2 = accessors.x(d.data);
15524
+ const y2 = accessors.y(d.data);
15525
+ return `translate(${x2}, ${y2})`;
15526
+ });
15527
+ }
15403
15528
  }
15404
15529
  } catch (error) {
15405
15530
  throw error;
@@ -16143,7 +16268,7 @@ function lineMarkers(lines, chartData, type, xScale, yScale, yScaleRight, toolti
16143
16268
  const group2 = select$2(this);
16144
16269
  let markers = group2.selectAll("path").data(groupData.data);
16145
16270
  let markersEnter = markers.enter().append("path").attr("fill", (d) => d.markerColor);
16146
- markersEnter.merge(markers).attr("d", (d) => {
16271
+ const mergedMarkers = markersEnter.merge(markers).attr("d", (d) => {
16147
16272
  return Symbol$1().type(Markershapes(d.markerShape)).size(d.markerSize * 50)();
16148
16273
  }).attr("visibility", (d) => {
16149
16274
  const hideByX = !xScale(d.dimension) && xScale(d.dimension) !== 0;
@@ -16211,6 +16336,26 @@ function lineMarkers(lines, chartData, type, xScale, yScale, yScaleRight, toolti
16211
16336
  return `translate(${x2},${y2}) scale(1)`;
16212
16337
  });
16213
16338
  });
16339
+ if (formatOptions.animation.animationEnabled) {
16340
+ const duration = formatOptions.animation.animationDuration;
16341
+ const ease = effectsMap[formatOptions.animation.animationEffect] ?? linear$2;
16342
+ const xRange = xScale.range();
16343
+ const xRangeMin = Math.min(xRange[0], xRange[1]);
16344
+ const xRangeSpan = Math.max(xRange[0], xRange[1]) - xRangeMin;
16345
+ const invertEase = (progress, steps = 100) => {
16346
+ for (let i = 0; i <= steps; i++) {
16347
+ const t = i / steps;
16348
+ if (ease(t) >= progress) return t;
16349
+ }
16350
+ return 1;
16351
+ };
16352
+ mergedMarkers.attr("opacity", 0).each(function(d) {
16353
+ const x2 = xScale(d.dimension) ?? xRangeMin;
16354
+ const fraction = xRangeSpan > 0 ? Math.max(0, Math.min(1, (x2 - xRangeMin) / xRangeSpan)) : 0;
16355
+ const delay = invertEase(fraction) * duration;
16356
+ select$2(this).transition().delay(delay).duration(0).attr("opacity", 1);
16357
+ });
16358
+ }
16214
16359
  });
16215
16360
  } catch (error) {
16216
16361
  logError$2(fileName$b, "lineMarkers", error);
@@ -17617,7 +17762,7 @@ const ColumnChart = ({
17617
17762
  "visibility",
17618
17763
  (d) => d.value === 0 && formatOptions.xAxisLabel.hideZeroValues ? "hidden" : "visible"
17619
17764
  );
17620
- const finalBars = bars;
17765
+ const finalBars = formatOptions.animation.animationEnabled ? bars.transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]) : bars;
17621
17766
  finalBars.attr("y", (d) => {
17622
17767
  const yScale = data2.properties.axis === axisTypes.primary ? yScaleLeft : yScaleRight;
17623
17768
  return d.value > 0 ? yScale(d.value) : yScale(0);
@@ -17695,6 +17840,7 @@ const ColumnChart = ({
17695
17840
  filteredDimension,
17696
17841
  xScale
17697
17842
  );
17843
+ getChartType(filteredData);
17698
17844
  commonAnnotations(
17699
17845
  seriesData,
17700
17846
  xScale,
@@ -17746,7 +17892,6 @@ const ColumnChart = ({
17746
17892
  margin,
17747
17893
  innerHeight2
17748
17894
  );
17749
- getChartType(filteredData);
17750
17895
  };
17751
17896
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
17752
17897
  "svg",
@@ -17829,6 +17974,7 @@ const CustomColumnChart = ({
17829
17974
  let requiredData = [];
17830
17975
  let scrollPosition = 0;
17831
17976
  let visibleBars;
17977
+ let annotationTimeoutId;
17832
17978
  let chartJSON = {
17833
17979
  dimensionList,
17834
17980
  chartType,
@@ -18334,13 +18480,10 @@ const CustomColumnChart = ({
18334
18480
  "transform",
18335
18481
  (d) => `translate(${xScale(d.dimension) - columnWidth / 2}, 0)`
18336
18482
  );
18337
- columnGroupsEnter.append("rect").attr("x", (d) => xScaleForLegends(d.legendUniqueId)).attr("width", xScaleForLegends.bandwidth()).attr("y", (d) => {
18483
+ const bars = columnGroupsEnter.append("rect").attr("x", (d) => xScaleForLegends(d.legendUniqueId)).attr("width", xScaleForLegends.bandwidth()).attr("y", (d) => {
18338
18484
  const yScale = data2.properties.axis === axisTypes.primary ? yScaleLeft : yScaleRight;
18339
- return d.value > 0 ? yScale(d.value) : yScale(0);
18340
- }).attr("height", (d) => {
18341
- const yScale = data2.properties.axis === axisTypes.primary ? yScaleLeft : yScaleRight;
18342
- return Math.abs(yScale(d.value) - yScale(0));
18343
- }).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(
18485
+ return yScale(0);
18486
+ }).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(
18344
18487
  "stroke",
18345
18488
  (d) => data2.properties.stackBorderStyle == 0 ? "none" : formatOptions.column.stackBorderVisibility ? data2.properties.stackBorderColor : "none"
18346
18489
  ).style("clip-path", "inset(0px) fill-box").style("shape-rendering", "crispEdges").attr(
@@ -18378,6 +18521,14 @@ const CustomColumnChart = ({
18378
18521
  seriesData.filter((e) => e.legend === d.legend)[0].properties
18379
18522
  );
18380
18523
  }).on("mouseout", hideTooltipOnMouseOut);
18524
+ const finalBars = formatOptions.animation.animationEnabled ? bars.transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]) : bars;
18525
+ finalBars.attr("y", (d) => {
18526
+ const yScale = data2.properties.axis === axisTypes.primary ? yScaleLeft : yScaleRight;
18527
+ return d.value > 0 ? yScale(d.value) : yScale(0);
18528
+ }).attr("height", (d) => {
18529
+ const yScale = data2.properties.axis === axisTypes.primary ? yScaleLeft : yScaleRight;
18530
+ return Math.abs(yScale(d.value) - yScale(0));
18531
+ });
18381
18532
  columnGroups.exit().remove();
18382
18533
  };
18383
18534
  const drawLineChart = (lineData) => {
@@ -18423,6 +18574,14 @@ const CustomColumnChart = ({
18423
18574
  "stroke-width",
18424
18575
  (d) => d.properties.lineStyle !== "None" ? d.properties.lineWidth : "0"
18425
18576
  );
18577
+ if (formatOptions.animation.animationEnabled) {
18578
+ lineGroupsEnter.merge(lineGroups).select("path").each(function() {
18579
+ const path2 = select$2(this);
18580
+ const totalLength = this.getTotalLength();
18581
+ path2.attr("stroke-dasharray", totalLength + " " + totalLength).attr("stroke-dashoffset", totalLength);
18582
+ path2.transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]).attr("stroke-dashoffset", 0);
18583
+ });
18584
+ }
18426
18585
  lineGroups.exit().remove();
18427
18586
  lineMarkers(
18428
18587
  lines,
@@ -18463,6 +18622,10 @@ const CustomColumnChart = ({
18463
18622
  )
18464
18623
  // : yScaleRight((d as TDataPoint).value)
18465
18624
  ).defined((d) => d.hideZero ? Boolean(d.value) : true).curve(getCurveType(formatOptions));
18625
+ const areaGeneratorStart = area().x(
18626
+ (d) => xScale(d.dimension) ? xScale(d.dimension) : null
18627
+ ).y0(() => yScaleLeft(0)).y1(() => yScaleLeft(0)).defined((d) => d.hideZero ? Boolean(d.value) : true).curve(getCurveType(formatOptions));
18628
+ const enableAreaTransition = formatOptions.animation.animationEnabled;
18466
18629
  let areas = gTag.selectAll(".areas.parentGroup").data([1]);
18467
18630
  let focus = gTag.append("g").attr("class", "focusClass");
18468
18631
  areas = areas.enter().append("g").attr("class", "areas parentGroup").attr("clip-path", `url(#${chartId}-clip)`).merge(areas);
@@ -18477,8 +18640,13 @@ const CustomColumnChart = ({
18477
18640
  ).attr("class", "area parentGroup").attr(
18478
18641
  "fill",
18479
18642
  (d) => d.properties.color !== commonColors.white ? d.properties.color : "none"
18480
- ).style("fill-opacity", formatOptions.plotArea.fillOpacity);
18481
- areaGroupsEnter.merge(areaGroups).select("path").attr("d", (d) => areaGenerator(d.data)).attr(
18643
+ ).style("fill-opacity", formatOptions.plotArea.fillOpacity).attr("d", (d) => enableAreaTransition ? areaGeneratorStart(d.data) : areaGenerator(d.data)).each(function(d) {
18644
+ if (enableAreaTransition) {
18645
+ select$2(this).transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]).attr("d", areaGenerator(d.data));
18646
+ }
18647
+ });
18648
+ areaGroups.select("path").attr("d", (d) => areaGenerator(d.data));
18649
+ areaGroupsEnter.merge(areaGroups).select("path").attr(
18482
18650
  "stroke",
18483
18651
  (d) => d.properties.areaBorderColor !== commonColors.white ? d.properties.areaBorderColor : "none"
18484
18652
  ).attr("stroke-dasharray", (d) => {
@@ -18539,6 +18707,10 @@ const CustomColumnChart = ({
18539
18707
  ).y1(
18540
18708
  (d) => d.data.axis === axisTypes.primary ? yScaleLeft(d[1]) : yScaleRight(d[1])
18541
18709
  ).defined((d) => d.hideZero ? Boolean(d.key) : true).curve(getCurveType(formatOptions));
18710
+ const stackAreaGeneratorStart = area().x(
18711
+ (d) => xScale(d.data.dimension) ? xScale(d.data.dimension) : null
18712
+ ).y0(() => yScaleLeft(0)).y1(() => yScaleLeft(0)).defined((d) => d.hideZero ? Boolean(d.key) : true).curve(getCurveType(formatOptions));
18713
+ const enableStackAreaTransition = formatOptions.animation.animationEnabled;
18542
18714
  let areas = gTag.selectAll(".parentGroup").data([stackAreaData]);
18543
18715
  gTag.append("g").attr("class", "focusClass");
18544
18716
  areas = areas.enter().append("g").attr("class", "areas parentGroup").attr("clip-path", `url(#${chartId}-clip)`).merge(areas);
@@ -18547,8 +18719,13 @@ const CustomColumnChart = ({
18547
18719
  areaGroupsEnter.append("path").attr(
18548
18720
  "hoverId",
18549
18721
  (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, "-")
18550
- ).attr("class", "area parentGroup").attr("fill", (d) => d.color !== commonColors.white ? d.color : "none");
18551
- areaGroupsEnter.merge(areaGroups).select("path").attr("d", (d, i) => areaGenerator(d)).style("opacity", formatOptions.plotArea.fillOpacity).attr(
18722
+ ).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) {
18723
+ if (enableStackAreaTransition) {
18724
+ select$2(this).transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]).attr("d", areaGenerator(d));
18725
+ }
18726
+ });
18727
+ areaGroups.select("path").attr("d", (d) => areaGenerator(d));
18728
+ areaGroupsEnter.merge(areaGroups).select("path").style("opacity", formatOptions.plotArea.fillOpacity).attr(
18552
18729
  "stroke",
18553
18730
  (d) => d.color !== commonColors.white ? d.color : "none"
18554
18731
  ).attr(
@@ -18585,19 +18762,24 @@ const CustomColumnChart = ({
18585
18762
  let stackColumnGroupsEnter = stackColumnGroups.enter().append("g").attr("class", (d) => "stackcolumns-group ");
18586
18763
  stackColumnGroups = stackColumnGroupsEnter.merge(stackColumnGroups);
18587
18764
  let rects = stackColumnGroups.selectAll("rect").data((d) => d);
18588
- rects.enter().append("rect").attr(
18589
- "transform",
18590
- (d) => `translate(${xScale(d.data.dimension) - columnWidth / 2},0)`
18591
- ).merge(rects).attr(
18592
- "hoverId",
18593
- (d) => d.alias.includes("~$~") ? d.alias.split("~$~")[1].replace(/ /g, "-") : d.alias.replace(/ /g, "-")
18594
- ).attr("x", (d) => xScaleForLegends(chartTypes.StackColumnChart)).attr(
18765
+ rects.attr(
18595
18766
  "y",
18596
18767
  (d) => d.data.axis === axisTypes.primary ? yScaleLeft(d[1]) : yScaleRight(d[1])
18597
18768
  ).attr(
18598
18769
  "height",
18599
18770
  (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])
18600
- ).attr("width", xScaleForLegends.bandwidth()).attr("fill", (d, i, nodes) => {
18771
+ );
18772
+ const rectsEnter = rects.enter().append("rect").attr(
18773
+ "transform",
18774
+ (d) => `translate(${xScale(d.data.dimension) - columnWidth / 2},0)`
18775
+ ).attr(
18776
+ "y",
18777
+ (d) => d.data.axis === axisTypes.primary ? yScaleLeft(0) : yScaleRight(0)
18778
+ ).attr("height", 0);
18779
+ rectsEnter.merge(rects).attr(
18780
+ "hoverId",
18781
+ (d) => d.alias.includes("~$~") ? d.alias.split("~$~")[1].replace(/ /g, "-") : d.alias.replace(/ /g, "-")
18782
+ ).attr("x", (d) => xScaleForLegends(chartTypes.StackColumnChart)).attr("width", xScaleForLegends.bandwidth()).attr("fill", (d, i, nodes) => {
18601
18783
  const seriesIndex = Array.from(seriesData).findIndex(
18602
18784
  (sdata) => sdata.legend === d.key
18603
18785
  );
@@ -18644,6 +18826,14 @@ const CustomColumnChart = ({
18644
18826
  seriesData.filter((e) => e.legend === d.key)[0].properties
18645
18827
  );
18646
18828
  }).on("mouseout", hideTooltipOnMouseOut);
18829
+ const finalStackRects = formatOptions.animation.animationEnabled ? rectsEnter.transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]) : rectsEnter;
18830
+ finalStackRects.attr(
18831
+ "y",
18832
+ (d) => d.data.axis === axisTypes.primary ? yScaleLeft(d[1]) : yScaleRight(d[1])
18833
+ ).attr(
18834
+ "height",
18835
+ (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])
18836
+ );
18647
18837
  stackColumnGroups.exit().remove();
18648
18838
  };
18649
18839
  const setSVGContainer = (margin2) => {
@@ -18721,48 +18911,60 @@ const CustomColumnChart = ({
18721
18911
  filteredDimension,
18722
18912
  xScale
18723
18913
  );
18724
- commonAnnotationsForCustomChart(
18725
- filteredData,
18726
- xScale,
18727
- yScaleLeft,
18728
- yScaleRight,
18729
- // need to pass secondary axis scale if secondary axis is drawn
18730
- margin,
18731
- d3Annotation,
18732
- stackColumnData,
18733
- stackAreaData,
18734
- [],
18735
- //labelExcludeList
18736
- [],
18737
- // individualLabelColor
18738
- columnWidth,
18739
- // [], //old annotation list
18740
- formatOptions,
18741
- height,
18742
- width,
18743
- innerWidth2,
18744
- filteredDimension,
18745
- innerHeight2,
18746
- chartId,
18747
- svg,
18748
- onDataLabelCoordinatesChange,
18749
- xScaleForLegends,
18750
- isReportEditable
18751
- );
18752
- addTotalValue(
18753
- totalValueMap,
18754
- xScale,
18755
- yScaleLeft,
18756
- margin,
18757
- d3Annotation,
18758
- [],
18759
- formatOptions,
18760
- chartType,
18761
- height,
18762
- width,
18763
- svg,
18764
- isReportEditable
18765
- );
18914
+ clearTimeout(annotationTimeoutId);
18915
+ const renderAnnotationsAndTotals = () => {
18916
+ commonAnnotationsForCustomChart(
18917
+ filteredData,
18918
+ xScale,
18919
+ yScaleLeft,
18920
+ yScaleRight,
18921
+ // need to pass secondary axis scale if secondary axis is drawn
18922
+ margin,
18923
+ d3Annotation,
18924
+ stackColumnData,
18925
+ stackAreaData,
18926
+ [],
18927
+ //labelExcludeList
18928
+ [],
18929
+ // individualLabelColor
18930
+ columnWidth,
18931
+ // [], //old annotation list
18932
+ formatOptions,
18933
+ height,
18934
+ width,
18935
+ innerWidth2,
18936
+ filteredDimension,
18937
+ innerHeight2,
18938
+ chartId,
18939
+ svg,
18940
+ onDataLabelCoordinatesChange,
18941
+ xScaleForLegends,
18942
+ isReportEditable
18943
+ );
18944
+ addTotalValue(
18945
+ totalValueMap,
18946
+ xScale,
18947
+ yScaleLeft,
18948
+ margin,
18949
+ d3Annotation,
18950
+ [],
18951
+ formatOptions,
18952
+ chartType,
18953
+ height,
18954
+ width,
18955
+ svg,
18956
+ isReportEditable
18957
+ );
18958
+ };
18959
+ if (formatOptions.animation.animationEnabled) {
18960
+ svg.selectAll(".annotation-group").remove();
18961
+ annotationTimeoutId = setTimeout(
18962
+ renderAnnotationsAndTotals,
18963
+ formatOptions.animation.animationDuration
18964
+ );
18965
+ } else {
18966
+ renderAnnotationsAndTotals();
18967
+ }
18766
18968
  };
18767
18969
  const createStackData = (requiredStackChatData) => {
18768
18970
  let legendList = requiredStackChatData.data.map((d) => d.legend);
@@ -18894,7 +19096,6 @@ const LayeredColumnChart = ({
18894
19096
  let yScaleLeft;
18895
19097
  let yScaleRight;
18896
19098
  let xScale;
18897
- let xScaleForLegends;
18898
19099
  let calculatedRange;
18899
19100
  let yAxisLeft;
18900
19101
  let xAxis;
@@ -19150,7 +19351,7 @@ const LayeredColumnChart = ({
19150
19351
  calculatedRange = [0, innerWidth2];
19151
19352
  };
19152
19353
  const getXScale = () => {
19153
- xScaleForLegends = band().domain(["layeredLegend"]).range([0, columnWidth]).paddingInner(
19354
+ band().domain(["layeredLegend"]).range([0, columnWidth]).paddingInner(
19154
19355
  chartJSON.legendList.length > 1 ? 0.3 * parseFloat(formatOptions.plotArea.plotAreaSeriesWidth) / 100 : 0
19155
19356
  );
19156
19357
  xScale = point$7().domain(filteredDimension).range(calculatedRange).padding(0.5);
@@ -19209,15 +19410,12 @@ const LayeredColumnChart = ({
19209
19410
  });
19210
19411
  });
19211
19412
  lineData.forEach((data2, index2) => {
19212
- let column = gTag.selectAll(".parentGroup").data([data2], (d) => d.properties.legendUniqueId);
19213
- column = column.enter().append("g").attr("class", `column parentGroup`).attr("clip-path", `url(#${chartId}-clip)`).merge(column);
19214
- let columnGroups = column.selectAll(".column-group").data(data2.data, (d) => d.properties.legendUniqueId);
19413
+ let column = gTag.selectAll(`.parentGroup-${data2.properties.legendUniqueId}`).data([data2], (d) => d.properties.legendUniqueId);
19414
+ column = column.enter().append("g").attr("class", `column parentGroup parentGroup-${data2.properties.legendUniqueId}`).attr("clip-path", `url(#${chartId}-clip)`).merge(column);
19415
+ let columnGroups = column.selectAll(".column-group").data(data2.data, (d) => d.dimension + "_" + data2.properties.legendUniqueId);
19215
19416
  let columnGroupsEnter = columnGroups.enter().append("g").attr("class", "column-group").attr(
19216
19417
  "hoverId",
19217
- (data2.properties.alias || data2.properties.name || "Legend").replace(
19218
- /\s+/g,
19219
- "-"
19220
- )
19418
+ (data2.properties.alias || data2.properties.name || "Legend").replace(/\s+/g, "-")
19221
19419
  ).attr(
19222
19420
  "transform",
19223
19421
  (d) => index2 === 0 ? `translate(${xScale(d.dimension) - columnWidth / 2}, 0)` : `translate(${xScale(d.dimension) - columnWidth / (2 + index2 * 2)}, 0)`
@@ -19230,22 +19428,38 @@ const LayeredColumnChart = ({
19230
19428
  "transform",
19231
19429
  (d) => index2 === 0 ? `translate(${xScale(d.dimension) - columnWidth / 2}, 0)` : `translate(${xScale(d.dimension) - columnWidth / (2 + index2 * 2)}, 0)`
19232
19430
  );
19233
- columnGroupsEnter.append("rect").attr("x", (d) => xScaleForLegends(d.dimension)).attr("width", index2 === 0 ? columnWidth : columnWidth / 2 + index2 * 2).attr("y", (d) => {
19234
- const yScale = data2.properties.axis === axisTypes.primary ? yScaleLeft : yScaleRight;
19235
- return d.value > 0 ? yScale(d.value) : yScale(0);
19236
- }).attr("height", (d) => {
19431
+ const bars = columnGroupsEnter.append("rect").attr("x", () => 0).attr("width", index2 === 0 ? columnWidth : columnWidth / 2 + index2 * 2).attr("y", (d) => {
19237
19432
  const yScale = data2.properties.axis === axisTypes.primary ? yScaleLeft : yScaleRight;
19238
- return Math.abs(yScale(d.value) - yScale(0));
19239
- }).attr("fill", (d) => colorScaleMap.get(data2.properties.legendUniqueId)?.(d.value) ?? data2.properties.color).attr(
19433
+ return yScale(0);
19434
+ }).attr("height", 0).attr(
19435
+ "fill",
19436
+ (d) => colorScaleMap.get(data2.properties.legendUniqueId)?.(d.value) ?? data2.properties.color
19437
+ ).attr(
19240
19438
  "stroke-dasharray",
19241
- (d) => data2.properties.stackBorderStyle == 2 ? "5,3" : "0"
19242
- ).attr("stroke-width", () => `${data2.properties.stackBorderWidth}px`).attr(
19439
+ () => data2.properties.stackBorderStyle == 2 ? "5,3" : "0"
19440
+ ).attr("stroke-width", `${data2.properties.stackBorderWidth}px`).attr(
19243
19441
  "stroke",
19244
19442
  () => data2.properties.stackBorderStyle == 0 ? "none" : formatOptions.column.stackBorderVisibility ? data2.properties.stackBorderColor : "none"
19245
19443
  ).style("clip-path", "inset(0px) fill-box").style("shape-rendering", "crispEdges").attr("opacity", 0.7).attr(
19246
19444
  "visibility",
19247
19445
  (d) => d.value === 0 && formatOptions.xAxisLabel.hideZeroValues ? "hidden" : "visible"
19248
- ).on("mousemove", (event2, d) => {
19446
+ );
19447
+ const finalBars = formatOptions.animation.animationEnabled ? bars.transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]) : bars;
19448
+ finalBars.attr("y", (d) => {
19449
+ const yScale = data2.properties.axis === axisTypes.primary ? yScaleLeft : yScaleRight;
19450
+ return d.value > 0 ? yScale(d.value) : yScale(0);
19451
+ }).attr("height", (d) => {
19452
+ const yScale = data2.properties.axis === axisTypes.primary ? yScaleLeft : yScaleRight;
19453
+ return Math.abs(yScale(d.value) - yScale(0));
19454
+ });
19455
+ columnGroups.select("rect").transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]).attr("y", (d) => {
19456
+ const yScale = data2.properties.axis === axisTypes.primary ? yScaleLeft : yScaleRight;
19457
+ return d.value > 0 ? yScale(d.value) : yScale(0);
19458
+ }).attr("height", (d) => {
19459
+ const yScale = data2.properties.axis === axisTypes.primary ? yScaleLeft : yScaleRight;
19460
+ return Math.abs(yScale(d.value) - yScale(0));
19461
+ });
19462
+ columnGroupsEnter.merge(columnGroups).on("mousemove", (event2, d) => {
19249
19463
  showTooltipOnMouseMove(
19250
19464
  [
19251
19465
  {
@@ -19287,6 +19501,7 @@ const LayeredColumnChart = ({
19287
19501
  });
19288
19502
  columnGroups.exit().remove();
19289
19503
  });
19504
+ gTag.selectAll(".parentGroup").raise();
19290
19505
  };
19291
19506
  const setSVGContainer = (margin2) => {
19292
19507
  innerWidth2 = width - margin2.left - margin2.right;
@@ -19779,7 +19994,7 @@ const StackColumnChart = ({
19779
19994
  }).on("mouseout", (event2, d) => {
19780
19995
  hideTooltipOnMouseOut();
19781
19996
  });
19782
- const finalRects = baseRects;
19997
+ const finalRects = formatOptions.animation.animationEnabled ? baseRects.transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]) : baseRects;
19783
19998
  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])));
19784
19999
  columnGroups.exit().remove();
19785
20000
  gTag.selectAll(".parentGroup").raise();
@@ -20515,7 +20730,8 @@ const NormalizedStackColumnChart = ({
20515
20730
  const { props } = getPropsForRect(nodes, i);
20516
20731
  return d.data[d.key] === 0 && props?.hideZeroValues ? "hidden" : "visible";
20517
20732
  });
20518
- const applyTransition = (sel) => sel;
20733
+ const shouldAnimate = formatOptions.animation.animationEnabled;
20734
+ const applyTransition = (sel) => shouldAnimate ? sel.transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]) : sel;
20519
20735
  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])));
20520
20736
  rectsEnter.merge(rects).on("mousemove", (event2, d) => {
20521
20737
  showTooltipOnMouseMove(
@@ -21178,6 +21394,7 @@ function pieFamilyAnnotation(d3Annotation2, chartData, formatOptions, getPiePosi
21178
21394
  const AnnotationType = formatOptions.plotArea.annotationType ?? "1";
21179
21395
  const Disable = [AnnotationType === "1" ? "connector" : ""];
21180
21396
  const ConnectorType = formatOptions.plotArea.connectorType?.toLowerCase() ?? "none";
21397
+ const isCurve = AnnotationType === "5";
21181
21398
  const rotationAngle = formatOptions.plotArea.rotation ?? 0;
21182
21399
  const multiplicationFactor = chartType === chartTypes.PieChart ? 1.06 : 1.1;
21183
21400
  const connecterCurve2 = {
@@ -21185,6 +21402,11 @@ function pieFamilyAnnotation(d3Annotation2, chartData, formatOptions, getPiePosi
21185
21402
  "2": curveLinear$1,
21186
21403
  "3": step
21187
21404
  };
21405
+ const getCurvePoints2 = (dx, dy) => [
21406
+ [0, 0],
21407
+ [dx / 2, dy / 2],
21408
+ [dx, dy]
21409
+ ];
21188
21410
  const connectedStyle2 = {
21189
21411
  solid: "unset",
21190
21412
  dotted: "2,2",
@@ -21240,12 +21462,13 @@ function pieFamilyAnnotation(d3Annotation2, chartData, formatOptions, getPiePosi
21240
21462
  dy: 0,
21241
21463
  connector: {
21242
21464
  end: ConnectorType,
21243
- curve: connecterCurve2[formatOptions.plotArea.connectorCurve]
21465
+ curve: connecterCurve2[formatOptions.plotArea.connectorCurve],
21466
+ points: isCurve ? getCurvePoints2(0, 0) : [[0, 0], [0, 0]]
21244
21467
  },
21245
21468
  disable: Disable,
21246
21469
  subject: { radius: 3 },
21247
21470
  type: annotationTypeforCharts(d3Annotation2, AnnotationType),
21248
- color: formatOptions.plotArea.dataLabelNameColor ?? "#000",
21471
+ color: formatOptions.plotArea.connectorColor ?? "#ccc",
21249
21472
  width,
21250
21473
  height,
21251
21474
  index: index2
@@ -21275,7 +21498,11 @@ function pieFamilyAnnotation(d3Annotation2, chartData, formatOptions, getPiePosi
21275
21498
  newAnnotation.dy = old.dy * scaleFactor;
21276
21499
  }
21277
21500
  newAnnotation.data.isVisible = old.data?.isVisible ?? true;
21278
- newAnnotation.connector.points = old.connectorPoints?.length ? old.connectorPoints : [[0, 0], [0, 0]];
21501
+ if (old.connectorPoints?.length >= (isCurve ? 3 : 2)) {
21502
+ newAnnotation.connector.points = old.connectorPoints;
21503
+ } else {
21504
+ newAnnotation.connector.points = isCurve ? getCurvePoints2(newAnnotation.dx, newAnnotation.dy) : [[0, 0], [0, 0]];
21505
+ }
21279
21506
  }
21280
21507
  finalAnnotationList.push(newAnnotation);
21281
21508
  });
@@ -21321,11 +21548,42 @@ function pieFamilyAnnotation(d3Annotation2, chartData, formatOptions, getPiePosi
21321
21548
  }
21322
21549
  }).annotations(finalAnnotationList);
21323
21550
  const annotations = svg.append("g").attr("class", "annotation-group parentGroup").attr("transform", getPiePosition).call(makeAnnotations);
21551
+ const fontStyleName = formatOptions.plotArea.dataLabelNameFontStyle ?? [];
21552
+ annotations.selectAll(".annotation-note-title").style("font-family", formatOptions.plotArea.dataLabelNameFontFamily).style("font-size", `${formatOptions.plotArea.dataLabelNameFontSize}px`).style("font-style", fontStyleName.includes("Italic") ? "italic" : "").style("text-decoration", fontStyleName.includes("Underline") ? "underline" : "").style("font-weight", fontStyleName.includes("Bold") ? "bold" : "").style("fill", formatOptions.plotArea.dataLabelNameColor ?? "#000");
21553
+ const fontStyleValue = formatOptions.plotArea.dataLabelValueFontStyle ?? [];
21554
+ annotations.selectAll(".annotation-note-label").style("font-family", formatOptions.plotArea.dataLabelValueFontFamily).style("font-size", `${formatOptions.plotArea.dataLabelValueFontSize}px`).style("font-style", fontStyleValue.includes("Italic") ? "italic" : "").style("text-decoration", fontStyleValue.includes("Underline") ? "underline" : "").style("font-weight", fontStyleValue.includes("Bold") ? "bold" : "").style("fill", formatOptions.plotArea.dataLabelValueColor ?? "#000");
21555
+ if (formatOptions.plotArea.plotAreaAbsoluteValue) {
21556
+ annotations.selectAll(".annotation-note-label").each(function(d) {
21557
+ const labelEl = select$2(this);
21558
+ const absText = format(".2s")(Math.abs(d.data.y.value));
21559
+ labelEl.append("tspan").attr("x", labelEl.attr("x") ?? "0").attr("dy", "1.2em").attr("fill-opacity", 0.5).attr("font-weight", "300").style("font-family", formatOptions.plotArea.dataLabelValueFontFamily).style("font-size", `${formatOptions.plotArea.dataLabelValueFontSize}px`).style("fill", formatOptions.plotArea.dataLabelValueColor ?? "#000").text(absText);
21560
+ });
21561
+ }
21562
+ if (ConnectorType === "diamond") {
21563
+ const connectorColor2 = formatOptions.plotArea.connectorColor ?? "#ccc";
21564
+ const size = 5;
21565
+ annotations.selectAll(".annotation-connector").each(function() {
21566
+ if (!select$2(this).select("path.connector").empty()) {
21567
+ select$2(this).append("polygon").attr("class", "connector-end connector-diamond").attr("points", `0,${-size} ${size},0 0,${size} ${-size},0`).style("fill", connectorColor2).style("stroke", connectorColor2);
21568
+ }
21569
+ });
21570
+ }
21324
21571
  annotations.selectAll("rect,.annotation-subject").remove();
21325
- annotations.selectAll(".connector").style("stroke", formatOptions.plotArea.connectorColor ?? "#ccc").attr(
21572
+ if (formatOptions.animation?.animationEnabled) {
21573
+ const duration = formatOptions.animation.animationDuration;
21574
+ const ease = effectsMap[formatOptions.animation.animationEffect];
21575
+ const labels = annotations.selectAll(".annotation-note-label");
21576
+ labels.interrupt().style("opacity", 0);
21577
+ setTimeout(() => {
21578
+ labels.transition().delay((d, i) => i * 30).duration(duration).ease(ease).style("opacity", 1);
21579
+ }, 50);
21580
+ }
21581
+ const connectorColor = formatOptions.plotArea.connectorColor ?? "#ccc";
21582
+ annotations.selectAll(".connector").style("stroke", connectorColor).attr(
21326
21583
  "stroke-dasharray",
21327
21584
  connectedStyle2[formatOptions.plotArea.connectorStyle?.toLowerCase()]
21328
21585
  );
21586
+ annotations.selectAll(".connector-end").style("fill", connectorColor).style("stroke", connectorColor);
21329
21587
  annotations.selectAll(".annotation-note-label").filter((d) => !d.data.isVisible).style("display", "none");
21330
21588
  annotations.selectAll(".annotation-note-label").filter((d) => formatOptions.plotArea.hideInsignificantValue && d.data.x1 - d.data.x0 < 0.09).style("visibility", "hidden");
21331
21589
  } catch (error) {
@@ -21753,7 +22011,8 @@ const ColumnHistogramChart = ({
21753
22011
  formatOptions.bins.binsCalculation === "Automatic" ? xAxis.ticks(thresholds) : xAxis.tickValues(periods).ticks(innerWidth2 / 50);
21754
22012
  };
21755
22013
  const getChartType = (lineData) => {
21756
- 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(
22014
+ const shouldAnimate = formatOptions.animation.animationEnabled;
22015
+ 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(
21757
22016
  "stroke",
21758
22017
  formatOptions.bins.binsBorderVisibility && formatOptions.bins.binsBorderColor
21759
22018
  ).attr(
@@ -21763,12 +22022,10 @@ const ColumnHistogramChart = ({
21763
22022
  "stroke-opacity",
21764
22023
  formatOptions.bins.binsBorderVisibility && formatOptions.bins.binsBorderOpacity
21765
22024
  ).attr("x", 1).attr("transform", function(d) {
21766
- return "translate(" + xScale(d.x0) + "," + (yScaleLeft(d.length) > 0 ? yScaleLeft(d.length) : 0) + ")";
22025
+ return "translate(" + xScale(d.x0) + "," + innerHeight2 + ")";
21767
22026
  }).attr("width", function(d) {
21768
22027
  return xScale(d.x1) - xScale(d.x0) - parseFloat(formatOptions.bins.binsGapWidth) < 0 ? 0 : xScale(d.x1) - xScale(d.x0) - parseFloat(formatOptions.bins.binsGapWidth);
21769
- }).attr("height", function(d) {
21770
- return innerHeight2 - yScaleLeft(d.length);
21771
- }).style("fill", (d) => d.color !== commonColors.white ? d.color : "none").style("opacity", formatOptions.bins.binsFillOpacity).style("shape-rendering", "crispEdges").on("mousemove", (event2, d) => {
22028
+ }).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) => {
21772
22029
  showTooltipOnMouseMove(
21773
22030
  [
21774
22031
  {
@@ -21790,6 +22047,12 @@ const ColumnHistogramChart = ({
21790
22047
  event2
21791
22048
  );
21792
22049
  }).on("mouseout", hideTooltipOnMouseOut);
22050
+ const finalBars = shouldAnimate ? bars.transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]) : bars;
22051
+ finalBars.attr("transform", function(d) {
22052
+ return "translate(" + xScale(d.x0) + "," + (yScaleLeft(d.length) > 0 ? yScaleLeft(d.length) : 0) + ")";
22053
+ }).attr("height", function(d) {
22054
+ return innerHeight2 - yScaleLeft(d.length);
22055
+ });
21793
22056
  gTag.selectAll(".parentGroup").raise();
21794
22057
  };
21795
22058
  const setSVGContainer = (margin2) => {
@@ -22297,6 +22560,8 @@ const LineChart = ({
22297
22560
  ).defined(
22298
22561
  (d) => d.hideZero || chartJSON.hideZeroValues ? Boolean(d.value) : true
22299
22562
  ).curve(getCurveType(formatOptions));
22563
+ const shouldAnimate = formatOptions.animation.animationEnabled;
22564
+ const applyTransition = (sel) => shouldAnimate ? sel.transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]) : sel;
22300
22565
  let lines = gTag.selectAll(".parentGroup").data([reversedLineData]);
22301
22566
  lines = lines.enter().append("g").attr("class", "lines parentGroup").merge(lines);
22302
22567
  let lineGroups = lines.selectAll(".line-group").data((d) => d);
@@ -22304,7 +22569,7 @@ const LineChart = ({
22304
22569
  lineGroupsEnter.append("path").attr("class", "visibleLine").attr("fill", "none");
22305
22570
  lineGroupsEnter.merge(lineGroups).each(function(d) {
22306
22571
  const g = select$2(this);
22307
- g.selectAll("path.visibleLine").data([d]).join("path").attr("class", "visibleLine").attr("d", (d2) => lineGenerator(d2.data)).attr(
22572
+ const pathSel = g.selectAll("path.visibleLine").data([d]).join("path").attr("class", "visibleLine").attr("d", (d2) => lineGenerator(d2.data)).attr(
22308
22573
  "stroke",
22309
22574
  (d2) => d2.properties.color !== commonColors.white ? d2.properties.color : "none"
22310
22575
  ).attr("stroke-dasharray", (d2) => {
@@ -22327,6 +22592,14 @@ const LineChart = ({
22327
22592
  "hoverId",
22328
22593
  (d.properties.alias || d.properties.name || "Legend").replace(/\s+/g, "-")
22329
22594
  ).attr("clip-path", `url(#${chartId}-clip)`).attr("d", (d2) => lineGenerator(d2.data));
22595
+ if (shouldAnimate) {
22596
+ pathSel.each(function() {
22597
+ const path2 = select$2(this);
22598
+ const totalLength = this.getTotalLength();
22599
+ path2.attr("stroke-dasharray", totalLength + " " + totalLength).attr("stroke-dashoffset", totalLength);
22600
+ applyTransition(path2).attr("stroke-dashoffset", 0);
22601
+ });
22602
+ }
22330
22603
  });
22331
22604
  lineGroups.exit().remove();
22332
22605
  lineMarkers(
@@ -22857,7 +23130,13 @@ const StackLineChart = ({
22857
23130
  "stroke-width",
22858
23131
  seriesData[i].properties.lineStyle !== staticLineStyle.none ? seriesData[i].properties.lineWidth : 0
22859
23132
  ).attr("fill", "none");
22860
- pathSel.node().getTotalLength();
23133
+ const enableTransition = formatOptions.animation.animationEnabled;
23134
+ const totalLength = pathSel.node().getTotalLength();
23135
+ if (enableTransition) {
23136
+ pathSel.attr("stroke-dasharray", totalLength + " " + totalLength).attr("stroke-dashoffset", totalLength).transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]).attr("stroke-dashoffset", 0);
23137
+ } else {
23138
+ pathSel.attr("stroke-dasharray", totalLength + " " + totalLength).attr("stroke-dashoffset", 0);
23139
+ }
22861
23140
  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() {
22862
23141
  svg.selectAll(".parentGroup").classed("highlight", false).classed("unhighlight", true);
22863
23142
  svg.selectAll(
@@ -23361,7 +23640,7 @@ const NormalisedStackLineChart = ({
23361
23640
  ).append("path").attr("class", "line").attr("fill", "none");
23362
23641
  lineGroupsEnter.merge(lineGroups).each(function(d, i) {
23363
23642
  const g = select$2(this);
23364
- 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) => {
23643
+ 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) => {
23365
23644
  const lineWidth = parseInt(
23366
23645
  seriesData[i].properties.lineWidth.toString()
23367
23646
  );
@@ -23380,6 +23659,13 @@ const NormalisedStackLineChart = ({
23380
23659
  "stroke-width",
23381
23660
  seriesData[i].properties.lineStyle !== staticLineStyle.none ? seriesData[i].properties.lineWidth : 0
23382
23661
  ).attr("fill", "none");
23662
+ const enableTransition = formatOptions.animation.animationEnabled;
23663
+ const totalLength = pathSel.node().getTotalLength();
23664
+ if (enableTransition) {
23665
+ pathSel.attr("stroke-dasharray", totalLength + " " + totalLength).attr("stroke-dashoffset", totalLength).transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]).attr("stroke-dashoffset", 0);
23666
+ } else {
23667
+ pathSel.attr("stroke-dasharray", totalLength + " " + totalLength).attr("stroke-dashoffset", 0);
23668
+ }
23383
23669
  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) {
23384
23670
  svg.selectAll(".parentGroup").classed("highlight", false).classed("unhighlight", true);
23385
23671
  svg.selectAll(
@@ -23969,7 +24255,7 @@ const HorizontalBarChart = ({
23969
24255
  "visibility",
23970
24256
  (d) => d.value === 0 && formatOptions.xAxisLabel.hideZeroValues ? "hidden" : "visible"
23971
24257
  );
23972
- const finalBars = bars;
24258
+ const finalBars = formatOptions.animation.animationEnabled ? bars.transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]) : bars;
23973
24259
  finalBars.attr("x", (d) => {
23974
24260
  const xScaleUsed = data2.properties.axis === axisTypes.primary ? xScaleBottom : xScaleTop;
23975
24261
  return d.value >= 0 ? xScaleUsed(0) : xScaleUsed(d.value);
@@ -24492,7 +24778,7 @@ const StackHorizontalChart = ({
24492
24778
  hideTooltipOnMouseOut();
24493
24779
  });
24494
24780
  baseRects.attr("x", (d) => xScaleBottom(0));
24495
- const finalRects = baseRects;
24781
+ const finalRects = formatOptions.animation.animationEnabled ? baseRects.transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]) : baseRects;
24496
24782
  finalRects.attr("x", (d) => Math.min(xScaleBottom(d[0]), xScaleBottom(d[1]))).attr("width", (d) => Math.abs(xScaleBottom(d[1]) - xScaleBottom(d[0])));
24497
24783
  columnGroups.exit().remove();
24498
24784
  gTag.selectAll(".parentGroup").raise();
@@ -25195,7 +25481,7 @@ const NormalizedStackHorizontalBarChart = ({
25195
25481
  selectAll('[hoverId="' + legend + '"]').classed("highlight", false).classed("unhighlight", false);
25196
25482
  hideTooltipOnMouseOut();
25197
25483
  });
25198
- const finalRects = baseRects;
25484
+ const finalRects = formatOptions.animation.animationEnabled ? baseRects.transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]) : baseRects;
25199
25485
  finalRects.attr("x", (d) => Math.min(xScaleBottom(d[0]), xScaleBottom(d[1]))).attr("width", (d) => Math.abs(xScaleBottom(d[1]) - xScaleBottom(d[0])));
25200
25486
  columnGroups.exit().remove();
25201
25487
  gTag.selectAll(".parentGroup").raise();
@@ -25339,7 +25625,6 @@ const LayeredHorizontalBarChart = ({
25339
25625
  let gTag;
25340
25626
  let xScaleBottom;
25341
25627
  let yScale;
25342
- let yScaleLegend;
25343
25628
  let calculatedRange;
25344
25629
  let xAxisBottom;
25345
25630
  let yAxis;
@@ -25579,7 +25864,7 @@ const LayeredHorizontalBarChart = ({
25579
25864
  getYScale();
25580
25865
  };
25581
25866
  const getYScale = () => {
25582
- yScaleLegend = band().domain(["layeredLegend"]).range([0, columnWidth]).paddingInner(
25867
+ band().domain(["layeredLegend"]).range([0, columnWidth]).paddingInner(
25583
25868
  chartJSON.legendList.length > 1 ? 0.3 * parseFloat(formatOptions.plotArea.plotAreaSeriesWidth) / 100 : 0
25584
25869
  );
25585
25870
  yScale = point$7().domain(filteredDimension).range(calculatedRange).padding(0.5);
@@ -25626,58 +25911,63 @@ const LayeredHorizontalBarChart = ({
25626
25911
  });
25627
25912
  });
25628
25913
  lineData.forEach((data2, index2) => {
25629
- let column = gTag.selectAll(".parentGroup").data([data2], (d) => d.properties.legendUniqueId);
25630
- column = column.enter().append("g").attr("class", `column parentGroup`).attr("clip-path", `url(#${chartId}-clip)`).merge(column);
25631
- let columnGroups = column.selectAll(".column-group").data(data2.data, (d) => d.properties.legendUniqueId);
25914
+ let column = gTag.selectAll(`.parentGroup-${data2.properties.legendUniqueId}`).data([data2], (d) => d.properties.legendUniqueId);
25915
+ column = column.enter().append("g").attr("class", `column parentGroup parentGroup-${data2.properties.legendUniqueId}`).attr("clip-path", `url(#${chartId}-clip)`).merge(column);
25916
+ let columnGroups = column.selectAll(".column-group").data(data2.data, (d) => d.dimension + "_" + data2.properties.legendUniqueId);
25632
25917
  let columnGroupsEnter = columnGroups.enter().append("g").attr("class", "column-group").attr(
25633
25918
  "hoverId",
25634
- (data2.properties.alias || data2.properties.name || "Legend").replace(
25635
- /\s+/g,
25636
- "-"
25637
- )
25919
+ (data2.properties.alias || data2.properties.name || "Legend").replace(/\s+/g, "-")
25638
25920
  ).attr(
25639
25921
  "transform",
25640
- (d) => index2 === 0 ? `translate(0,${yScale(d.dimension) - columnWidth / 2})` : `translate(0,${yScale(d.dimension) - columnWidth / (2 + index2 * 2)})`
25922
+ (d) => index2 === 0 ? `translate(0, ${yScale(d.dimension) - columnWidth / 2})` : `translate(0, ${yScale(d.dimension) - columnWidth / (2 + index2 * 2)})`
25641
25923
  );
25642
25924
  columnGroups.attr(
25643
25925
  "transform",
25644
- (d) => index2 === 0 ? `translate(0,${yScale(d.dimension) - columnWidth / 2})` : `translate(0,${yScale(d.dimension) - columnWidth / (2 + index2 * 2)})`
25926
+ (d) => index2 === 0 ? `translate(0, ${yScale(d.dimension) - columnWidth / 2})` : `translate(0, ${yScale(d.dimension) - columnWidth / (2 + index2 * 2)})`
25645
25927
  );
25646
25928
  columnGroupsEnter.merge(columnGroups).attr(
25647
25929
  "transform",
25648
- (d) => index2 === 0 ? `translate(0,${yScale(d.dimension) - columnWidth / 2})` : `translate(0,${yScale(d.dimension) - columnWidth / (2 + index2 * 2)})`
25930
+ (d) => index2 === 0 ? `translate(0, ${yScale(d.dimension) - columnWidth / 2})` : `translate(0, ${yScale(d.dimension) - columnWidth / (2 + index2 * 2)})`
25649
25931
  );
25650
- columnGroupsEnter.append("rect").attr("y", (d) => yScaleLegend(d.dimension)).attr("height", index2 === 0 ? columnWidth : columnWidth / 2).attr("x", (d) => {
25651
- return d.value > 0 ? xScaleBottom(0) : xScaleBottom(d.value);
25652
- }).attr(
25653
- "width",
25654
- (d) => d.value > 0 ? customYaxisMaxValue && d.value > customYaxisMaxValue ? xScaleBottom(customYaxisMaxValue) - xScaleBottom(0) : xScaleBottom(d.value) - xScaleBottom(0) : Math.abs(xScaleBottom(0) - xScaleBottom(d.value))
25655
- ).attr("fill", (d) => colorScaleMap.get(data2.properties.legendUniqueId)?.(d.value) ?? data2.properties.color).attr(
25932
+ const bars = columnGroupsEnter.append("rect").attr("y", 0).attr("height", index2 === 0 ? columnWidth : columnWidth / 2).attr("x", () => xScaleBottom(0)).attr("width", 0).attr(
25933
+ "fill",
25934
+ (d) => colorScaleMap.get(data2.properties.legendUniqueId)?.(d.value) ?? data2.properties.color
25935
+ ).attr(
25656
25936
  "stroke-dasharray",
25657
- (d) => d.stackBorderStyle === 2 ? "5,3" : "0"
25658
- ).attr("stroke-width", (d) => `${d.stackBorderWidth}px`).attr(
25937
+ () => data2.properties.stackBorderStyle == 2 ? "5,3" : "0"
25938
+ ).attr("stroke-width", `${data2.properties.stackBorderWidth}px`).attr(
25659
25939
  "stroke",
25660
- (d) => data2.properties.stackBorderStyle === 0 ? "none" : formatOptions.column.stackBorderVisibility ? data2.properties.stackBorderStyle : "none"
25940
+ () => data2.properties.stackBorderStyle == 0 ? "none" : formatOptions.column.stackBorderVisibility ? data2.properties.stackBorderColor : "none"
25661
25941
  ).style("clip-path", "inset(0px) fill-box").style("shape-rendering", "crispEdges").attr("opacity", 0.7).attr(
25662
25942
  "visibility",
25663
25943
  (d) => d.value === 0 && formatOptions.xAxisLabel.hideZeroValues ? "hidden" : "visible"
25664
- ).on("mousemove", (event2, d) => {
25944
+ );
25945
+ const finalBars = formatOptions.animation.animationEnabled ? bars.transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]) : bars;
25946
+ finalBars.attr(
25947
+ "x",
25948
+ (d) => d.value > 0 ? xScaleBottom(0) : xScaleBottom(d.value)
25949
+ ).attr(
25950
+ "width",
25951
+ (d) => d.value > 0 ? xScaleBottom(d.value) - xScaleBottom(0) : Math.abs(xScaleBottom(0) - xScaleBottom(d.value))
25952
+ );
25953
+ columnGroups.select("rect").transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]).attr(
25954
+ "x",
25955
+ (d) => d.value > 0 ? xScaleBottom(0) : xScaleBottom(d.value)
25956
+ ).attr(
25957
+ "width",
25958
+ (d) => d.value > 0 ? xScaleBottom(d.value) - xScaleBottom(0) : Math.abs(xScaleBottom(0) - xScaleBottom(d.value))
25959
+ );
25960
+ columnGroupsEnter.merge(columnGroups).on("mousemove", (event2, d) => {
25665
25961
  showTooltipOnMouseMove(
25666
25962
  [
25667
25963
  {
25668
25964
  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,
25669
- value: chartJSON.formattedDimensionListMap.get(
25670
- Array.isArray(d.dimension) ? d.dimension[0] : d.dimension
25671
- )
25965
+ value: chartJSON.formattedDimensionListMap.get(d.dimension)
25672
25966
  },
25673
25967
  {
25674
- 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,
25968
+ key: formatOptions.yAxisTitle.yAxisTitleHTML !== "" ? new DOMParser().parseFromString(formatOptions.yAxisTitle.yAxisTitleHTML, "text/html").body.textContent?.trim() : d.properties?.currentMeasure || formatOptions.yAxisTitle.yAxisTitleText || d.value,
25675
25969
  value: getNumberWithFormat(
25676
- [
25677
- chartTypes.NormalizedStackLineChart,
25678
- chartTypes.NormalizedStackAreaChart,
25679
- ""
25680
- ].includes(chartType) ? d[1] - d[0] : d.value,
25970
+ d.value,
25681
25971
  formatOptions.toolTip.toolTipDisplayUnits,
25682
25972
  formatOptions.toolTip.toolTipNumberFormat,
25683
25973
  formatOptions.toolTip.toolTipDecimalPrecision
@@ -25692,13 +25982,7 @@ const LayeredHorizontalBarChart = ({
25692
25982
  event2,
25693
25983
  data2.properties
25694
25984
  );
25695
- let legend = (data2.properties.alias || data2.properties.name || "Legend").replace(/ /g, "-");
25696
- selectAll(".parentGroup").classed("highlight", false).classed("unhighlight", true);
25697
- selectAll('[hoverId="' + legend + '"]').classed("highlight", true).classed("unhighlight", false);
25698
- }).on("mouseout", (e, d) => {
25699
- let legend = (data2.properties.alias || data2.properties.name || "Legend").replace(/ /g, "-");
25700
- selectAll(".parentGroup").classed("highlight", false).classed("unhighlight", false);
25701
- selectAll('[hoverId="' + legend + '"]').classed("highlight", false).classed("unhighlight", false);
25985
+ }).on("mouseout", () => {
25702
25986
  hideTooltipOnMouseOut();
25703
25987
  });
25704
25988
  columnGroups.exit().remove();
@@ -25763,8 +26047,8 @@ const LayeredHorizontalBarChart = ({
25763
26047
  onDataLabelCoordinatesChange,
25764
26048
  void 0,
25765
26049
  columnWidth,
25766
- false,
25767
26050
  isReportEditable,
26051
+ false,
25768
26052
  barChart
25769
26053
  );
25770
26054
  getConnectors();
@@ -26385,7 +26669,8 @@ const HorizontalHistogramChart = ({
26385
26669
  formatOptions.bins.binsCalculation === "Automatic" ? yAxisLeft.ticks(thresholds) : yAxisLeft.tickValues(periods).ticks(innerHeight2 / 50);
26386
26670
  };
26387
26671
  const getChartType = (lineData) => {
26388
- 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(
26672
+ const shouldAnimate = formatOptions.animation.animationEnabled;
26673
+ 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(
26389
26674
  "stroke",
26390
26675
  formatOptions.bins.binsBorderVisibility && formatOptions.bins.binsBorderColor
26391
26676
  ).attr(
@@ -26403,7 +26688,7 @@ const HorizontalHistogramChart = ({
26403
26688
  const y12 = yScaleLeft(d.x1);
26404
26689
  const gap = parseFloat(formatOptions.bins.binsGapWidth) || 0;
26405
26690
  return Math.max(1, Math.abs(y12 - y02) - gap);
26406
- }).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) => {
26691
+ }).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) => {
26407
26692
  showTooltipOnMouseMove(
26408
26693
  [
26409
26694
  {
@@ -26425,6 +26710,8 @@ const HorizontalHistogramChart = ({
26425
26710
  event2
26426
26711
  );
26427
26712
  }).on("mouseout", hideTooltipOnMouseOut);
26713
+ const finalBars = shouldAnimate ? bars.transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]) : bars;
26714
+ finalBars.attr("width", (d) => xScale(d.length));
26428
26715
  gTag.selectAll(".parentGroup").raise();
26429
26716
  };
26430
26717
  const setSVGContainer = (margin2) => {
@@ -26920,6 +27207,7 @@ const AreaChart = ({
26920
27207
  const areaGeneratorStart = area().x(
26921
27208
  (d) => xScale(d.dimension) ? xScale(d.dimension) : null
26922
27209
  ).y0(() => yScaleLeft(0)).y1(() => yScaleLeft(0)).defined((d) => d.hideZero ? Boolean(d.value) : true).curve(getCurveType(formatOptions));
27210
+ const enableTransition = formatOptions.animation.animationEnabled;
26923
27211
  let areas = gTag.selectAll(".parentGroup").data([lineData]);
26924
27212
  let focus = gTag.append("g").attr("class", "focusClass");
26925
27213
  areas = areas.enter().append("g").attr("class", "areas lineGroup").attr("clip-path", `url(#${chartId}-clip)`).merge(areas);
@@ -26935,7 +27223,9 @@ const AreaChart = ({
26935
27223
  "-"
26936
27224
  )
26937
27225
  ).attr("d", (d) => areaGeneratorStart(d.data)).each(function(d) {
26938
- {
27226
+ if (enableTransition) {
27227
+ select$2(this).transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]).attr("d", areaGenerator(d.data));
27228
+ } else {
26939
27229
  select$2(this).attr("d", areaGenerator(d.data));
26940
27230
  }
26941
27231
  });
@@ -27456,6 +27746,7 @@ const StackAreaChart = ({
27456
27746
  ).tickSizeOuter(0).tickValues(responsiveXaxisLabel(filteredDimension, innerWidth2));
27457
27747
  };
27458
27748
  const getChartType = (lineData) => {
27749
+ const enableTransition = formatOptions.animation.animationEnabled;
27459
27750
  const isLinesAndMarkersVisible = formatOptions.plotArea.plotAreaHideLineAndMarkers;
27460
27751
  lineData.forEach((lData) => {
27461
27752
  lData.data.forEach((cData) => {
@@ -27482,7 +27773,9 @@ const StackAreaChart = ({
27482
27773
  "hoverId",
27483
27774
  (d) => (lineData[d.index].properties.alias || lineData[d.index].properties.name || "Legend").replace(/\s+/g, "-")
27484
27775
  ).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) {
27485
- {
27776
+ if (enableTransition) {
27777
+ select$2(this).transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]).attr("d", areaGenerator(d));
27778
+ } else {
27486
27779
  select$2(this).attr("d", areaGenerator(d));
27487
27780
  }
27488
27781
  });
@@ -28011,6 +28304,7 @@ const NormalizedStackAreaChart = ({
28011
28304
  ).tickSizeOuter(0).tickValues(responsiveXaxisLabel(filteredDimension, innerWidth2));
28012
28305
  };
28013
28306
  const getChartType = (lineData) => {
28307
+ const enableTransition = formatOptions.animation.animationEnabled;
28014
28308
  const isLinesAndMarkersVisible = formatOptions.plotArea.plotAreaHideLineAndMarkers;
28015
28309
  stackChartData.forEach(
28016
28310
  (data2, i) => data2.forEach((item, position) => {
@@ -28045,7 +28339,9 @@ const NormalizedStackAreaChart = ({
28045
28339
  (d) => (lineData[d.index]?.properties?.alias || lineData[d.index]?.properties?.name || "Legend").replace(/\s+/g, "-")
28046
28340
  ).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) {
28047
28341
  const path2 = select$2(this);
28048
- {
28342
+ if (enableTransition) {
28343
+ path2.transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]).attr("d", columnGenerator(d));
28344
+ } else {
28049
28345
  path2.attr("d", columnGenerator(d));
28050
28346
  }
28051
28347
  });
@@ -28480,13 +28776,13 @@ const PieChart = ({ data, formatOptions, chartId, isReportEditable, onDataLabelC
28480
28776
  try {
28481
28777
  const arc2 = arc$1().innerRadius(0).outerRadius(radius);
28482
28778
  const arcOver = arc$1().innerRadius(0).outerRadius(radius + 10);
28483
- 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(
28779
+ 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(
28484
28780
  "hoverId",
28485
28781
  (d) => (d.data?.properties?.alias || d.data?.properties?.name || "Legend").replace(/\s+/g, "-")
28486
28782
  ).attr(
28487
28783
  "fill",
28488
28784
  (d) => d.data.properties.color !== commonColors.white ? d.data.properties.color : "none"
28489
- ).attr("d", (d) => arc2(d)).on("mouseover.arc", function(d) {
28785
+ ).on("mouseover.arc", function(d) {
28490
28786
  select$2(this).transition().duration(100).attr("d", arcOver);
28491
28787
  }).on("mousemove. ", (d) => {
28492
28788
  showTooltipOnMouseMove(
@@ -28517,6 +28813,17 @@ const PieChart = ({ data, formatOptions, chartId, isReportEditable, onDataLabelC
28517
28813
  select$2(this).transition().duration(100).attr("d", arc2);
28518
28814
  hideTooltipOnMouseOut();
28519
28815
  });
28816
+ if (chartFormatOptions.animation.animationEnabled) {
28817
+ paths.transition().duration(chartFormatOptions.animation.animationDuration).ease(effectsMap[chartFormatOptions.animation.animationEffect]).attrTween("d", function(d) {
28818
+ const interpolate2 = interpolate$4(
28819
+ { startAngle: d.startAngle, endAngle: d.startAngle },
28820
+ d
28821
+ );
28822
+ return (t) => arc2(interpolate2(t));
28823
+ });
28824
+ } else {
28825
+ paths.attr("d", (d) => arc2(d));
28826
+ }
28520
28827
  } catch (error) {
28521
28828
  logError$2(fileName$8, "drawPieChart", error);
28522
28829
  }
@@ -28889,7 +29196,7 @@ const DonutChart = ({
28889
29196
  };
28890
29197
  const drawDonutChart = () => {
28891
29198
  try {
28892
- const enableTransition = false;
29199
+ const enableTransition = chartFormatOptions.animation.animationEnabled;
28893
29200
  const arc2 = arc$1().innerRadius(innerRadius).outerRadius(radius);
28894
29201
  const arcOver = arc$1().innerRadius(innerRadius).outerRadius(radius + 10);
28895
29202
  const parentGroup = chartAreaTagG.append("g").attr("class", "parentGroup").attr("fill-opacity", chartFormatOptions.plotArea.opacity).attr("transform", `${getPiePosition()}`);
@@ -28903,8 +29210,9 @@ const DonutChart = ({
28903
29210
  const thisPath = d;
28904
29211
  thisPath._current = { startAngle: 0, endAngle: 0 };
28905
29212
  }).on("mouseover.arc", function() {
28906
- if (enableTransition) ;
28907
- else {
29213
+ if (enableTransition) {
29214
+ select$2(this).transition().duration(150).attr("d", arcOver);
29215
+ } else {
28908
29216
  select$2(this).attr("d", arcOver);
28909
29217
  }
28910
29218
  }).on("mousemove.text", (d) => {
@@ -28931,13 +29239,23 @@ const DonutChart = ({
28931
29239
  d.currentTarget.__data__.data.properties
28932
29240
  );
28933
29241
  }).on("mouseout.text", () => hideTooltipOnMouseOut()).on("mouseout.arc", function() {
28934
- if (enableTransition) ;
28935
- else {
29242
+ if (enableTransition) {
29243
+ select$2(this).transition().duration(150).attr("d", arc2);
29244
+ } else {
28936
29245
  select$2(this).attr("d", arc2);
28937
29246
  }
28938
29247
  });
28939
- if (enableTransition) ;
28940
- else {
29248
+ if (enableTransition) {
29249
+ paths.transition().duration(chartFormatOptions.animation.animationDuration).ease(effectsMap[chartFormatOptions.animation.animationEffect]).attrTween("d", function(d) {
29250
+ const interpolate2 = interpolate$4(
29251
+ { startAngle: d.startAngle, endAngle: d.startAngle },
29252
+ d
29253
+ );
29254
+ return function(t) {
29255
+ return arc2(interpolate2(t));
29256
+ };
29257
+ });
29258
+ } else {
28941
29259
  paths.attr("d", (d) => arc2(d));
28942
29260
  }
28943
29261
  } catch (error) {
@@ -29385,8 +29703,9 @@ const Treemap = ({ data, formatOptions, chartId }) => {
29385
29703
  };
29386
29704
  const initChartRect = () => {
29387
29705
  try {
29706
+ const shouldAnimate = chartFormatOptions.animation.animationEnabled;
29388
29707
  const leaf = chartAreaTagG.selectAll("g").data(chartData).enter().append("g").attr("transform", (d) => `translate(${d.x0},${d.y0})`);
29389
- 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) => {
29708
+ 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) => {
29390
29709
  showTooltipOnMouseMove(
29391
29710
  [
29392
29711
  {
@@ -29404,6 +29723,9 @@ const Treemap = ({ data, formatOptions, chartId }) => {
29404
29723
  getMarkerColorForTooltip(d)
29405
29724
  );
29406
29725
  }).on("mouseout", () => hideTooltipOnMouseOut());
29726
+ if (shouldAnimate) {
29727
+ rects.transition().duration(chartFormatOptions.animation.animationDuration).ease(effectsMap[chartFormatOptions.animation.animationEffect]).attr("fill-opacity", 0.7);
29728
+ }
29407
29729
  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);
29408
29730
  if (chartFormatOptions.plotArea.dataLabels) {
29409
29731
  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(
@@ -29564,10 +29886,10 @@ const PieofPie = ({
29564
29886
  try {
29565
29887
  const arc2 = arc$1().innerRadius(0).outerRadius(radius);
29566
29888
  const arcOver = arc$1().innerRadius(0).outerRadius(radius + 10);
29567
- 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(
29889
+ 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(
29568
29890
  "fill",
29569
29891
  (d) => d.data.properties.color !== commonColors.white ? d.data.properties.color : "none"
29570
- ).attr("d", (d) => arc2(d)).on("mouseover.arc", function(d) {
29892
+ ).on("mouseover.arc", function(d) {
29571
29893
  select$2(this).transition().duration(100).attr("d", arcOver);
29572
29894
  }).on("mousemove.text", (d) => {
29573
29895
  showTooltipOnMouseMove(
@@ -29612,14 +29934,25 @@ const PieofPie = ({
29612
29934
  logError$2(fileName$5, "drawPieChart_onClick", error);
29613
29935
  }
29614
29936
  });
29937
+ if (chartFormatOptions.animation.animationEnabled) {
29938
+ paths.transition().duration(chartFormatOptions.animation.animationDuration).ease(effectsMap[chartFormatOptions.animation.animationEffect]).attrTween("d", function(d) {
29939
+ const interpolate2 = interpolate$4(
29940
+ { startAngle: d.startAngle, endAngle: d.startAngle },
29941
+ d
29942
+ );
29943
+ return (t) => arc2(interpolate2(t));
29944
+ });
29945
+ } else {
29946
+ paths.attr("d", (d) => arc2(d));
29947
+ }
29615
29948
  } catch (error) {
29616
29949
  logError$2(fileName$5, "drawPieChart", error);
29617
29950
  }
29618
29951
  };
29619
29952
  const drawChildPie = (childData, rotate2, parentArc) => {
29620
29953
  try {
29621
- chartAreaTagG.select(".parentGroup").transition().attr("transform", `${getParentPiePosition()} rotate(${rotate2})`).duration(1e3);
29622
- chartAreaTagG.selectAll(".parentLabels").transition().attr("transform", `${getParentPiePosition()} rotate(${rotate2})`).duration(1e3);
29954
+ chartAreaTagG.select(".parentGroup").transition().duration(chartFormatOptions.animation.animationDuration).ease(effectsMap[chartFormatOptions.animation.animationEffect]).attr("transform", `${getParentPiePosition()} rotate(${rotate2})`);
29955
+ chartAreaTagG.selectAll(".parentLabels").transition().duration(chartFormatOptions.animation.animationDuration).ease(effectsMap[chartFormatOptions.animation.animationEffect]).attr("transform", `${getParentPiePosition()} rotate(${rotate2})`);
29623
29956
  const childPie = pie().value((d) => d.data[0].value);
29624
29957
  let childPieData = childPie(childData).map((d, i) => ({
29625
29958
  ...d,
@@ -29847,8 +30180,8 @@ const PieofPie = ({
29847
30180
  let radius2 = angleData.y1;
29848
30181
  let y2 = radius2 * Math.sin(arcAngle);
29849
30182
  let x2 = y2 / Math.tan(arcAngle);
29850
- 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);
29851
- 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);
30183
+ 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);
30184
+ 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);
29852
30185
  } catch (error) {
29853
30186
  logError$2(fileName$5, "drawLines", error);
29854
30187
  }
@@ -29880,7 +30213,8 @@ const fileName$4 = "PyramidChart.tsx";
29880
30213
  const PyramidChart = ({
29881
30214
  data,
29882
30215
  formatOptions,
29883
- chartId
30216
+ chartId,
30217
+ onDataLabelCoordinatesChange
29884
30218
  }) => {
29885
30219
  const svgRef = useRef();
29886
30220
  let seriesData = generalizedChartData(data.ChartData);
@@ -29988,7 +30322,8 @@ const PyramidChart = ({
29988
30322
  const bottomWidth = pyramidSide * (inversionConstant - stackHeightArray[i + 1] / pyramidHeight);
29989
30323
  const centerX = innerWidth2 / 2;
29990
30324
  const pyramidContainer = chartAreaTagG.append("g").attr("id", "PyramidChart").attr("class", "parentGroup");
29991
- pyramidContainer.append("polygon").attr("class", "segment").attr("hoverId", d.legend.replace(/\s+/g, "-")).attr(
30325
+ const shouldAnimate = chartFormatOptions.animation.animationEnabled;
30326
+ const polygon = pyramidContainer.append("polygon").attr("class", "segment").attr("hoverId", d.legend.replace(/\s+/g, "-")).attr(
29992
30327
  "points",
29993
30328
  `
29994
30329
  ${centerX - topWidth / 2},${yTop}
@@ -29996,7 +30331,7 @@ const PyramidChart = ({
29996
30331
  ${centerX + bottomWidth / 2},${yBottom}
29997
30332
  ${centerX - bottomWidth / 2},${yBottom}
29998
30333
  `
29999
- ).attr("fill", d.properties.color || "#4cb2ff").on("mousemove", function() {
30334
+ ).attr("fill", d.properties.color || "#4cb2ff").attr("opacity", shouldAnimate ? 0 : 1).on("mousemove", function() {
30000
30335
  try {
30001
30336
  showTooltipOnMouseMove(
30002
30337
  [
@@ -30029,6 +30364,9 @@ const PyramidChart = ({
30029
30364
  logError$2(fileName$4, "drawPyramidChart.onMouseOut", error);
30030
30365
  }
30031
30366
  });
30367
+ if (shouldAnimate) {
30368
+ polygon.transition().duration(chartFormatOptions.animation.animationDuration).ease(effectsMap[chartFormatOptions.animation.animationEffect]).attr("opacity", 1);
30369
+ }
30032
30370
  } catch (error) {
30033
30371
  logError$2(fileName$4, "drawPyramidChart.forEach", error);
30034
30372
  }
@@ -30039,14 +30377,11 @@ const PyramidChart = ({
30039
30377
  };
30040
30378
  const pyramidAnnotations = (oldAnnotationList) => {
30041
30379
  try {
30042
- const self = void 0;
30043
- let AnnotationType = chartFormatOptions.annotation.annotationType ?? "1";
30044
30380
  if (chartFormatOptions.annotation.annotationVisibility) {
30045
- let Disable = [AnnotationType == "1" ? "connector" : ""];
30046
30381
  let makeAnnotations = annotation();
30047
30382
  let ConnectorType = chartFormatOptions.annotation.connectorType ? chartFormatOptions.annotation.connectorType.toLowerCase() : "None";
30048
- let AnnotationsList = annotationsList;
30049
30383
  let finalAnnotationList = annotationsList;
30384
+ const connectorStyleKey = chartFormatOptions.annotation.connectorStyle?.toLowerCase();
30050
30385
  makeAnnotations.editMode(chartFormatOptions.annotation.annotationDraggable).accessors({
30051
30386
  x: function() {
30052
30387
  return innerWidth2 * 0.5;
@@ -30056,13 +30391,29 @@ const PyramidChart = ({
30056
30391
  }
30057
30392
  }).on("dragend", function(annotation2) {
30058
30393
  try {
30394
+ finalAnnotationList.forEach((d) => {
30395
+ if (d.data.legend === annotation2.data.legend) {
30396
+ d.dx = annotation2._dx;
30397
+ d.dy = annotation2._dy;
30398
+ d.width = width;
30399
+ d.height = height;
30400
+ }
30401
+ });
30402
+ if (onDataLabelCoordinatesChange) {
30403
+ onDataLabelCoordinatesChange(
30404
+ finalAnnotationList.map((d) => ({
30405
+ data: { legend: d.data.legend, isVisible: d.data.isVisible ?? true },
30406
+ dx: d.dx,
30407
+ dy: d.dy,
30408
+ width,
30409
+ height
30410
+ }))
30411
+ );
30412
+ }
30059
30413
  annotations.selectAll(".connector").attr("hoverId", (d) => d.data.legend.replace(/\s+/g, "-")).style(
30060
30414
  "stroke",
30061
30415
  chartFormatOptions.annotation.connectorColor || "#ccc"
30062
- ).attr(
30063
- "stroke-dasharray",
30064
- ConnectedStyle[chartFormatOptions.annotation.connectorStyle]
30065
- );
30416
+ ).attr("stroke-dasharray", connectedStyle[connectorStyleKey]);
30066
30417
  annotations.selectAll(`.connector-${ConnectorType}`).attr(
30067
30418
  "fill",
30068
30419
  chartFormatOptions.annotation.connectorColor || "#ccc"
@@ -30073,10 +30424,7 @@ const PyramidChart = ({
30073
30424
  annotations.selectAll(".note-line").attr("hoverId", (d) => d.data.currentLegend.replace(/\s+/g, "-")).style(
30074
30425
  "stroke",
30075
30426
  chartFormatOptions.annotation.connectorColor || "#ccc"
30076
- ).attr(
30077
- "stroke-dasharray",
30078
- ConnectedStyle[chartFormatOptions.annotation.connectorStyle]
30079
- ).filter((d) => d._dx == 0 && d._dy == 0).remove();
30427
+ ).attr("stroke-dasharray", connectedStyle[connectorStyleKey]).filter((d) => d._dx == 0 && d._dy == 0).remove();
30080
30428
  annotations.selectAll(".annotation-note-label").filter((d) => d.data && d.data.isVisible).style("display", "block");
30081
30429
  annotations.selectAll(".annotation-note-title").filter((d) => d.data && d.data.isVisible).style("display", "block");
30082
30430
  } catch (error) {
@@ -30089,10 +30437,7 @@ const PyramidChart = ({
30089
30437
  annotations.selectAll(".connector").style(
30090
30438
  "stroke",
30091
30439
  chartFormatOptions.annotation.connectorColor || "#ccc"
30092
- ).attr(
30093
- "stroke-dasharray",
30094
- ConnectedStyle[chartFormatOptions.annotation.connectorStyle]
30095
- );
30440
+ ).attr("stroke-dasharray", connectedStyle[connectorStyleKey]);
30096
30441
  annotations.selectAll(`.connector-${ConnectorType}`).attr("fill", chartFormatOptions.annotation.connectorColor || "#ccc").style(
30097
30442
  "stroke",
30098
30443
  chartFormatOptions.annotation.connectorColor || "#ccc"
@@ -30100,10 +30445,7 @@ const PyramidChart = ({
30100
30445
  annotations.selectAll(".note-line").style(
30101
30446
  "stroke",
30102
30447
  chartFormatOptions.annotation.connectorColor || "#ccc"
30103
- ).attr(
30104
- "stroke-dasharray",
30105
- ConnectedStyle[chartFormatOptions.annotation.connectorStyle]
30106
- ).filter((d) => d._dx == 0 && d._dy == 0).remove();
30448
+ ).attr("stroke-dasharray", connectedStyle[connectorStyleKey]).filter((d) => d._dx == 0 && d._dy == 0).remove();
30107
30449
  annotations.selectAll(".connector-end").filter((d) => d.connector.end == "dot" && d._dx == 0 && d._dy == 0).remove();
30108
30450
  annotations.selectAll(".annotation-note-label").filter((d) => d.data && !d.data.isVisible).style("display", "none");
30109
30451
  annotations.selectAll(".annotation-note-title").filter((d) => d.data && !d.data.isVisible).style("display", "none");
@@ -30149,7 +30491,12 @@ const PyramidChart = ({
30149
30491
  const prepareNewAnnotationsList = () => {
30150
30492
  try {
30151
30493
  let annotationType = chartFormatOptions.annotation.annotationType ?? "1";
30494
+ let disable = [annotationType == "1" ? "connector" : ""];
30152
30495
  let connectorType = chartFormatOptions.annotation.connectorType ? chartFormatOptions.annotation.connectorType.toLowerCase() : "none";
30496
+ const savedList = JSON.parse(
30497
+ JSON.stringify(chartFormatOptions.plotArea.dataLabelsCoordinates || [])
30498
+ );
30499
+ const oldMap = new Map(savedList.map((d) => [d.data?.legend, d]));
30153
30500
  annotationsList = [];
30154
30501
  seriesData.forEach((d, i) => {
30155
30502
  try {
@@ -30194,6 +30541,7 @@ const PyramidChart = ({
30194
30541
  end: connectorType,
30195
30542
  curve: ConnecterCurve[chartFormatOptions.annotation.connectorCurve]
30196
30543
  },
30544
+ disable,
30197
30545
  subject: {
30198
30546
  height: 15,
30199
30547
  width: 15
@@ -30204,6 +30552,12 @@ const PyramidChart = ({
30204
30552
  width,
30205
30553
  index: i
30206
30554
  };
30555
+ const old = oldMap.get(d.legend);
30556
+ if (old) {
30557
+ singleAnnotation.dx = old.dx * width / (old.width || width);
30558
+ singleAnnotation.dy = old.dy * height / (old.height || height);
30559
+ singleAnnotation.data.isVisible = old.data?.isVisible ?? true;
30560
+ }
30207
30561
  annotationsList.push(singleAnnotation);
30208
30562
  } catch (error) {
30209
30563
  logError$2(fileName$4, "prepareNewAnnotationsList.forEach", error);
@@ -30430,7 +30784,7 @@ const ProgressChart = ({
30430
30784
  }).attr(
30431
30785
  "transform",
30432
30786
  "translate(" + innerWidth2 / 2 + "," + innerHeight2 / 2 + ")"
30433
- ).transition().duration(1e3).attrTween("d", function(d) {
30787
+ ).transition().duration(chartFormatOptions.animation.animationEnabled ? chartFormatOptions.animation.animationDuration : 0).ease(effectsMap[chartFormatOptions.animation.animationEffect]).attrTween("d", function(d) {
30434
30788
  try {
30435
30789
  const interpolate2 = interpolate$4(0, progressAngle);
30436
30790
  return function(t) {
@@ -30838,7 +31192,7 @@ const Speedometer = ({
30838
31192
  }
30839
31193
  let ratio = scale2(newValue);
30840
31194
  let newAngle = config.minAngle + ratio * range2;
30841
- pointer2.transition().duration(config.transitionMs).ease(elasticOut$1).attr("transform", "rotate(" + newAngle + ")");
31195
+ pointer2.transition().duration(chartFormatOptions.animation.animationEnabled ? chartFormatOptions.animation.animationDuration : 0).ease(effectsMap[chartFormatOptions.animation.animationEffect]).attr("transform", "rotate(" + newAngle + ")");
30842
31196
  } catch (error) {
30843
31197
  logError$2(fileName2, "gauge.update", error);
30844
31198
  }
@@ -31255,9 +31609,7 @@ const RadialBarChart = ({
31255
31609
  }).on("mouseout", () => {
31256
31610
  hideTooltipOnMouseOut();
31257
31611
  });
31258
- arcs.transition().delay(
31259
- (d, i) => chartFormatOptions.plotArea.arcTransition ? i * 200 : 0
31260
- ).duration(chartFormatOptions.plotArea.arcTransition ? 500 : 0).attrTween("d", arcTween);
31612
+ arcs.transition().duration(chartFormatOptions.animation.animationEnabled ? chartFormatOptions.animation.animationDuration : 0).ease(effectsMap[chartFormatOptions.animation.animationEffect]).attrTween("d", arcTween);
31261
31613
  if (chartFormatOptions.plotArea.dataLabels) {
31262
31614
  const labelsData = getModifiedDataForLabels(ChartData);
31263
31615
  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(
@@ -31647,11 +31999,11 @@ function requireD3Cloud() {
31647
31999
  return false;
31648
32000
  }
31649
32001
  function cloudBounds(bounds, d) {
31650
- var b0 = bounds[0], b1 = bounds[1];
31651
- if (d.x + d.x0 < b0.x) b0.x = d.x + d.x0;
31652
- if (d.y + d.y0 < b0.y) b0.y = d.y + d.y0;
31653
- if (d.x + d.x1 > b1.x) b1.x = d.x + d.x1;
31654
- if (d.y + d.y1 > b1.y) b1.y = d.y + d.y1;
32002
+ var b02 = bounds[0], b12 = bounds[1];
32003
+ if (d.x + d.x0 < b02.x) b02.x = d.x + d.x0;
32004
+ if (d.y + d.y0 < b02.y) b02.y = d.y + d.y0;
32005
+ if (d.x + d.x1 > b12.x) b12.x = d.x + d.x1;
32006
+ if (d.y + d.y1 > b12.y) b12.y = d.y + d.y1;
31655
32007
  }
31656
32008
  function collideRects(a2, b) {
31657
32009
  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;
@@ -32329,8 +32681,8 @@ function addMissingAreas(areas) {
32329
32681
  pairs[[b, a2]] = true;
32330
32682
  }
32331
32683
  }
32332
- ids.sort(function(a3, b2) {
32333
- return a3 > b2;
32684
+ ids.sort(function(a3, b10) {
32685
+ return a3 > b10;
32334
32686
  });
32335
32687
  for (i = 0; i < ids.length; ++i) {
32336
32688
  a2 = ids[i];
@@ -54374,7 +54726,8 @@ const BubbleChart = ({
54374
54726
  let maxBubbleSize = 30;
54375
54727
  let sizeData = { minimumValue: minMeasure, maximumValue: maxMeasure };
54376
54728
  const circles = chartAreaTagG.append("g").attr("class", "circles").attr("class", "parentGroup");
54377
- circles.append("g").selectAll(".bubbleScatter").data(data).enter().append("g").attr(
54729
+ const shouldAnimate = chartFormatOptions.animation.animationEnabled;
54730
+ const bubblePaths = circles.append("g").selectAll(".bubbleScatter").data(data).enter().append("g").attr(
54378
54731
  "hoverId",
54379
54732
  (d) => d.legendName.replace(/ /g, "-")
54380
54733
  ).attr(
@@ -54397,7 +54750,7 @@ const BubbleChart = ({
54397
54750
  );
54398
54751
  }).attr("transform", function(d) {
54399
54752
  return `translate(${xScale(d.dimension)}, ${yScale(d.measure)})`;
54400
- }).attr("opacity", chartFormatOptions.plotArea.fillOpacity).style(
54753
+ }).attr("opacity", shouldAnimate ? 0 : chartFormatOptions.plotArea.fillOpacity).style(
54401
54754
  "visibility",
54402
54755
  (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"
54403
54756
  ).on("mousemove", (event2, d) => {
@@ -54427,6 +54780,9 @@ const BubbleChart = ({
54427
54780
  }).on("mouseout", () => {
54428
54781
  hideTooltipOnMouseOut();
54429
54782
  });
54783
+ if (shouldAnimate) {
54784
+ bubblePaths.transition().duration(chartFormatOptions.animation.animationDuration).ease(effectsMap[chartFormatOptions.animation.animationEffect]).attr("opacity", chartFormatOptions.plotArea.fillOpacity);
54785
+ }
54430
54786
  } catch (e) {
54431
54787
  logError$2("BubbleChart", "initCircles", e);
54432
54788
  }
@@ -54824,7 +55180,8 @@ const ScatterChart = ({
54824
55180
  return Shape == "Square" ? square : Shape == "Circle" ? circle : Shape == "Cross" ? cross : Shape == "Triangle" ? triangle : Shape == "Star" ? star : Shape == "Diamond" ? diamond : Shape == "Wye" ? wye : circle;
54825
55181
  };
54826
55182
  const circles = chartAreaTagG.append("g").attr("class", "circles").attr("class", "parentGroup");
54827
- circles.append("g").selectAll(".bubbleScatter").data(data).enter().append("g").attr("fill", (d) => d.selectedColor).attr(
55183
+ const shouldAnimate = chartFormatOptions.animation.animationEnabled;
55184
+ const scatterPaths = circles.append("g").selectAll(".bubbleScatter").data(data).enter().append("g").attr("fill", (d) => d.selectedColor).attr(
54828
55185
  "colorId",
54829
55186
  (d) => d.legendName.includes("-") ? d.legendName.split("-")[0].replace(/ /g, "-") : d.legendName.replace(/ /g, "-")
54830
55187
  ).attr(
@@ -54841,7 +55198,7 @@ const ScatterChart = ({
54841
55198
  );
54842
55199
  }).attr("transform", function(d) {
54843
55200
  return `translate(${xScale(d.dimension)}, ${yScale(d.measure)})`;
54844
- }).attr("opacity", chartFormatOptions.plotArea.fillOpacity).style(
55201
+ }).attr("opacity", shouldAnimate ? 0 : chartFormatOptions.plotArea.fillOpacity).style(
54845
55202
  "visibility",
54846
55203
  (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"
54847
55204
  ).on("mousemove", (event2, d) => {
@@ -54871,6 +55228,9 @@ const ScatterChart = ({
54871
55228
  }).on("mouseout", () => {
54872
55229
  hideTooltipOnMouseOut();
54873
55230
  });
55231
+ if (shouldAnimate) {
55232
+ scatterPaths.transition().duration(chartFormatOptions.animation.animationDuration).ease(effectsMap[chartFormatOptions.animation.animationEffect]).attr("opacity", chartFormatOptions.plotArea.fillOpacity);
55233
+ }
54874
55234
  } catch (e) {
54875
55235
  logError$2(fileName, "initCircles", e);
54876
55236
  }
@@ -55710,6 +56070,7 @@ const WaterfallChart = ({
55710
56070
  (d) => d,
55711
56071
  (d) => d.key || d.Key
55712
56072
  );
56073
+ const shouldAnimate = formatOptions.animation.animationEnabled;
55713
56074
  const rectsEnter = rects.enter().append("rect").attr("class", "rect").attr(
55714
56075
  "class",
55715
56076
  (d) => d.key ? d.key.replace(/ /g, "-") : d.Key.replace(/ /g, "-")
@@ -55718,10 +56079,7 @@ const WaterfallChart = ({
55718
56079
  (d) => xScale(
55719
56080
  !isAdvancedWaterfall ? d.data.dimension || d.data.legend : d.data.xKey
55720
56081
  )
55721
- ).attr("y", (d) => d[1] ? yScaleLeft(d[1]) : 0).attr("clip-path", `url(#${chartId}-clip)`).attr(
55722
- "height",
55723
- (d) => d[1] ? yScaleLeft(d[0]) - yScaleLeft(d[1]) : 0
55724
- ).attr("width", xScale.bandwidth()).attr(
56082
+ ).attr("y", yScaleLeft(0) ?? 0).attr("clip-path", `url(#${chartId}-clip)`).attr("height", 0).attr("width", xScale.bandwidth()).attr(
55725
56083
  "visibility",
55726
56084
  (d) => k2 === 0 && d.data.dimension && stackTotalData ? "hidden" : "visible"
55727
56085
  ).style("shape-rendering", "crispEdges").on("mousemove", (event2, d) => {
@@ -55753,6 +56111,8 @@ const WaterfallChart = ({
55753
56111
  }).on("mouseout", () => {
55754
56112
  hideTooltipOnMouseOut();
55755
56113
  });
56114
+ const finalRects = shouldAnimate ? rectsEnter.transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]) : rectsEnter;
56115
+ finalRects.attr("y", (d) => d[1] ? yScaleLeft(d[1]) : 0).attr("height", (d) => d[1] ? yScaleLeft(d[0]) - yScaleLeft(d[1]) : 0);
55756
56116
  rects.exit().remove();
55757
56117
  rects = rectsEnter.merge(rects);
55758
56118
  if (formatOptions.plotArea.plotAreaDataLabel == "2" && k2 != 1) {
@@ -56396,7 +56756,8 @@ const TornadoChart = ({
56396
56756
  const positiveBarColor = formatOptions.plotArea.plotAreaCalculatedHigh;
56397
56757
  const negativeBarColor = formatOptions.plotArea.plotAreaCalculatedLow;
56398
56758
  const parent = gTag.append("g").attr("class", "parentGroup");
56399
- parent.selectAll("rect").data(
56759
+ const shouldAnimate = formatOptions.animation.animationEnabled;
56760
+ const bars = parent.selectAll("rect").data(
56400
56761
  filteredData.flatMap(
56401
56762
  (d) => d.data.map((child) => ({
56402
56763
  ...child,
@@ -56407,7 +56768,7 @@ const TornadoChart = ({
56407
56768
  ).enter().append("rect").attr("class", "rect").attr(
56408
56769
  "y",
56409
56770
  (d) => (d.legendText ? yScaleLeft(d.legendText) : yScaleLeft(chartTypes.TornadoDefaultEntry)) - columnWidth / 2
56410
- ).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(
56771
+ ).attr("height", columnWidth).attr("x", xScale(0)).attr("width", 0).style("shape-rendering", "crispEdges").attr(
56411
56772
  "stroke-dasharray",
56412
56773
  (d) => d.properties.stackBorderStyle == 2 ? "5,3" : "0"
56413
56774
  ).attr("stroke-width", (d) => `${d.properties.stackBorderWidth}px`).attr(
@@ -56443,6 +56804,8 @@ const TornadoChart = ({
56443
56804
  !data.IsCalCSensitivity ? d.properties : d.properties.legend === "Calculated Low(-ve)" ? { markerColor: formatOptions.plotArea.plotAreaCalculatedLow } : { markerColor: formatOptions.plotArea.plotAreaCalculatedHigh }
56444
56805
  );
56445
56806
  }).on("mouseout", hideTooltipOnMouseOut);
56807
+ const finalBars = shouldAnimate ? bars.transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]) : bars;
56808
+ finalBars.attr("x", (d) => d.value >= 0 ? xScale(0) : xScale(d.value)).attr("width", (d) => Math.abs(xScale(d.value) - xScale(0)));
56446
56809
  };
56447
56810
  const setSVGContainer = (margin2) => {
56448
56811
  innerWidth2 = width - margin2.left - margin2.right;
@@ -56987,14 +57350,16 @@ const DotPlot = ({
56987
57350
  ).merge(column);
56988
57351
  let columnGroups = column.selectAll(".column-group").data(data2.data, (d) => d.dimension);
56989
57352
  let columnGroupsEnter = columnGroups.enter().append("g").attr("class", "column-group");
56990
- columnGroupsEnter.append("path").attr("class", "cleveland-dot").merge(columnGroups.select("path")).attr(
57353
+ const shouldAnimate = formatOptions.animation.animationEnabled;
57354
+ const enteringDots = columnGroupsEnter.append("path").attr("class", "cleveland-dot").attr("opacity", shouldAnimate ? 0 : 0.9);
57355
+ enteringDots.merge(columnGroups.select("path")).attr(
56991
57356
  "d",
56992
57357
  (d) => Symbol$1().type(Markershapes(d.markerShape)).size((d.markerSize || 6) * 70)()
56993
57358
  ).attr("transform", (d) => {
56994
57359
  const x2 = xScaleBottom(d.value);
56995
57360
  const y2 = yScale(d.dimension);
56996
57361
  return `translate(${x2},${y2})`;
56997
- }).attr("fill", (d) => data2.properties.color).attr("opacity", 0.9).attr(
57362
+ }).attr("fill", (d) => data2.properties.color).attr(
56998
57363
  "visibility",
56999
57364
  () => formatOptions.marker?.markerVisibility ? "visible" : "hidden"
57000
57365
  ).on("mousemove", (event2, d) => {
@@ -57027,6 +57392,9 @@ const DotPlot = ({
57027
57392
  selectAll(".halo").remove();
57028
57393
  hideTooltipOnMouseOut();
57029
57394
  });
57395
+ if (shouldAnimate) {
57396
+ enteringDots.transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]).attr("opacity", 0.9);
57397
+ }
57030
57398
  columnGroups.exit().remove();
57031
57399
  });
57032
57400
  gTag.selectAll(".parentGroup").raise();
@@ -57356,11 +57724,11 @@ function getBorderDash(lineStyle) {
57356
57724
  return [];
57357
57725
  }
57358
57726
  function transformToChartJSData(chartData, chartType, formatOptions, colorBank = CJS_DEFAULT_COLORS) {
57359
- const { ChartData: seriesList, DimensionList } = chartData;
57727
+ const { ChartData: seriesList, DimensionList, LegendList } = chartData;
57360
57728
  const labels = DimensionList?.length ? DimensionList : seriesList[0]?.data?.map((d) => d.dimension) ?? [];
57361
57729
  const fillOpacity = Number(formatOptions.plotArea?.fillOpacity ?? 0.8);
57362
57730
  if (chartType === "pie" || chartType === "doughnut" || chartType === "polarArea") {
57363
- return buildCircularData(seriesList, labels, fillOpacity, colorBank);
57731
+ return buildCircularData(seriesList, labels, fillOpacity, colorBank, LegendList);
57364
57732
  }
57365
57733
  if (chartType === "scatter") {
57366
57734
  return buildScatterData(seriesList, colorBank);
@@ -57421,16 +57789,17 @@ function buildCartesianData(seriesList, labels, chartType, formatOptions, fillOp
57421
57789
  });
57422
57790
  return { labels, datasets };
57423
57791
  }
57424
- function buildCircularData(seriesList, labels, fillOpacity, colorBank) {
57792
+ function buildCircularData(seriesList, labels, fillOpacity, colorBank, legendList) {
57425
57793
  const allSeries = seriesList.length ? seriesList : [];
57426
57794
  const datasets = allSeries.map((series) => {
57427
57795
  const values = labels.map((lbl) => {
57428
57796
  const pt = series.data?.find((d) => d.dimension === lbl);
57429
57797
  return pt?.value ?? 0;
57430
57798
  });
57431
- const backgroundColors = labels.map(
57432
- (_, i) => hexToRgba(colorBank[i % colorBank.length], fillOpacity)
57433
- );
57799
+ const backgroundColors = labels.map((_, i) => {
57800
+ const legendColor = legendList?.[i]?.color;
57801
+ return hexToRgba(legendColor ?? colorBank[i % colorBank.length], fillOpacity);
57802
+ });
57434
57803
  return {
57435
57804
  label: series.properties.alias,
57436
57805
  data: values,
@@ -57567,17 +57936,8 @@ function mapFormatOptionsToChartJS(formatOptions, chartType, hasSecondaryAxis =
57567
57936
  maintainAspectRatio: false,
57568
57937
  plugins: {
57569
57938
  // ---- Title ----
57570
- title: {
57571
- display: formatOptions.chartTitle?.chartTitleVisibility ?? true,
57572
- text: formatOptions.chartTitle?.dynamicTitleText || formatOptions.chartTitle?.chartTitleText || "",
57573
- color: formatOptions.chartTitle?.chartTitleColor ?? "#000000",
57574
- font: {
57575
- size: parseInt(formatOptions.chartTitle?.chartTitleFontSize ?? "15", 10),
57576
- family: formatOptions.chartTitle?.chartTitleFontFamily ?? "Helvetica",
57577
- style: getFontStyle(formatOptions.chartTitle?.chartTitleFontStyle),
57578
- weight: getFontWeight(formatOptions.chartTitle?.chartTitleFontStyle)
57579
- }
57580
- },
57939
+ // Title is rendered as a separate DOM element in ChartJSWrapper
57940
+ title: { display: false },
57581
57941
  // ---- Legend ----
57582
57942
  legend: {
57583
57943
  display: formatOptions.legends?.legendVisibility !== false && formatOptions.legends?.legendPosition !== "None",
@@ -57607,9 +57967,10 @@ function mapFormatOptionsToChartJS(formatOptions, chartType, hasSecondaryAxis =
57607
57967
  callbacks: {
57608
57968
  label(ctx) {
57609
57969
  const value2 = typeof ctx.raw === "number" ? ctx.raw : ctx.raw?.y ?? 0;
57610
- const formatted = formatValueForAxis(
57970
+ const formatted = getNumberWithFormat(
57611
57971
  value2,
57612
57972
  formatOptions.toolTip?.toolTipDisplayUnits ?? "None",
57973
+ formatOptions.toolTip?.toolTipNumberFormat ?? ",",
57613
57974
  formatOptions.toolTip?.toolTipDecimalPrecision ?? "2"
57614
57975
  );
57615
57976
  return ` ${ctx.dataset.label}: ${formatted}`;
@@ -57620,13 +57981,13 @@ function mapFormatOptionsToChartJS(formatOptions, chartType, hasSecondaryAxis =
57620
57981
  // This block is only active when chartjs-plugin-datalabels is registered in ChartJSWrapper.
57621
57982
  datalabels: buildDataLabelsConfig(formatOptions, chartType)
57622
57983
  },
57623
- animation: formatOptions.cjsOptions?.cjsAnimationEnabled === true ? {
57624
- duration: formatOptions.cjsOptions?.cjsAnimationDuration ?? 1e3
57984
+ animation: formatOptions.animation?.animationEnabled === true ? {
57985
+ duration: formatOptions.animation?.animationDuration ?? 1e3
57625
57986
  } : false
57626
57987
  };
57627
57988
  if (!isCircular) {
57628
57989
  const xScaleOptions = {
57629
- display: formatOptions.xAxisLabel?.xAxisLabelVisibility !== false,
57990
+ display: true,
57630
57991
  title: {
57631
57992
  display: formatOptions.xAxisTitle?.xAxisTitleVisibility !== false,
57632
57993
  text: formatOptions.xAxisTitle?.xAxisTitleText ?? "Dimension",
@@ -57638,14 +57999,16 @@ function mapFormatOptionsToChartJS(formatOptions, chartType, hasSecondaryAxis =
57638
57999
  }
57639
58000
  },
57640
58001
  ticks: {
58002
+ display: formatOptions.xAxisLabel?.xAxisLabelVisibility !== false,
57641
58003
  color: formatOptions.xAxisLabel?.xAxisLabelColor ?? "#000000",
57642
58004
  font: {
57643
58005
  size: parseInt(formatOptions.xAxisLabel?.xAxisLabelFontSize ?? "11", 10),
57644
58006
  family: formatOptions.xAxisLabel?.xAxisLabelFontFamily ?? "Helvetica",
57645
- style: getFontStyle(formatOptions.xAxisLabel?.xAxisLabelFontStyle)
58007
+ style: getFontStyle(formatOptions.xAxisLabel?.xAxisLabelFontStyle),
58008
+ weight: getFontWeight(formatOptions.xAxisLabel?.xAxisLabelFontStyle)
57646
58009
  },
57647
- maxRotation: isHorizontal ? 0 : formatOptions.xAxisLabel?.xAxisLabelRotation ?? 0,
57648
- minRotation: 0
58010
+ maxRotation: formatOptions.xAxisLabel?.xAxisLabelRotation ?? 0,
58011
+ minRotation: formatOptions.xAxisLabel?.xAxisLabelRotation ?? 0
57649
58012
  },
57650
58013
  grid: {
57651
58014
  display: formatOptions.plotArea?.gridLinesVisibility !== false && formatOptions.plotArea?.gridLinesVertical !== false,
@@ -57657,7 +58020,7 @@ function mapFormatOptionsToChartJS(formatOptions, chartType, hasSecondaryAxis =
57657
58020
  }
57658
58021
  };
57659
58022
  const yScaleOptions = {
57660
- display: formatOptions.yAxisLabel?.yAxisLabelVisibility !== false,
58023
+ display: true,
57661
58024
  position: "left",
57662
58025
  title: {
57663
58026
  display: formatOptions.yAxisTitle?.yAxisTitleVisibility !== false,
@@ -57670,11 +58033,13 @@ function mapFormatOptionsToChartJS(formatOptions, chartType, hasSecondaryAxis =
57670
58033
  }
57671
58034
  },
57672
58035
  ticks: {
58036
+ display: formatOptions.yAxisLabel?.yAxisLabelVisibility !== false,
57673
58037
  color: formatOptions.yAxisLabel?.yAxisLabelColor ?? "#000000",
57674
58038
  font: {
57675
58039
  size: parseInt(formatOptions.yAxisLabel?.yAxisLabelFontSize ?? "11", 10),
57676
58040
  family: formatOptions.yAxisLabel?.yAxisLabelFontFamily ?? "Helvetica",
57677
- style: getFontStyle(formatOptions.yAxisLabel?.yAxisLabelFontStyle)
58041
+ style: getFontStyle(formatOptions.yAxisLabel?.yAxisLabelFontStyle),
58042
+ weight: getFontWeight(formatOptions.yAxisLabel?.yAxisLabelFontStyle)
57678
58043
  },
57679
58044
  callback(value2) {
57680
58045
  return formatValueForAxis(
@@ -57689,7 +58054,7 @@ function mapFormatOptionsToChartJS(formatOptions, chartType, hasSecondaryAxis =
57689
58054
  color: gridColor
57690
58055
  },
57691
58056
  border: {
57692
- color: formatOptions.yAxisLabel?.yAxisColorInverted ?? "#cccccc",
58057
+ color: formatOptions.yAxisLabel?.yAxisColor ?? "#cccccc",
57693
58058
  width: parseFloat(formatOptions.yAxisLabel?.yAxisWidth ?? "0.5")
57694
58059
  }
57695
58060
  };
@@ -57709,7 +58074,7 @@ function mapFormatOptionsToChartJS(formatOptions, chartType, hasSecondaryAxis =
57709
58074
  }
57710
58075
  if (hasSecondaryAxis) {
57711
58076
  opts.scales.y1 = {
57712
- display: formatOptions.secondaryYAxisLabel?.secondaryYAxisLabelVisibility !== false,
58077
+ display: true,
57713
58078
  position: "right",
57714
58079
  title: {
57715
58080
  display: formatOptions.secondaryYAxisTitle?.secondaryYAxisTitleVisibility !== false,
@@ -57721,9 +58086,13 @@ function mapFormatOptionsToChartJS(formatOptions, chartType, hasSecondaryAxis =
57721
58086
  }
57722
58087
  },
57723
58088
  ticks: {
58089
+ display: formatOptions.secondaryYAxisLabel?.secondaryYAxisLabelVisibility !== false,
57724
58090
  color: formatOptions.secondaryYAxisLabel?.secondaryYAxisLabelColor ?? "#000000",
57725
58091
  font: {
57726
- size: parseInt(formatOptions.secondaryYAxisLabel?.secondaryYAxisLabelFontSize ?? "11", 10)
58092
+ size: parseInt(formatOptions.secondaryYAxisLabel?.secondaryYAxisLabelFontSize ?? "11", 10),
58093
+ family: formatOptions.secondaryYAxisLabel?.secondaryYAxisLabelFontFamily ?? "Helvetica",
58094
+ style: getFontStyle(formatOptions.secondaryYAxisLabel?.secondaryYAxisLabelFontStyle),
58095
+ weight: getFontWeight(formatOptions.secondaryYAxisLabel?.secondaryYAxisLabelFontStyle)
57727
58096
  },
57728
58097
  callback(value2) {
57729
58098
  return formatValueForAxis(
@@ -57733,7 +58102,11 @@ function mapFormatOptionsToChartJS(formatOptions, chartType, hasSecondaryAxis =
57733
58102
  );
57734
58103
  }
57735
58104
  },
57736
- grid: { drawOnChartArea: false }
58105
+ grid: { drawOnChartArea: false },
58106
+ border: {
58107
+ color: formatOptions.secondaryYAxisLabel?.secondaryYAxisColor ?? "#000000",
58108
+ width: parseFloat(formatOptions.secondaryYAxisLabel?.secondaryYAxisWidth ?? "0.5")
58109
+ }
57737
58110
  };
57738
58111
  }
57739
58112
  const isStacked2 = chartType.toLowerCase().includes("stack");
@@ -57755,6 +58128,7 @@ function getRawValue(raw) {
57755
58128
  function buildDataLabelsConfig(formatOptions, chartType = "bar") {
57756
58129
  const annotation2 = formatOptions.annotation;
57757
58130
  const isCircular = chartType === "pie" || chartType === "doughnut" || chartType === "polarArea";
58131
+ const isHorizontal = chartType === "horizontalBar";
57758
58132
  const visibilityStr = annotation2?.annotationVisibility ?? "5";
57759
58133
  if (visibilityStr === "5" || !visibilityStr) {
57760
58134
  return { display: false };
@@ -57766,7 +58140,8 @@ function buildDataLabelsConfig(formatOptions, chartType = "bar") {
57766
58140
  const fontStyle = getFontStyle(annotation2?.annotationFontStyle);
57767
58141
  const fontWeight = getFontWeight(annotation2?.annotationFontStyle);
57768
58142
  const labelColor = annotation2?.annotationColor ?? "#000000";
57769
- const decimalPrecision = parseInt(annotation2?.annotationDecimalPrecision ?? "2", 10);
58143
+ const useSeriesColor = annotation2?.annotationSetLabelColor === "2";
58144
+ const decimalPrecision = annotation2?.annotationDecimalPrecision ?? "2";
57770
58145
  const numberFormat = annotation2?.annotationNumberFormat ?? ",";
57771
58146
  const displayUnits = annotation2?.annotationDisplayUnits ?? "None";
57772
58147
  function display(ctx) {
@@ -57816,14 +58191,25 @@ function buildDataLabelsConfig(formatOptions, chartType = "bar") {
57816
58191
  return positionStr === "2" ? "center" : "end";
57817
58192
  }
57818
58193
  const v = getCtxValue(ctx);
58194
+ if (isHorizontal) {
58195
+ switch (positionStr) {
58196
+ case "2":
58197
+ return "center";
58198
+ case "3":
58199
+ return "right";
58200
+ // baseline side → point into bar (rightward from zero for pos, rightward toward zero for neg)
58201
+ case "1":
58202
+ case "4":
58203
+ default:
58204
+ return v < 0 ? "left" : "right";
58205
+ }
58206
+ }
57819
58207
  switch (positionStr) {
57820
58208
  case "2":
57821
58209
  return "center";
57822
58210
  case "3":
57823
58211
  return v > 0 ? "top" : "bottom";
57824
- // always upward — inside bar in both cases:
57825
- // positive: above zero = inside bar base
57826
- // negative: above extreme = toward zero = inside bar
58212
+ // inside bar near baseline
57827
58213
  case "1":
57828
58214
  case "4":
57829
58215
  default:
@@ -57833,23 +58219,7 @@ function buildDataLabelsConfig(formatOptions, chartType = "bar") {
57833
58219
  function formatter2(raw, ctx) {
57834
58220
  const v = getRawValue(raw);
57835
58221
  if (hideZero && v === 0) return null;
57836
- let scaled = v;
57837
- if (displayUnits === "Thousands") scaled = v / 1e3;
57838
- else if (displayUnits === "Millions") scaled = v / 1e6;
57839
- else if (displayUnits === "Billions") scaled = v / 1e9;
57840
- let formattedValue;
57841
- if (numberFormat === ",.0%") {
57842
- formattedValue = (scaled / 100).toLocaleString(void 0, {
57843
- style: "percent",
57844
- minimumFractionDigits: decimalPrecision,
57845
- maximumFractionDigits: decimalPrecision
57846
- });
57847
- } else {
57848
- formattedValue = scaled.toLocaleString(void 0, {
57849
- minimumFractionDigits: decimalPrecision,
57850
- maximumFractionDigits: decimalPrecision
57851
- });
57852
- }
58222
+ const formattedValue = getNumberWithFormat(v, displayUnits, numberFormat, decimalPrecision);
57853
58223
  if (isCircular) {
57854
58224
  const label = ctx?.chart?.data?.labels?.[ctx.dataIndex] ?? "";
57855
58225
  return label ? `${label}
@@ -57862,7 +58232,12 @@ ${formattedValue}` : formattedValue;
57862
58232
  anchor,
57863
58233
  align,
57864
58234
  offset: isCircular ? positionStr === "2" ? 0 : 8 : positionStr === "2" ? 0 : 4,
57865
- color: labelColor,
58235
+ color: useSeriesColor ? (ctx) => {
58236
+ const bg = ctx.dataset?.backgroundColor;
58237
+ const border = ctx.dataset?.borderColor;
58238
+ const c2 = Array.isArray(bg) ? bg[ctx.dataIndex] : bg;
58239
+ return typeof c2 === "string" && c2 ? c2 : typeof border === "string" && border ? border : labelColor;
58240
+ } : labelColor,
57866
58241
  font: {
57867
58242
  size: fontSize,
57868
58243
  family: fontFamily,
@@ -62104,8 +62479,8 @@ function parseArrayOrPrimitive(meta, data, start2, count2) {
62104
62479
  }
62105
62480
  return parsed;
62106
62481
  }
62107
- function isFloatBar(custom13) {
62108
- return custom13 && custom13.barStart !== void 0 && custom13.barEnd !== void 0;
62482
+ function isFloatBar(custom16) {
62483
+ return custom16 && custom16.barStart !== void 0 && custom16.barEnd !== void 0;
62109
62484
  }
62110
62485
  function barSign(size, vScale, actualBase) {
62111
62486
  if (size !== 0) {
@@ -62247,10 +62622,10 @@ class BarController extends DatasetController {
62247
62622
  }
62248
62623
  updateRangeFromParsed(range2, scale2, parsed, stack2) {
62249
62624
  super.updateRangeFromParsed(range2, scale2, parsed, stack2);
62250
- const custom13 = parsed._custom;
62251
- if (custom13 && scale2 === this._cachedMeta.vScale) {
62252
- range2.min = Math.min(range2.min, custom13.min);
62253
- range2.max = Math.max(range2.max, custom13.max);
62625
+ const custom16 = parsed._custom;
62626
+ if (custom16 && scale2 === this._cachedMeta.vScale) {
62627
+ range2.min = Math.min(range2.min, custom16.min);
62628
+ range2.max = Math.max(range2.max, custom16.max);
62254
62629
  }
62255
62630
  }
62256
62631
  getMaxOverflow() {
@@ -62260,8 +62635,8 @@ class BarController extends DatasetController {
62260
62635
  const meta = this._cachedMeta;
62261
62636
  const { iScale, vScale } = meta;
62262
62637
  const parsed = this.getParsed(index2);
62263
- const custom13 = parsed._custom;
62264
- const value2 = isFloatBar(custom13) ? "[" + custom13.start + ", " + custom13.end + "]" : "" + vScale.getLabelForValue(parsed[vScale.axis]);
62638
+ const custom16 = parsed._custom;
62639
+ const value2 = isFloatBar(custom16) ? "[" + custom16.start + ", " + custom16.end + "]" : "" + vScale.getLabelForValue(parsed[vScale.axis]);
62265
62640
  return {
62266
62641
  label: "" + iScale.getLabelForValue(parsed[iScale.axis]),
62267
62642
  value: value2
@@ -62390,8 +62765,8 @@ class BarController extends DatasetController {
62390
62765
  const { _cachedMeta: { vScale, _stacked, index: datasetIndex }, options: { base: baseValue, minBarLength } } = this;
62391
62766
  const actualBase = baseValue || 0;
62392
62767
  const parsed = this.getParsed(index2);
62393
- const custom13 = parsed._custom;
62394
- const floating = isFloatBar(custom13);
62768
+ const custom16 = parsed._custom;
62769
+ const floating = isFloatBar(custom16);
62395
62770
  let value2 = parsed[vScale.axis];
62396
62771
  let start2 = 0;
62397
62772
  let length = _stacked ? this.applyStack(vScale, parsed, _stacked) : value2;
@@ -62401,9 +62776,9 @@ class BarController extends DatasetController {
62401
62776
  length = value2;
62402
62777
  }
62403
62778
  if (floating) {
62404
- value2 = custom13.barStart;
62405
- length = custom13.barEnd - custom13.barStart;
62406
- if (value2 !== 0 && sign(value2) !== sign(custom13.barEnd)) {
62779
+ value2 = custom16.barStart;
62780
+ length = custom16.barEnd - custom16.barStart;
62781
+ if (value2 !== 0 && sign(value2) !== sign(custom16.barEnd)) {
62407
62782
  start2 = 0;
62408
62783
  }
62409
62784
  start2 += value2;
@@ -72925,7 +73300,13 @@ const ChartJSWrapper = ({
72925
73300
  };
72926
73301
  }, [chartType, data, options, isChartStacked]);
72927
73302
  const bgColor = formatOptions.chartArea?.chartAreaColor ?? "#ffffff";
72928
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
73303
+ const titleFontStyle = Array.isArray(formatOptions.chartTitle?.chartTitleFontStyle) ? formatOptions.chartTitle.chartTitleFontStyle : [];
73304
+ const titleColor = formatOptions.chartTitle?.chartTitleColor && formatOptions.chartTitle.chartTitleColor !== "#ffffff" && formatOptions.chartTitle.chartTitleColor !== "#FFFFFF00" ? formatOptions.chartTitle.chartTitleColor : "rgba(119,119,119)";
73305
+ const titleFontSize = formatOptions.chartTitle?.chartTitleFontSize ? `${formatOptions.chartTitle.chartTitleFontSize}px` : "16px";
73306
+ const titleText = formatOptions.chartTitle?.dynamicTitleText || formatOptions.chartTitle?.chartTitleText || "";
73307
+ const titleHTML = formatOptions.chartTitle?.chartTitleHTML || titleText;
73308
+ const titleVisible = formatOptions.chartTitle?.chartTitleVisibility !== false;
73309
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(
72929
73310
  "div",
72930
73311
  {
72931
73312
  className,
@@ -72933,9 +73314,37 @@ const ChartJSWrapper = ({
72933
73314
  width: "100%",
72934
73315
  height: "100%",
72935
73316
  backgroundColor: bgColor,
72936
- position: "relative"
73317
+ position: "relative",
73318
+ display: "flex",
73319
+ flexDirection: "column"
72937
73320
  },
72938
- children: /* @__PURE__ */ jsxRuntimeExports.jsx("canvas", { ref: canvasRef })
73321
+ children: [
73322
+ titleVisible && titleText && /* @__PURE__ */ jsxRuntimeExports.jsx(
73323
+ "div",
73324
+ {
73325
+ id: "chartTitleId",
73326
+ className: "chartTiltle",
73327
+ title: formatOptions.chartTitle?.chartTitleText,
73328
+ style: {
73329
+ color: titleColor,
73330
+ fontSize: titleFontSize,
73331
+ fontFamily: formatOptions.chartTitle?.chartTitleFontFamily,
73332
+ fontStyle: titleFontStyle.includes("Italic") ? "italic" : "normal",
73333
+ fontWeight: titleFontStyle.includes("Bold") ? "bold" : "normal",
73334
+ textDecoration: titleFontStyle.includes("Underline") ? "underline" : "none",
73335
+ whiteSpace: "pre",
73336
+ textOverflow: "ellipsis",
73337
+ overflow: "hidden",
73338
+ lineHeight: "1.3em",
73339
+ userSelect: "none",
73340
+ padding: "2px 4px",
73341
+ flexShrink: 0
73342
+ },
73343
+ dangerouslySetInnerHTML: { __html: titleHTML }
73344
+ }
73345
+ ),
73346
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { flex: 1, minHeight: 0 }, children: /* @__PURE__ */ jsxRuntimeExports.jsx("canvas", { ref: canvasRef, style: { width: "100%", height: "100%" } }) })
73347
+ ]
72939
73348
  }
72940
73349
  );
72941
73350
  };