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.
|
@@ -2395,7 +2395,7 @@
|
|
|
2395
2395
|
}
|
|
2396
2396
|
}));
|
|
2397
2397
|
const constant$9 = (x2) => () => x2;
|
|
2398
|
-
function linear$
|
|
2398
|
+
function linear$3(a2, d) {
|
|
2399
2399
|
return function(t) {
|
|
2400
2400
|
return a2 + t * d;
|
|
2401
2401
|
};
|
|
@@ -2412,7 +2412,7 @@
|
|
|
2412
2412
|
}
|
|
2413
2413
|
function nogamma$1(a2, b) {
|
|
2414
2414
|
var d = b - a2;
|
|
2415
|
-
return d ? linear$
|
|
2415
|
+
return d ? linear$3(a2, d) : constant$9(isNaN(a2) ? b : a2);
|
|
2416
2416
|
}
|
|
2417
2417
|
const interpolateRgb$1 = (function rgbGamma(y2) {
|
|
2418
2418
|
var color2 = gamma$1(y2);
|
|
@@ -2637,7 +2637,7 @@
|
|
|
2637
2637
|
];
|
|
2638
2638
|
};
|
|
2639
2639
|
} else {
|
|
2640
|
-
var d1 = Math.sqrt(d2),
|
|
2640
|
+
var d1 = Math.sqrt(d2), b02 = (w1 * w1 - w0 * w0 + rho4 * d2) / (2 * w0 * rho2 * d1), b12 = (w1 * w1 - w0 * w0 - rho4 * d2) / (2 * w1 * rho2 * d1), r0 = Math.log(Math.sqrt(b02 * b02 + 1) - b02), r1 = Math.log(Math.sqrt(b12 * b12 + 1) - b12);
|
|
2641
2641
|
S = (r1 - r0) / rho;
|
|
2642
2642
|
i = function(t) {
|
|
2643
2643
|
var s2 = t * S, coshr0 = cosh(r0), u = w0 / (rho2 * d1) * (coshr0 * tanh(rho * s2 + r0) - sinh(r0));
|
|
@@ -3361,12 +3361,48 @@
|
|
|
3361
3361
|
end: transition_end$1,
|
|
3362
3362
|
[Symbol.iterator]: selection_prototype$1[Symbol.iterator]
|
|
3363
3363
|
};
|
|
3364
|
+
const linear$2 = (t) => +t;
|
|
3365
|
+
function cubicIn(t) {
|
|
3366
|
+
return t * t * t;
|
|
3367
|
+
}
|
|
3368
|
+
function cubicOut(t) {
|
|
3369
|
+
return --t * t * t + 1;
|
|
3370
|
+
}
|
|
3364
3371
|
function cubicInOut$1(t) {
|
|
3365
3372
|
return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2;
|
|
3366
3373
|
}
|
|
3367
3374
|
function tpmt(x2) {
|
|
3368
3375
|
return (Math.pow(2, -10 * x2) - 9765625e-10) * 1.0009775171065494;
|
|
3369
3376
|
}
|
|
3377
|
+
var b1 = 4 / 11, b2 = 6 / 11, b3 = 8 / 11, b4 = 3 / 4, b5 = 9 / 11, b6 = 10 / 11, b7 = 15 / 16, b8 = 21 / 22, b9 = 63 / 64, b0 = 1 / b1 / b1;
|
|
3378
|
+
function bounceOut(t) {
|
|
3379
|
+
return (t = +t) < b1 ? b0 * t * t : t < b3 ? b0 * (t -= b2) * t + b4 : t < b6 ? b0 * (t -= b5) * t + b7 : b0 * (t -= b8) * t + b9;
|
|
3380
|
+
}
|
|
3381
|
+
var overshoot = 1.70158;
|
|
3382
|
+
(function custom(s2) {
|
|
3383
|
+
s2 = +s2;
|
|
3384
|
+
function backIn(t) {
|
|
3385
|
+
return (t = +t) * t * (s2 * (t - 1) + t);
|
|
3386
|
+
}
|
|
3387
|
+
backIn.overshoot = custom;
|
|
3388
|
+
return backIn;
|
|
3389
|
+
})(overshoot);
|
|
3390
|
+
var backOut = (function custom(s2) {
|
|
3391
|
+
s2 = +s2;
|
|
3392
|
+
function backOut2(t) {
|
|
3393
|
+
return --t * t * ((t + 1) * s2 + t) + 1;
|
|
3394
|
+
}
|
|
3395
|
+
backOut2.overshoot = custom;
|
|
3396
|
+
return backOut2;
|
|
3397
|
+
})(overshoot);
|
|
3398
|
+
(function custom(s2) {
|
|
3399
|
+
s2 = +s2;
|
|
3400
|
+
function backInOut(t) {
|
|
3401
|
+
return ((t *= 2) < 1 ? t * t * ((s2 + 1) * t - s2) : (t -= 2) * t * ((s2 + 1) * t + s2) + 2) / 2;
|
|
3402
|
+
}
|
|
3403
|
+
backInOut.overshoot = custom;
|
|
3404
|
+
return backInOut;
|
|
3405
|
+
})(overshoot);
|
|
3370
3406
|
var tau$5 = 2 * Math.PI, amplitude = 1, period = 0.3;
|
|
3371
3407
|
(function custom(a2, p) {
|
|
3372
3408
|
var s2 = Math.asin(1 / (a2 = Math.max(1, a2))) * (p /= tau$5);
|
|
@@ -4397,12 +4433,12 @@
|
|
|
4397
4433
|
function polygonInside() {
|
|
4398
4434
|
var winding = 0;
|
|
4399
4435
|
for (var i = 0, n = polygon.length; i < n; ++i) {
|
|
4400
|
-
for (var ring2 = polygon[i], j = 1, m = ring2.length, point3 = ring2[0], a0, a1,
|
|
4401
|
-
a0 =
|
|
4436
|
+
for (var ring2 = polygon[i], j = 1, m = ring2.length, point3 = ring2[0], a0, a1, b02 = point3[0], b12 = point3[1]; j < m; ++j) {
|
|
4437
|
+
a0 = b02, a1 = b12, point3 = ring2[j], b02 = point3[0], b12 = point3[1];
|
|
4402
4438
|
if (a1 <= y12) {
|
|
4403
|
-
if (
|
|
4439
|
+
if (b12 > y12 && (b02 - a0) * (y12 - a1) > (b12 - a1) * (x02 - a0)) ++winding;
|
|
4404
4440
|
} else {
|
|
4405
|
-
if (
|
|
4441
|
+
if (b12 <= y12 && (b02 - a0) * (y12 - a1) < (b12 - a1) * (x02 - a0)) --winding;
|
|
4406
4442
|
}
|
|
4407
4443
|
}
|
|
4408
4444
|
}
|
|
@@ -4876,19 +4912,19 @@
|
|
|
4876
4912
|
});
|
|
4877
4913
|
}
|
|
4878
4914
|
function resample$1(project, delta2) {
|
|
4879
|
-
function resampleLineTo(x02, y02, lambda0, a0,
|
|
4915
|
+
function resampleLineTo(x02, y02, lambda0, a0, b02, c0, x12, y12, lambda1, a1, b12, c1, depth, stream) {
|
|
4880
4916
|
var dx = x12 - x02, dy = y12 - y02, d2 = dx * dx + dy * dy;
|
|
4881
4917
|
if (d2 > 4 * delta2 && depth--) {
|
|
4882
|
-
var a2 = a0 + a1, b =
|
|
4883
|
-
if (dz * dz / d2 > delta2 || abs$1((dx * dx2 + dy * dy2) / d2 - 0.5) > 0.3 || a0 * a1 +
|
|
4884
|
-
resampleLineTo(x02, y02, lambda0, a0,
|
|
4918
|
+
var a2 = a0 + a1, b = b02 + b12, c2 = c0 + c1, m = sqrt$1(a2 * a2 + b * b + c2 * c2), phi2 = asin$2(c2 /= m), lambda2 = abs$1(abs$1(c2) - 1) < epsilon$3 || abs$1(lambda0 - lambda1) < epsilon$3 ? (lambda0 + lambda1) / 2 : atan2$1(b, a2), p = project(lambda2, phi2), x2 = p[0], y2 = p[1], dx2 = x2 - x02, dy2 = y2 - y02, dz = dy * dx2 - dx * dy2;
|
|
4919
|
+
if (dz * dz / d2 > delta2 || abs$1((dx * dx2 + dy * dy2) / d2 - 0.5) > 0.3 || a0 * a1 + b02 * b12 + c0 * c1 < cosMinDistance) {
|
|
4920
|
+
resampleLineTo(x02, y02, lambda0, a0, b02, c0, x2, y2, lambda2, a2 /= m, b /= m, c2, depth, stream);
|
|
4885
4921
|
stream.point(x2, y2);
|
|
4886
|
-
resampleLineTo(x2, y2, lambda2, a2, b, c2, x12, y12, lambda1, a1,
|
|
4922
|
+
resampleLineTo(x2, y2, lambda2, a2, b, c2, x12, y12, lambda1, a1, b12, c1, depth, stream);
|
|
4887
4923
|
}
|
|
4888
4924
|
}
|
|
4889
4925
|
}
|
|
4890
4926
|
return function(stream) {
|
|
4891
|
-
var lambda00, x002, y002, a00, b00, c00, lambda0, x02, y02, a0,
|
|
4927
|
+
var lambda00, x002, y002, a00, b00, c00, lambda0, x02, y02, a0, b02, c0;
|
|
4892
4928
|
var resampleStream = {
|
|
4893
4929
|
point: point2,
|
|
4894
4930
|
lineStart,
|
|
@@ -4913,7 +4949,7 @@
|
|
|
4913
4949
|
}
|
|
4914
4950
|
function linePoint(lambda, phi2) {
|
|
4915
4951
|
var c2 = cartesian([lambda, phi2]), p = project(lambda, phi2);
|
|
4916
|
-
resampleLineTo(x02, y02, lambda0, a0,
|
|
4952
|
+
resampleLineTo(x02, y02, lambda0, a0, b02, c0, x02 = p[0], y02 = p[1], lambda0 = lambda, a0 = c2[0], b02 = c2[1], c0 = c2[2], maxDepth, stream);
|
|
4917
4953
|
stream.point(x02, y02);
|
|
4918
4954
|
}
|
|
4919
4955
|
function lineEnd() {
|
|
@@ -4926,11 +4962,11 @@
|
|
|
4926
4962
|
resampleStream.lineEnd = ringEnd;
|
|
4927
4963
|
}
|
|
4928
4964
|
function ringPoint(lambda, phi2) {
|
|
4929
|
-
linePoint(lambda00 = lambda, phi2), x002 = x02, y002 = y02, a00 = a0, b00 =
|
|
4965
|
+
linePoint(lambda00 = lambda, phi2), x002 = x02, y002 = y02, a00 = a0, b00 = b02, c00 = c0;
|
|
4930
4966
|
resampleStream.point = linePoint;
|
|
4931
4967
|
}
|
|
4932
4968
|
function ringEnd() {
|
|
4933
|
-
resampleLineTo(x02, y02, lambda0, a0,
|
|
4969
|
+
resampleLineTo(x02, y02, lambda0, a0, b02, c0, x002, y002, lambda00, a00, b00, c00, maxDepth, stream);
|
|
4934
4970
|
resampleStream.lineEnd = lineEnd;
|
|
4935
4971
|
lineEnd();
|
|
4936
4972
|
}
|
|
@@ -10835,11 +10871,6 @@
|
|
|
10835
10871
|
4: d3CalloutElbow,
|
|
10836
10872
|
5: d3CalloutCurve
|
|
10837
10873
|
};
|
|
10838
|
-
const ConnectedStyle = {
|
|
10839
|
-
"solid": "unset",
|
|
10840
|
-
"Dotted": "2",
|
|
10841
|
-
"Dashed": "7"
|
|
10842
|
-
};
|
|
10843
10874
|
var staticLegendPosition = /* @__PURE__ */ ((staticLegendPosition2) => {
|
|
10844
10875
|
staticLegendPosition2["left"] = "Left";
|
|
10845
10876
|
staticLegendPosition2["right"] = "Right";
|
|
@@ -10952,6 +10983,15 @@
|
|
|
10952
10983
|
waterfallKeys2["down"] = "down";
|
|
10953
10984
|
return waterfallKeys2;
|
|
10954
10985
|
})(waterfallKeys || {});
|
|
10986
|
+
const effectsMap = {
|
|
10987
|
+
"easeLinear": linear$2,
|
|
10988
|
+
"easeCubicIn": cubicIn,
|
|
10989
|
+
"easeCubicOut": cubicOut,
|
|
10990
|
+
"easeCubicInOut": cubicInOut$1,
|
|
10991
|
+
"easeBounceOut": bounceOut,
|
|
10992
|
+
"easeElasticOut": elasticOut$1,
|
|
10993
|
+
"easeBackOut": backOut
|
|
10994
|
+
};
|
|
10955
10995
|
const defaultChartFormatOptions = {
|
|
10956
10996
|
chartDescription: {
|
|
10957
10997
|
chartDescriptionVisibility: false,
|
|
@@ -11554,6 +11594,20 @@
|
|
|
11554
11594
|
chartPadding: {
|
|
11555
11595
|
paddingArrayLTRB: [0, 0, 0, 0]
|
|
11556
11596
|
// left, top, right, bottom
|
|
11597
|
+
},
|
|
11598
|
+
statisticalTest: {
|
|
11599
|
+
zTest: false,
|
|
11600
|
+
runZTest: [],
|
|
11601
|
+
zTestInputData: []
|
|
11602
|
+
},
|
|
11603
|
+
cjsOptions: {
|
|
11604
|
+
cjsTension: 0,
|
|
11605
|
+
cjsBorderRadius: 0
|
|
11606
|
+
},
|
|
11607
|
+
animation: {
|
|
11608
|
+
animationEnabled: false,
|
|
11609
|
+
animationDuration: 1500,
|
|
11610
|
+
animationEffect: "easeCubicOut"
|
|
11557
11611
|
}
|
|
11558
11612
|
};
|
|
11559
11613
|
const chartMargins = {
|
|
@@ -13069,10 +13123,20 @@
|
|
|
13069
13123
|
}
|
|
13070
13124
|
function getSlicedLegendForTornado(legend) {
|
|
13071
13125
|
const index2 = legend.indexOf(" - ");
|
|
13072
|
-
if (index2 == -1) return
|
|
13126
|
+
if (index2 == -1) return tornadoEntryName.default;
|
|
13073
13127
|
return legend.slice(index2 + 3);
|
|
13074
13128
|
}
|
|
13075
13129
|
const getHoverText = (d, isAATornado) => isAATornado ? d?.legend?.split(" - ")[0] : d?.properties?.alias || d?.properties?.name || "Legend";
|
|
13130
|
+
function getCurvePoints(dx, dy) {
|
|
13131
|
+
return [
|
|
13132
|
+
[0, 0],
|
|
13133
|
+
// start (anchor)
|
|
13134
|
+
[dx / 2, dy / 2],
|
|
13135
|
+
// control (curve bend)
|
|
13136
|
+
[dx, dy]
|
|
13137
|
+
// end (label)
|
|
13138
|
+
];
|
|
13139
|
+
}
|
|
13076
13140
|
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) {
|
|
13077
13141
|
try {
|
|
13078
13142
|
const isTornadoChart = chartType === chartTypes.TornadoChart;
|
|
@@ -13080,6 +13144,7 @@
|
|
|
13080
13144
|
let annotationType = formatOptions.annotation.annotationType ?? "1";
|
|
13081
13145
|
let annotationPosition = formatOptions.annotation.annotationPosition.toString() != "4" ? formatOptions.annotation.annotationPosition : null;
|
|
13082
13146
|
let dataLabelColor = formatOptions?.annotation?.annotationSetLabelColor == "2" ? "color" : "labelColor";
|
|
13147
|
+
const isCurve = formatOptions.annotation.connectorType?.toLowerCase() === "curve";
|
|
13083
13148
|
if (formatOptions.annotation.annotationVisibility) {
|
|
13084
13149
|
let Disable = [annotationType == "1" ? "connector" : ""];
|
|
13085
13150
|
let labelData = [];
|
|
@@ -13310,7 +13375,8 @@
|
|
|
13310
13375
|
dy: 0,
|
|
13311
13376
|
connector: {
|
|
13312
13377
|
end: connectorType,
|
|
13313
|
-
curve: connecterCurve[formatOptions.annotation.connectorCurve]
|
|
13378
|
+
curve: connecterCurve[formatOptions.annotation.connectorCurve],
|
|
13379
|
+
points: isCurve ? getCurvePoints(0, 0) : [[0, 0], [0, 0]]
|
|
13314
13380
|
},
|
|
13315
13381
|
disable: Disable,
|
|
13316
13382
|
subject: {
|
|
@@ -13368,12 +13434,10 @@
|
|
|
13368
13434
|
newAnnotation.dx = old.dx;
|
|
13369
13435
|
newAnnotation.dy = old.dy;
|
|
13370
13436
|
newAnnotation.data.isVisible = old.isVisible ?? true;
|
|
13371
|
-
|
|
13372
|
-
|
|
13373
|
-
|
|
13374
|
-
|
|
13375
|
-
[0, 0]
|
|
13376
|
-
];
|
|
13437
|
+
if (old?.connectorPoints && old.connectorPoints.length >= (isCurve ? 3 : 2)) {
|
|
13438
|
+
newAnnotation.connector.points = old.connectorPoints;
|
|
13439
|
+
} else {
|
|
13440
|
+
newAnnotation.connector.points = isCurve ? getCurvePoints(newAnnotation.dx, newAnnotation.dy) : [[0, 0], [0, 0]];
|
|
13377
13441
|
}
|
|
13378
13442
|
}
|
|
13379
13443
|
}
|
|
@@ -13436,7 +13500,7 @@
|
|
|
13436
13500
|
if (d.data?.legendUniqueId == annotation2.data.legendUniqueId || d.legendUniqueId == annotation2.data.legendUniqueId) {
|
|
13437
13501
|
d.dx = annotation2._dx * width / d.width;
|
|
13438
13502
|
d.dy = annotation2._dy * height / d.height;
|
|
13439
|
-
d.connectorPoints = annotation2.connector
|
|
13503
|
+
d.connectorPoints = annotation2.connector?.points?.map((p) => [...p]) || [];
|
|
13440
13504
|
}
|
|
13441
13505
|
});
|
|
13442
13506
|
if (onDataLabelCoordinatesChange) {
|
|
@@ -13492,6 +13556,21 @@
|
|
|
13492
13556
|
connectorType,
|
|
13493
13557
|
barChart
|
|
13494
13558
|
);
|
|
13559
|
+
if (formatOptions.animation?.animationEnabled) {
|
|
13560
|
+
const duration = formatOptions.animation.animationDuration;
|
|
13561
|
+
const ease = effectsMap[formatOptions.animation.animationEffect];
|
|
13562
|
+
const accessors = makeAnnotations.accessors();
|
|
13563
|
+
annotations.selectAll(".annotation").attr("transform", function(d) {
|
|
13564
|
+
const x2 = accessors.x(d.data);
|
|
13565
|
+
const yScale = d.data?.y?.axis === axisTypes.primary ? yScaleLeft : yScaleRight;
|
|
13566
|
+
const startY = yScale(0);
|
|
13567
|
+
return `translate(${x2}, ${startY})`;
|
|
13568
|
+
}).transition().duration(duration).ease(ease).attr("transform", function(d) {
|
|
13569
|
+
const x2 = accessors.x(d.data);
|
|
13570
|
+
const y2 = accessors.y(d.data);
|
|
13571
|
+
return `translate(${x2}, ${y2})`;
|
|
13572
|
+
});
|
|
13573
|
+
}
|
|
13495
13574
|
}
|
|
13496
13575
|
} catch (error) {
|
|
13497
13576
|
throw error;
|
|
@@ -13511,6 +13590,7 @@
|
|
|
13511
13590
|
let stackData = [];
|
|
13512
13591
|
let getChartType = [];
|
|
13513
13592
|
let connectorType = formatOptions.annotation.connectorType ? formatOptions.annotation.connectorType.toLowerCase() : "None";
|
|
13593
|
+
const isCurve = formatOptions.annotation.connectorType?.toLowerCase() === "curve";
|
|
13514
13594
|
let oldAnnotationList = JSON.parse(JSON.stringify(formatOptions.plotArea.dataLabelsCoordinates));
|
|
13515
13595
|
oldAnnotationList = conditionallyResetOldAnnotations(oldAnnotationList, formatOptions, chartTypes.CustomColumnChart);
|
|
13516
13596
|
let annotationsList = [];
|
|
@@ -13842,7 +13922,8 @@
|
|
|
13842
13922
|
dy: 0,
|
|
13843
13923
|
connector: {
|
|
13844
13924
|
end: connectorType,
|
|
13845
|
-
curve: connecterCurve[formatOptions.annotation.connectorCurve]
|
|
13925
|
+
curve: connecterCurve[formatOptions.annotation.connectorCurve],
|
|
13926
|
+
points: isCurve ? getCurvePoints(0, 0) : [[0, 0], [0, 0]]
|
|
13846
13927
|
},
|
|
13847
13928
|
disable: Disable,
|
|
13848
13929
|
subject: {
|
|
@@ -13864,6 +13945,9 @@
|
|
|
13864
13945
|
!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
|
|
13865
13946
|
);
|
|
13866
13947
|
});
|
|
13948
|
+
if (formatOptions.annotation.annotationHideZeroValues) {
|
|
13949
|
+
annotationsList = annotationsList.filter((d) => d.data.y !== 0);
|
|
13950
|
+
}
|
|
13867
13951
|
if (oldAnnotationList.length === 0) {
|
|
13868
13952
|
oldAnnotationList = annotationsList;
|
|
13869
13953
|
oldMap = new Map(
|
|
@@ -13898,7 +13982,11 @@
|
|
|
13898
13982
|
newAnnotation.dx = old.dx;
|
|
13899
13983
|
newAnnotation.dy = old.dy;
|
|
13900
13984
|
newAnnotation.data.isVisible = old.isVisible ?? true;
|
|
13901
|
-
|
|
13985
|
+
if (old?.connectorPoints && old.connectorPoints.length >= (isCurve ? 3 : 2)) {
|
|
13986
|
+
newAnnotation.connector.points = old.connectorPoints;
|
|
13987
|
+
} else {
|
|
13988
|
+
newAnnotation.connector.points = isCurve ? getCurvePoints(newAnnotation.dx, newAnnotation.dy) : [[0, 0], [0, 0]];
|
|
13989
|
+
}
|
|
13902
13990
|
if (formatOptions.annotation.annotationType == "5" && newAnnotation.dx == 0 && newAnnotation.dy == 0) {
|
|
13903
13991
|
newAnnotation.connector["points"] = [
|
|
13904
13992
|
[0, 0],
|
|
@@ -13952,7 +14040,7 @@
|
|
|
13952
14040
|
if (d.data?.legendUniqueId == annotation2.data.legendUniqueId || d.legendUniqueId == annotation2.data.legendUniqueId) {
|
|
13953
14041
|
d.dx = annotation2._dx * width / d.width;
|
|
13954
14042
|
d.dy = annotation2._dy * height / d.height;
|
|
13955
|
-
d.connectorPoints = annotation2.connector
|
|
14043
|
+
d.connectorPoints = annotation2.connector?.points?.map((p) => [...p]) || [];
|
|
13956
14044
|
}
|
|
13957
14045
|
});
|
|
13958
14046
|
if (onDataLabelCoordinatesChange) {
|
|
@@ -13988,6 +14076,28 @@
|
|
|
13988
14076
|
}).notePadding(0).annotations(finalAnnotationList);
|
|
13989
14077
|
if (!formatOptions.plotArea.fitChart) svg.selectAll(".annotation-group").remove();
|
|
13990
14078
|
let annotations = appendAnnotations(svg, formatOptions, margin, fontStyle, makeAnnotations, connectorType, false);
|
|
14079
|
+
if (formatOptions.animation?.animationEnabled) {
|
|
14080
|
+
const duration = formatOptions.animation.animationDuration;
|
|
14081
|
+
const ease = effectsMap[formatOptions.animation.animationEffect];
|
|
14082
|
+
const accessors = makeAnnotations.accessors();
|
|
14083
|
+
annotations.selectAll(".annotation").attr("transform", function(d) {
|
|
14084
|
+
const x2 = accessors.x(d.data);
|
|
14085
|
+
const chartType = d.data.type || d.type;
|
|
14086
|
+
const axis2 = d.data?.x?.axis || d.data?.axis;
|
|
14087
|
+
const yScale = axis2 === axisTypes.primary ? yScaleLeft : yScaleRight;
|
|
14088
|
+
let startY;
|
|
14089
|
+
if (chartType === chartTypes.StackColumnChart || chartType === chartTypes.StackAreaChart) {
|
|
14090
|
+
startY = yScale(d.data.prevValue ?? 0);
|
|
14091
|
+
} else {
|
|
14092
|
+
startY = yScale(0);
|
|
14093
|
+
}
|
|
14094
|
+
return `translate(${x2}, ${startY})`;
|
|
14095
|
+
}).transition().duration(duration).ease(ease).attr("transform", function(d) {
|
|
14096
|
+
const x2 = accessors.x(d.data);
|
|
14097
|
+
const y2 = accessors.y(d.data);
|
|
14098
|
+
return `translate(${x2}, ${y2})`;
|
|
14099
|
+
});
|
|
14100
|
+
}
|
|
13991
14101
|
}
|
|
13992
14102
|
} catch (error) {
|
|
13993
14103
|
throw error;
|
|
@@ -15172,6 +15282,7 @@
|
|
|
15172
15282
|
let dataLabelColor = formatOptions?.annotation?.annotationSetLabelColor == "2" ? "color" : "labelColor";
|
|
15173
15283
|
let fontStyle = formatOptions.annotation.annotationFontStyle;
|
|
15174
15284
|
let connectorType = formatOptions.annotation.connectorType ? formatOptions.annotation.connectorType.toLowerCase() : "None";
|
|
15285
|
+
const isCurve = formatOptions.annotation.connectorType?.toLowerCase() === "curve";
|
|
15175
15286
|
let oldAnnotationList = JSON.parse(JSON.stringify(formatOptions.plotArea.dataLabelsCoordinates));
|
|
15176
15287
|
oldAnnotationList = conditionallyResetOldAnnotations(oldAnnotationList, formatOptions, chartType);
|
|
15177
15288
|
let annotationsList = [];
|
|
@@ -15276,7 +15387,8 @@
|
|
|
15276
15387
|
dy: 0,
|
|
15277
15388
|
connector: {
|
|
15278
15389
|
end: connectorType,
|
|
15279
|
-
curve: connecterCurve[formatOptions.annotation.connectorCurve]
|
|
15390
|
+
curve: connecterCurve[formatOptions.annotation.connectorCurve],
|
|
15391
|
+
points: isCurve ? getCurvePoints(0, 0) : [[0, 0], [0, 0]]
|
|
15280
15392
|
},
|
|
15281
15393
|
disable: Disable,
|
|
15282
15394
|
subject: {
|
|
@@ -15326,12 +15438,10 @@
|
|
|
15326
15438
|
newAnnotation.dx = old.dx;
|
|
15327
15439
|
newAnnotation.dy = old.dy;
|
|
15328
15440
|
newAnnotation.data.isVisible = old.isVisible ?? true;
|
|
15329
|
-
|
|
15330
|
-
|
|
15331
|
-
|
|
15332
|
-
|
|
15333
|
-
[0, 0]
|
|
15334
|
-
];
|
|
15441
|
+
if (old?.connectorPoints && old.connectorPoints.length >= (isCurve ? 3 : 2)) {
|
|
15442
|
+
newAnnotation.connector.points = old.connectorPoints;
|
|
15443
|
+
} else {
|
|
15444
|
+
newAnnotation.connector.points = isCurve ? getCurvePoints(newAnnotation.dx, newAnnotation.dy) : [[0, 0], [0, 0]];
|
|
15335
15445
|
}
|
|
15336
15446
|
}
|
|
15337
15447
|
}
|
|
@@ -15367,7 +15477,7 @@
|
|
|
15367
15477
|
if (d.data?.legendUniqueId == annotation2.data.legendUniqueId || d.legendUniqueId == annotation2.data.legendUniqueId) {
|
|
15368
15478
|
d.dx = annotation2._dx * width / d.width;
|
|
15369
15479
|
d.dy = annotation2._dy * height / d.height;
|
|
15370
|
-
d.connectorPoints = annotation2.connector
|
|
15480
|
+
d.connectorPoints = annotation2.connector?.points?.map((p) => [...p]) || [];
|
|
15371
15481
|
}
|
|
15372
15482
|
});
|
|
15373
15483
|
if (onDataLabelCoordinatesChange) {
|
|
@@ -15403,6 +15513,21 @@
|
|
|
15403
15513
|
}).notePadding(0).annotations(finalAnnotationList);
|
|
15404
15514
|
if (true) svg.selectAll(".annotation-group").remove();
|
|
15405
15515
|
let annotations = appendAnnotations(svg, formatOptions, margin, fontStyle, makeAnnotations, connectorType, barChart);
|
|
15516
|
+
if (formatOptions.animation?.animationEnabled) {
|
|
15517
|
+
const duration = formatOptions.animation.animationDuration;
|
|
15518
|
+
const ease = effectsMap[formatOptions.animation.animationEffect];
|
|
15519
|
+
const accessors = makeAnnotations.accessors();
|
|
15520
|
+
annotations.selectAll(".annotation").attr("transform", function(d) {
|
|
15521
|
+
const x2 = accessors.x(d.data);
|
|
15522
|
+
const yScale = d.data?.y?.axis === axisTypes.primary ? yScaleLeft : yScaleRight;
|
|
15523
|
+
const startY = yScale ? yScale(0) : 0;
|
|
15524
|
+
return `translate(${x2}, ${startY})`;
|
|
15525
|
+
}).transition().duration(duration).ease(ease).attr("transform", function(d) {
|
|
15526
|
+
const x2 = accessors.x(d.data);
|
|
15527
|
+
const y2 = accessors.y(d.data);
|
|
15528
|
+
return `translate(${x2}, ${y2})`;
|
|
15529
|
+
});
|
|
15530
|
+
}
|
|
15406
15531
|
}
|
|
15407
15532
|
} catch (error) {
|
|
15408
15533
|
throw error;
|
|
@@ -16146,7 +16271,7 @@
|
|
|
16146
16271
|
const group2 = select$2(this);
|
|
16147
16272
|
let markers = group2.selectAll("path").data(groupData.data);
|
|
16148
16273
|
let markersEnter = markers.enter().append("path").attr("fill", (d) => d.markerColor);
|
|
16149
|
-
markersEnter.merge(markers).attr("d", (d) => {
|
|
16274
|
+
const mergedMarkers = markersEnter.merge(markers).attr("d", (d) => {
|
|
16150
16275
|
return Symbol$1().type(Markershapes(d.markerShape)).size(d.markerSize * 50)();
|
|
16151
16276
|
}).attr("visibility", (d) => {
|
|
16152
16277
|
const hideByX = !xScale(d.dimension) && xScale(d.dimension) !== 0;
|
|
@@ -16214,6 +16339,26 @@
|
|
|
16214
16339
|
return `translate(${x2},${y2}) scale(1)`;
|
|
16215
16340
|
});
|
|
16216
16341
|
});
|
|
16342
|
+
if (formatOptions.animation.animationEnabled) {
|
|
16343
|
+
const duration = formatOptions.animation.animationDuration;
|
|
16344
|
+
const ease = effectsMap[formatOptions.animation.animationEffect] ?? linear$2;
|
|
16345
|
+
const xRange = xScale.range();
|
|
16346
|
+
const xRangeMin = Math.min(xRange[0], xRange[1]);
|
|
16347
|
+
const xRangeSpan = Math.max(xRange[0], xRange[1]) - xRangeMin;
|
|
16348
|
+
const invertEase = (progress, steps = 100) => {
|
|
16349
|
+
for (let i = 0; i <= steps; i++) {
|
|
16350
|
+
const t = i / steps;
|
|
16351
|
+
if (ease(t) >= progress) return t;
|
|
16352
|
+
}
|
|
16353
|
+
return 1;
|
|
16354
|
+
};
|
|
16355
|
+
mergedMarkers.attr("opacity", 0).each(function(d) {
|
|
16356
|
+
const x2 = xScale(d.dimension) ?? xRangeMin;
|
|
16357
|
+
const fraction = xRangeSpan > 0 ? Math.max(0, Math.min(1, (x2 - xRangeMin) / xRangeSpan)) : 0;
|
|
16358
|
+
const delay = invertEase(fraction) * duration;
|
|
16359
|
+
select$2(this).transition().delay(delay).duration(0).attr("opacity", 1);
|
|
16360
|
+
});
|
|
16361
|
+
}
|
|
16217
16362
|
});
|
|
16218
16363
|
} catch (error) {
|
|
16219
16364
|
logError$2(fileName$b, "lineMarkers", error);
|
|
@@ -17620,7 +17765,7 @@
|
|
|
17620
17765
|
"visibility",
|
|
17621
17766
|
(d) => d.value === 0 && formatOptions.xAxisLabel.hideZeroValues ? "hidden" : "visible"
|
|
17622
17767
|
);
|
|
17623
|
-
const finalBars = bars;
|
|
17768
|
+
const finalBars = formatOptions.animation.animationEnabled ? bars.transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]) : bars;
|
|
17624
17769
|
finalBars.attr("y", (d) => {
|
|
17625
17770
|
const yScale = data2.properties.axis === axisTypes.primary ? yScaleLeft : yScaleRight;
|
|
17626
17771
|
return d.value > 0 ? yScale(d.value) : yScale(0);
|
|
@@ -17698,6 +17843,7 @@
|
|
|
17698
17843
|
filteredDimension,
|
|
17699
17844
|
xScale
|
|
17700
17845
|
);
|
|
17846
|
+
getChartType(filteredData);
|
|
17701
17847
|
commonAnnotations(
|
|
17702
17848
|
seriesData,
|
|
17703
17849
|
xScale,
|
|
@@ -17749,7 +17895,6 @@
|
|
|
17749
17895
|
margin,
|
|
17750
17896
|
innerHeight2
|
|
17751
17897
|
);
|
|
17752
|
-
getChartType(filteredData);
|
|
17753
17898
|
};
|
|
17754
17899
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
17755
17900
|
"svg",
|
|
@@ -17832,6 +17977,7 @@
|
|
|
17832
17977
|
let requiredData = [];
|
|
17833
17978
|
let scrollPosition = 0;
|
|
17834
17979
|
let visibleBars;
|
|
17980
|
+
let annotationTimeoutId;
|
|
17835
17981
|
let chartJSON = {
|
|
17836
17982
|
dimensionList,
|
|
17837
17983
|
chartType,
|
|
@@ -18337,13 +18483,10 @@
|
|
|
18337
18483
|
"transform",
|
|
18338
18484
|
(d) => `translate(${xScale(d.dimension) - columnWidth / 2}, 0)`
|
|
18339
18485
|
);
|
|
18340
|
-
columnGroupsEnter.append("rect").attr("x", (d) => xScaleForLegends(d.legendUniqueId)).attr("width", xScaleForLegends.bandwidth()).attr("y", (d) => {
|
|
18486
|
+
const bars = columnGroupsEnter.append("rect").attr("x", (d) => xScaleForLegends(d.legendUniqueId)).attr("width", xScaleForLegends.bandwidth()).attr("y", (d) => {
|
|
18341
18487
|
const yScale = data2.properties.axis === axisTypes.primary ? yScaleLeft : yScaleRight;
|
|
18342
|
-
return
|
|
18343
|
-
}).attr("height", (d) => {
|
|
18344
|
-
const yScale = data2.properties.axis === axisTypes.primary ? yScaleLeft : yScaleRight;
|
|
18345
|
-
return Math.abs(yScale(d.value) - yScale(0));
|
|
18346
|
-
}).attr("fill", data2.properties.color).attr("stroke-dasharray", (d) => data2.properties.stackBorderStyle == 2 ? "5,3" : "0").attr("stroke-width", (d) => `${data2.properties.stackBorderWidth}px`).attr(
|
|
18488
|
+
return yScale(0);
|
|
18489
|
+
}).attr("height", 0).attr("fill", data2.properties.color).attr("stroke-dasharray", (d) => data2.properties.stackBorderStyle == 2 ? "5,3" : "0").attr("stroke-width", (d) => `${data2.properties.stackBorderWidth}px`).attr(
|
|
18347
18490
|
"stroke",
|
|
18348
18491
|
(d) => data2.properties.stackBorderStyle == 0 ? "none" : formatOptions.column.stackBorderVisibility ? data2.properties.stackBorderColor : "none"
|
|
18349
18492
|
).style("clip-path", "inset(0px) fill-box").style("shape-rendering", "crispEdges").attr(
|
|
@@ -18381,6 +18524,14 @@
|
|
|
18381
18524
|
seriesData.filter((e) => e.legend === d.legend)[0].properties
|
|
18382
18525
|
);
|
|
18383
18526
|
}).on("mouseout", hideTooltipOnMouseOut);
|
|
18527
|
+
const finalBars = formatOptions.animation.animationEnabled ? bars.transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]) : bars;
|
|
18528
|
+
finalBars.attr("y", (d) => {
|
|
18529
|
+
const yScale = data2.properties.axis === axisTypes.primary ? yScaleLeft : yScaleRight;
|
|
18530
|
+
return d.value > 0 ? yScale(d.value) : yScale(0);
|
|
18531
|
+
}).attr("height", (d) => {
|
|
18532
|
+
const yScale = data2.properties.axis === axisTypes.primary ? yScaleLeft : yScaleRight;
|
|
18533
|
+
return Math.abs(yScale(d.value) - yScale(0));
|
|
18534
|
+
});
|
|
18384
18535
|
columnGroups.exit().remove();
|
|
18385
18536
|
};
|
|
18386
18537
|
const drawLineChart = (lineData) => {
|
|
@@ -18426,6 +18577,14 @@
|
|
|
18426
18577
|
"stroke-width",
|
|
18427
18578
|
(d) => d.properties.lineStyle !== "None" ? d.properties.lineWidth : "0"
|
|
18428
18579
|
);
|
|
18580
|
+
if (formatOptions.animation.animationEnabled) {
|
|
18581
|
+
lineGroupsEnter.merge(lineGroups).select("path").each(function() {
|
|
18582
|
+
const path2 = select$2(this);
|
|
18583
|
+
const totalLength = this.getTotalLength();
|
|
18584
|
+
path2.attr("stroke-dasharray", totalLength + " " + totalLength).attr("stroke-dashoffset", totalLength);
|
|
18585
|
+
path2.transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]).attr("stroke-dashoffset", 0);
|
|
18586
|
+
});
|
|
18587
|
+
}
|
|
18429
18588
|
lineGroups.exit().remove();
|
|
18430
18589
|
lineMarkers(
|
|
18431
18590
|
lines,
|
|
@@ -18466,6 +18625,10 @@
|
|
|
18466
18625
|
)
|
|
18467
18626
|
// : yScaleRight((d as TDataPoint).value)
|
|
18468
18627
|
).defined((d) => d.hideZero ? Boolean(d.value) : true).curve(getCurveType(formatOptions));
|
|
18628
|
+
const areaGeneratorStart = area().x(
|
|
18629
|
+
(d) => xScale(d.dimension) ? xScale(d.dimension) : null
|
|
18630
|
+
).y0(() => yScaleLeft(0)).y1(() => yScaleLeft(0)).defined((d) => d.hideZero ? Boolean(d.value) : true).curve(getCurveType(formatOptions));
|
|
18631
|
+
const enableAreaTransition = formatOptions.animation.animationEnabled;
|
|
18469
18632
|
let areas = gTag.selectAll(".areas.parentGroup").data([1]);
|
|
18470
18633
|
let focus = gTag.append("g").attr("class", "focusClass");
|
|
18471
18634
|
areas = areas.enter().append("g").attr("class", "areas parentGroup").attr("clip-path", `url(#${chartId}-clip)`).merge(areas);
|
|
@@ -18480,8 +18643,13 @@
|
|
|
18480
18643
|
).attr("class", "area parentGroup").attr(
|
|
18481
18644
|
"fill",
|
|
18482
18645
|
(d) => d.properties.color !== commonColors.white ? d.properties.color : "none"
|
|
18483
|
-
).style("fill-opacity", formatOptions.plotArea.fillOpacity)
|
|
18484
|
-
|
|
18646
|
+
).style("fill-opacity", formatOptions.plotArea.fillOpacity).attr("d", (d) => enableAreaTransition ? areaGeneratorStart(d.data) : areaGenerator(d.data)).each(function(d) {
|
|
18647
|
+
if (enableAreaTransition) {
|
|
18648
|
+
select$2(this).transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]).attr("d", areaGenerator(d.data));
|
|
18649
|
+
}
|
|
18650
|
+
});
|
|
18651
|
+
areaGroups.select("path").attr("d", (d) => areaGenerator(d.data));
|
|
18652
|
+
areaGroupsEnter.merge(areaGroups).select("path").attr(
|
|
18485
18653
|
"stroke",
|
|
18486
18654
|
(d) => d.properties.areaBorderColor !== commonColors.white ? d.properties.areaBorderColor : "none"
|
|
18487
18655
|
).attr("stroke-dasharray", (d) => {
|
|
@@ -18542,6 +18710,10 @@
|
|
|
18542
18710
|
).y1(
|
|
18543
18711
|
(d) => d.data.axis === axisTypes.primary ? yScaleLeft(d[1]) : yScaleRight(d[1])
|
|
18544
18712
|
).defined((d) => d.hideZero ? Boolean(d.key) : true).curve(getCurveType(formatOptions));
|
|
18713
|
+
const stackAreaGeneratorStart = area().x(
|
|
18714
|
+
(d) => xScale(d.data.dimension) ? xScale(d.data.dimension) : null
|
|
18715
|
+
).y0(() => yScaleLeft(0)).y1(() => yScaleLeft(0)).defined((d) => d.hideZero ? Boolean(d.key) : true).curve(getCurveType(formatOptions));
|
|
18716
|
+
const enableStackAreaTransition = formatOptions.animation.animationEnabled;
|
|
18545
18717
|
let areas = gTag.selectAll(".parentGroup").data([stackAreaData]);
|
|
18546
18718
|
gTag.append("g").attr("class", "focusClass");
|
|
18547
18719
|
areas = areas.enter().append("g").attr("class", "areas parentGroup").attr("clip-path", `url(#${chartId}-clip)`).merge(areas);
|
|
@@ -18550,8 +18722,13 @@
|
|
|
18550
18722
|
areaGroupsEnter.append("path").attr(
|
|
18551
18723
|
"hoverId",
|
|
18552
18724
|
(d) => (data2.data.filter((e) => e.legend === d.key)[0].properties.alias || data2.data.filter((e) => e.legend === d.key)[0].properties.name || "Legend").replace(/\s+/g, "-")
|
|
18553
|
-
).attr("class", "area parentGroup").attr("fill", (d) => d.color !== commonColors.white ? d.color : "none")
|
|
18554
|
-
|
|
18725
|
+
).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) {
|
|
18726
|
+
if (enableStackAreaTransition) {
|
|
18727
|
+
select$2(this).transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]).attr("d", areaGenerator(d));
|
|
18728
|
+
}
|
|
18729
|
+
});
|
|
18730
|
+
areaGroups.select("path").attr("d", (d) => areaGenerator(d));
|
|
18731
|
+
areaGroupsEnter.merge(areaGroups).select("path").style("opacity", formatOptions.plotArea.fillOpacity).attr(
|
|
18555
18732
|
"stroke",
|
|
18556
18733
|
(d) => d.color !== commonColors.white ? d.color : "none"
|
|
18557
18734
|
).attr(
|
|
@@ -18588,19 +18765,24 @@
|
|
|
18588
18765
|
let stackColumnGroupsEnter = stackColumnGroups.enter().append("g").attr("class", (d) => "stackcolumns-group ");
|
|
18589
18766
|
stackColumnGroups = stackColumnGroupsEnter.merge(stackColumnGroups);
|
|
18590
18767
|
let rects = stackColumnGroups.selectAll("rect").data((d) => d);
|
|
18591
|
-
rects.
|
|
18592
|
-
"transform",
|
|
18593
|
-
(d) => `translate(${xScale(d.data.dimension) - columnWidth / 2},0)`
|
|
18594
|
-
).merge(rects).attr(
|
|
18595
|
-
"hoverId",
|
|
18596
|
-
(d) => d.alias.includes("~$~") ? d.alias.split("~$~")[1].replace(/ /g, "-") : d.alias.replace(/ /g, "-")
|
|
18597
|
-
).attr("x", (d) => xScaleForLegends(chartTypes.StackColumnChart)).attr(
|
|
18768
|
+
rects.attr(
|
|
18598
18769
|
"y",
|
|
18599
18770
|
(d) => d.data.axis === axisTypes.primary ? yScaleLeft(d[1]) : yScaleRight(d[1])
|
|
18600
18771
|
).attr(
|
|
18601
18772
|
"height",
|
|
18602
18773
|
(d) => d.data.axis === axisTypes.primary ? customYaxisMaxValue && d[1] > customYaxisMaxValue ? yScaleLeft(d[0]) - yScaleLeft(customYaxisMaxValue) : yScaleLeft(d[0]) - yScaleLeft(d[1]) : secondaryCustomYaxisMaxValue && d[1] > secondaryCustomYaxisMaxValue ? yScaleRight(d[0]) - yScaleRight(secondaryCustomYaxisMaxValue) : yScaleRight(d[0]) - yScaleRight(d[1])
|
|
18603
|
-
)
|
|
18774
|
+
);
|
|
18775
|
+
const rectsEnter = rects.enter().append("rect").attr(
|
|
18776
|
+
"transform",
|
|
18777
|
+
(d) => `translate(${xScale(d.data.dimension) - columnWidth / 2},0)`
|
|
18778
|
+
).attr(
|
|
18779
|
+
"y",
|
|
18780
|
+
(d) => d.data.axis === axisTypes.primary ? yScaleLeft(0) : yScaleRight(0)
|
|
18781
|
+
).attr("height", 0);
|
|
18782
|
+
rectsEnter.merge(rects).attr(
|
|
18783
|
+
"hoverId",
|
|
18784
|
+
(d) => d.alias.includes("~$~") ? d.alias.split("~$~")[1].replace(/ /g, "-") : d.alias.replace(/ /g, "-")
|
|
18785
|
+
).attr("x", (d) => xScaleForLegends(chartTypes.StackColumnChart)).attr("width", xScaleForLegends.bandwidth()).attr("fill", (d, i, nodes) => {
|
|
18604
18786
|
const seriesIndex = Array.from(seriesData).findIndex(
|
|
18605
18787
|
(sdata) => sdata.legend === d.key
|
|
18606
18788
|
);
|
|
@@ -18647,6 +18829,14 @@
|
|
|
18647
18829
|
seriesData.filter((e) => e.legend === d.key)[0].properties
|
|
18648
18830
|
);
|
|
18649
18831
|
}).on("mouseout", hideTooltipOnMouseOut);
|
|
18832
|
+
const finalStackRects = formatOptions.animation.animationEnabled ? rectsEnter.transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]) : rectsEnter;
|
|
18833
|
+
finalStackRects.attr(
|
|
18834
|
+
"y",
|
|
18835
|
+
(d) => d.data.axis === axisTypes.primary ? yScaleLeft(d[1]) : yScaleRight(d[1])
|
|
18836
|
+
).attr(
|
|
18837
|
+
"height",
|
|
18838
|
+
(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])
|
|
18839
|
+
);
|
|
18650
18840
|
stackColumnGroups.exit().remove();
|
|
18651
18841
|
};
|
|
18652
18842
|
const setSVGContainer = (margin2) => {
|
|
@@ -18724,48 +18914,60 @@
|
|
|
18724
18914
|
filteredDimension,
|
|
18725
18915
|
xScale
|
|
18726
18916
|
);
|
|
18727
|
-
|
|
18728
|
-
|
|
18729
|
-
|
|
18730
|
-
|
|
18731
|
-
|
|
18732
|
-
|
|
18733
|
-
|
|
18734
|
-
|
|
18735
|
-
|
|
18736
|
-
|
|
18737
|
-
|
|
18738
|
-
|
|
18739
|
-
|
|
18740
|
-
|
|
18741
|
-
|
|
18742
|
-
|
|
18743
|
-
|
|
18744
|
-
|
|
18745
|
-
|
|
18746
|
-
|
|
18747
|
-
|
|
18748
|
-
|
|
18749
|
-
|
|
18750
|
-
|
|
18751
|
-
|
|
18752
|
-
|
|
18753
|
-
|
|
18754
|
-
|
|
18755
|
-
|
|
18756
|
-
|
|
18757
|
-
|
|
18758
|
-
|
|
18759
|
-
|
|
18760
|
-
|
|
18761
|
-
|
|
18762
|
-
|
|
18763
|
-
|
|
18764
|
-
|
|
18765
|
-
|
|
18766
|
-
|
|
18767
|
-
|
|
18768
|
-
|
|
18917
|
+
clearTimeout(annotationTimeoutId);
|
|
18918
|
+
const renderAnnotationsAndTotals = () => {
|
|
18919
|
+
commonAnnotationsForCustomChart(
|
|
18920
|
+
filteredData,
|
|
18921
|
+
xScale,
|
|
18922
|
+
yScaleLeft,
|
|
18923
|
+
yScaleRight,
|
|
18924
|
+
// need to pass secondary axis scale if secondary axis is drawn
|
|
18925
|
+
margin,
|
|
18926
|
+
d3Annotation,
|
|
18927
|
+
stackColumnData,
|
|
18928
|
+
stackAreaData,
|
|
18929
|
+
[],
|
|
18930
|
+
//labelExcludeList
|
|
18931
|
+
[],
|
|
18932
|
+
// individualLabelColor
|
|
18933
|
+
columnWidth,
|
|
18934
|
+
// [], //old annotation list
|
|
18935
|
+
formatOptions,
|
|
18936
|
+
height,
|
|
18937
|
+
width,
|
|
18938
|
+
innerWidth2,
|
|
18939
|
+
filteredDimension,
|
|
18940
|
+
innerHeight2,
|
|
18941
|
+
chartId,
|
|
18942
|
+
svg,
|
|
18943
|
+
onDataLabelCoordinatesChange,
|
|
18944
|
+
xScaleForLegends,
|
|
18945
|
+
isReportEditable
|
|
18946
|
+
);
|
|
18947
|
+
addTotalValue(
|
|
18948
|
+
totalValueMap,
|
|
18949
|
+
xScale,
|
|
18950
|
+
yScaleLeft,
|
|
18951
|
+
margin,
|
|
18952
|
+
d3Annotation,
|
|
18953
|
+
[],
|
|
18954
|
+
formatOptions,
|
|
18955
|
+
chartType,
|
|
18956
|
+
height,
|
|
18957
|
+
width,
|
|
18958
|
+
svg,
|
|
18959
|
+
isReportEditable
|
|
18960
|
+
);
|
|
18961
|
+
};
|
|
18962
|
+
if (formatOptions.animation.animationEnabled) {
|
|
18963
|
+
svg.selectAll(".annotation-group").remove();
|
|
18964
|
+
annotationTimeoutId = setTimeout(
|
|
18965
|
+
renderAnnotationsAndTotals,
|
|
18966
|
+
formatOptions.animation.animationDuration
|
|
18967
|
+
);
|
|
18968
|
+
} else {
|
|
18969
|
+
renderAnnotationsAndTotals();
|
|
18970
|
+
}
|
|
18769
18971
|
};
|
|
18770
18972
|
const createStackData = (requiredStackChatData) => {
|
|
18771
18973
|
let legendList = requiredStackChatData.data.map((d) => d.legend);
|
|
@@ -18897,7 +19099,6 @@
|
|
|
18897
19099
|
let yScaleLeft;
|
|
18898
19100
|
let yScaleRight;
|
|
18899
19101
|
let xScale;
|
|
18900
|
-
let xScaleForLegends;
|
|
18901
19102
|
let calculatedRange;
|
|
18902
19103
|
let yAxisLeft;
|
|
18903
19104
|
let xAxis;
|
|
@@ -19153,7 +19354,7 @@
|
|
|
19153
19354
|
calculatedRange = [0, innerWidth2];
|
|
19154
19355
|
};
|
|
19155
19356
|
const getXScale = () => {
|
|
19156
|
-
|
|
19357
|
+
band().domain(["layeredLegend"]).range([0, columnWidth]).paddingInner(
|
|
19157
19358
|
chartJSON.legendList.length > 1 ? 0.3 * parseFloat(formatOptions.plotArea.plotAreaSeriesWidth) / 100 : 0
|
|
19158
19359
|
);
|
|
19159
19360
|
xScale = point$7().domain(filteredDimension).range(calculatedRange).padding(0.5);
|
|
@@ -19212,15 +19413,12 @@
|
|
|
19212
19413
|
});
|
|
19213
19414
|
});
|
|
19214
19415
|
lineData.forEach((data2, index2) => {
|
|
19215
|
-
let column = gTag.selectAll(
|
|
19216
|
-
column = column.enter().append("g").attr("class", `column parentGroup`).attr("clip-path", `url(#${chartId}-clip)`).merge(column);
|
|
19217
|
-
let columnGroups = column.selectAll(".column-group").data(data2.data, (d) => d.properties.legendUniqueId);
|
|
19416
|
+
let column = gTag.selectAll(`.parentGroup-${data2.properties.legendUniqueId}`).data([data2], (d) => d.properties.legendUniqueId);
|
|
19417
|
+
column = column.enter().append("g").attr("class", `column parentGroup parentGroup-${data2.properties.legendUniqueId}`).attr("clip-path", `url(#${chartId}-clip)`).merge(column);
|
|
19418
|
+
let columnGroups = column.selectAll(".column-group").data(data2.data, (d) => d.dimension + "_" + data2.properties.legendUniqueId);
|
|
19218
19419
|
let columnGroupsEnter = columnGroups.enter().append("g").attr("class", "column-group").attr(
|
|
19219
19420
|
"hoverId",
|
|
19220
|
-
(data2.properties.alias || data2.properties.name || "Legend").replace(
|
|
19221
|
-
/\s+/g,
|
|
19222
|
-
"-"
|
|
19223
|
-
)
|
|
19421
|
+
(data2.properties.alias || data2.properties.name || "Legend").replace(/\s+/g, "-")
|
|
19224
19422
|
).attr(
|
|
19225
19423
|
"transform",
|
|
19226
19424
|
(d) => index2 === 0 ? `translate(${xScale(d.dimension) - columnWidth / 2}, 0)` : `translate(${xScale(d.dimension) - columnWidth / (2 + index2 * 2)}, 0)`
|
|
@@ -19233,22 +19431,38 @@
|
|
|
19233
19431
|
"transform",
|
|
19234
19432
|
(d) => index2 === 0 ? `translate(${xScale(d.dimension) - columnWidth / 2}, 0)` : `translate(${xScale(d.dimension) - columnWidth / (2 + index2 * 2)}, 0)`
|
|
19235
19433
|
);
|
|
19236
|
-
columnGroupsEnter.append("rect").attr("x", (
|
|
19237
|
-
const yScale = data2.properties.axis === axisTypes.primary ? yScaleLeft : yScaleRight;
|
|
19238
|
-
return d.value > 0 ? yScale(d.value) : yScale(0);
|
|
19239
|
-
}).attr("height", (d) => {
|
|
19434
|
+
const bars = columnGroupsEnter.append("rect").attr("x", () => 0).attr("width", index2 === 0 ? columnWidth : columnWidth / 2 + index2 * 2).attr("y", (d) => {
|
|
19240
19435
|
const yScale = data2.properties.axis === axisTypes.primary ? yScaleLeft : yScaleRight;
|
|
19241
|
-
return
|
|
19242
|
-
}).attr("
|
|
19436
|
+
return yScale(0);
|
|
19437
|
+
}).attr("height", 0).attr(
|
|
19438
|
+
"fill",
|
|
19439
|
+
(d) => colorScaleMap.get(data2.properties.legendUniqueId)?.(d.value) ?? data2.properties.color
|
|
19440
|
+
).attr(
|
|
19243
19441
|
"stroke-dasharray",
|
|
19244
|
-
(
|
|
19245
|
-
).attr("stroke-width",
|
|
19442
|
+
() => data2.properties.stackBorderStyle == 2 ? "5,3" : "0"
|
|
19443
|
+
).attr("stroke-width", `${data2.properties.stackBorderWidth}px`).attr(
|
|
19246
19444
|
"stroke",
|
|
19247
19445
|
() => data2.properties.stackBorderStyle == 0 ? "none" : formatOptions.column.stackBorderVisibility ? data2.properties.stackBorderColor : "none"
|
|
19248
19446
|
).style("clip-path", "inset(0px) fill-box").style("shape-rendering", "crispEdges").attr("opacity", 0.7).attr(
|
|
19249
19447
|
"visibility",
|
|
19250
19448
|
(d) => d.value === 0 && formatOptions.xAxisLabel.hideZeroValues ? "hidden" : "visible"
|
|
19251
|
-
)
|
|
19449
|
+
);
|
|
19450
|
+
const finalBars = formatOptions.animation.animationEnabled ? bars.transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]) : bars;
|
|
19451
|
+
finalBars.attr("y", (d) => {
|
|
19452
|
+
const yScale = data2.properties.axis === axisTypes.primary ? yScaleLeft : yScaleRight;
|
|
19453
|
+
return d.value > 0 ? yScale(d.value) : yScale(0);
|
|
19454
|
+
}).attr("height", (d) => {
|
|
19455
|
+
const yScale = data2.properties.axis === axisTypes.primary ? yScaleLeft : yScaleRight;
|
|
19456
|
+
return Math.abs(yScale(d.value) - yScale(0));
|
|
19457
|
+
});
|
|
19458
|
+
columnGroups.select("rect").transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]).attr("y", (d) => {
|
|
19459
|
+
const yScale = data2.properties.axis === axisTypes.primary ? yScaleLeft : yScaleRight;
|
|
19460
|
+
return d.value > 0 ? yScale(d.value) : yScale(0);
|
|
19461
|
+
}).attr("height", (d) => {
|
|
19462
|
+
const yScale = data2.properties.axis === axisTypes.primary ? yScaleLeft : yScaleRight;
|
|
19463
|
+
return Math.abs(yScale(d.value) - yScale(0));
|
|
19464
|
+
});
|
|
19465
|
+
columnGroupsEnter.merge(columnGroups).on("mousemove", (event2, d) => {
|
|
19252
19466
|
showTooltipOnMouseMove(
|
|
19253
19467
|
[
|
|
19254
19468
|
{
|
|
@@ -19290,6 +19504,7 @@
|
|
|
19290
19504
|
});
|
|
19291
19505
|
columnGroups.exit().remove();
|
|
19292
19506
|
});
|
|
19507
|
+
gTag.selectAll(".parentGroup").raise();
|
|
19293
19508
|
};
|
|
19294
19509
|
const setSVGContainer = (margin2) => {
|
|
19295
19510
|
innerWidth2 = width - margin2.left - margin2.right;
|
|
@@ -19782,7 +19997,7 @@
|
|
|
19782
19997
|
}).on("mouseout", (event2, d) => {
|
|
19783
19998
|
hideTooltipOnMouseOut();
|
|
19784
19999
|
});
|
|
19785
|
-
const finalRects = baseRects;
|
|
20000
|
+
const finalRects = formatOptions.animation.animationEnabled ? baseRects.transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]) : baseRects;
|
|
19786
20001
|
finalRects.attr("y", (d) => d[1] >= d[0] ? yScaleLeft(d[1]) : yScaleLeft(d[0])).attr("height", (d) => Math.abs(yScaleLeft(d[0]) - yScaleLeft(d[1])));
|
|
19787
20002
|
columnGroups.exit().remove();
|
|
19788
20003
|
gTag.selectAll(".parentGroup").raise();
|
|
@@ -20518,7 +20733,8 @@
|
|
|
20518
20733
|
const { props } = getPropsForRect(nodes, i);
|
|
20519
20734
|
return d.data[d.key] === 0 && props?.hideZeroValues ? "hidden" : "visible";
|
|
20520
20735
|
});
|
|
20521
|
-
const
|
|
20736
|
+
const shouldAnimate = formatOptions.animation.animationEnabled;
|
|
20737
|
+
const applyTransition = (sel) => shouldAnimate ? sel.transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]) : sel;
|
|
20522
20738
|
applyTransition(rectsEnter).attr("y", (d) => d[1] >= d[0] ? yScaleLeft(d[1]) : yScaleLeft(d[0])).attr("height", (d) => Math.abs(yScaleLeft(d[0]) - yScaleLeft(d[1])));
|
|
20523
20739
|
rectsEnter.merge(rects).on("mousemove", (event2, d) => {
|
|
20524
20740
|
showTooltipOnMouseMove(
|
|
@@ -21181,6 +21397,7 @@
|
|
|
21181
21397
|
const AnnotationType = formatOptions.plotArea.annotationType ?? "1";
|
|
21182
21398
|
const Disable = [AnnotationType === "1" ? "connector" : ""];
|
|
21183
21399
|
const ConnectorType = formatOptions.plotArea.connectorType?.toLowerCase() ?? "none";
|
|
21400
|
+
const isCurve = AnnotationType === "5";
|
|
21184
21401
|
const rotationAngle = formatOptions.plotArea.rotation ?? 0;
|
|
21185
21402
|
const multiplicationFactor = chartType === chartTypes.PieChart ? 1.06 : 1.1;
|
|
21186
21403
|
const connecterCurve2 = {
|
|
@@ -21188,6 +21405,11 @@
|
|
|
21188
21405
|
"2": curveLinear$1,
|
|
21189
21406
|
"3": step
|
|
21190
21407
|
};
|
|
21408
|
+
const getCurvePoints2 = (dx, dy) => [
|
|
21409
|
+
[0, 0],
|
|
21410
|
+
[dx / 2, dy / 2],
|
|
21411
|
+
[dx, dy]
|
|
21412
|
+
];
|
|
21191
21413
|
const connectedStyle2 = {
|
|
21192
21414
|
solid: "unset",
|
|
21193
21415
|
dotted: "2,2",
|
|
@@ -21243,12 +21465,13 @@
|
|
|
21243
21465
|
dy: 0,
|
|
21244
21466
|
connector: {
|
|
21245
21467
|
end: ConnectorType,
|
|
21246
|
-
curve: connecterCurve2[formatOptions.plotArea.connectorCurve]
|
|
21468
|
+
curve: connecterCurve2[formatOptions.plotArea.connectorCurve],
|
|
21469
|
+
points: isCurve ? getCurvePoints2(0, 0) : [[0, 0], [0, 0]]
|
|
21247
21470
|
},
|
|
21248
21471
|
disable: Disable,
|
|
21249
21472
|
subject: { radius: 3 },
|
|
21250
21473
|
type: annotationTypeforCharts(d3Annotation2, AnnotationType),
|
|
21251
|
-
color: formatOptions.plotArea.
|
|
21474
|
+
color: formatOptions.plotArea.connectorColor ?? "#ccc",
|
|
21252
21475
|
width,
|
|
21253
21476
|
height,
|
|
21254
21477
|
index: index2
|
|
@@ -21278,7 +21501,11 @@
|
|
|
21278
21501
|
newAnnotation.dy = old.dy * scaleFactor;
|
|
21279
21502
|
}
|
|
21280
21503
|
newAnnotation.data.isVisible = old.data?.isVisible ?? true;
|
|
21281
|
-
|
|
21504
|
+
if (old.connectorPoints?.length >= (isCurve ? 3 : 2)) {
|
|
21505
|
+
newAnnotation.connector.points = old.connectorPoints;
|
|
21506
|
+
} else {
|
|
21507
|
+
newAnnotation.connector.points = isCurve ? getCurvePoints2(newAnnotation.dx, newAnnotation.dy) : [[0, 0], [0, 0]];
|
|
21508
|
+
}
|
|
21282
21509
|
}
|
|
21283
21510
|
finalAnnotationList.push(newAnnotation);
|
|
21284
21511
|
});
|
|
@@ -21324,11 +21551,42 @@
|
|
|
21324
21551
|
}
|
|
21325
21552
|
}).annotations(finalAnnotationList);
|
|
21326
21553
|
const annotations = svg.append("g").attr("class", "annotation-group parentGroup").attr("transform", getPiePosition).call(makeAnnotations);
|
|
21554
|
+
const fontStyleName = formatOptions.plotArea.dataLabelNameFontStyle ?? [];
|
|
21555
|
+
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");
|
|
21556
|
+
const fontStyleValue = formatOptions.plotArea.dataLabelValueFontStyle ?? [];
|
|
21557
|
+
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");
|
|
21558
|
+
if (formatOptions.plotArea.plotAreaAbsoluteValue) {
|
|
21559
|
+
annotations.selectAll(".annotation-note-label").each(function(d) {
|
|
21560
|
+
const labelEl = select$2(this);
|
|
21561
|
+
const absText = format(".2s")(Math.abs(d.data.y.value));
|
|
21562
|
+
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);
|
|
21563
|
+
});
|
|
21564
|
+
}
|
|
21565
|
+
if (ConnectorType === "diamond") {
|
|
21566
|
+
const connectorColor2 = formatOptions.plotArea.connectorColor ?? "#ccc";
|
|
21567
|
+
const size = 5;
|
|
21568
|
+
annotations.selectAll(".annotation-connector").each(function() {
|
|
21569
|
+
if (!select$2(this).select("path.connector").empty()) {
|
|
21570
|
+
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);
|
|
21571
|
+
}
|
|
21572
|
+
});
|
|
21573
|
+
}
|
|
21327
21574
|
annotations.selectAll("rect,.annotation-subject").remove();
|
|
21328
|
-
|
|
21575
|
+
if (formatOptions.animation?.animationEnabled) {
|
|
21576
|
+
const duration = formatOptions.animation.animationDuration;
|
|
21577
|
+
const ease = effectsMap[formatOptions.animation.animationEffect];
|
|
21578
|
+
const labels = annotations.selectAll(".annotation-note-label");
|
|
21579
|
+
labels.interrupt().style("opacity", 0);
|
|
21580
|
+
setTimeout(() => {
|
|
21581
|
+
labels.transition().delay((d, i) => i * 30).duration(duration).ease(ease).style("opacity", 1);
|
|
21582
|
+
}, 50);
|
|
21583
|
+
}
|
|
21584
|
+
const connectorColor = formatOptions.plotArea.connectorColor ?? "#ccc";
|
|
21585
|
+
annotations.selectAll(".connector").style("stroke", connectorColor).attr(
|
|
21329
21586
|
"stroke-dasharray",
|
|
21330
21587
|
connectedStyle2[formatOptions.plotArea.connectorStyle?.toLowerCase()]
|
|
21331
21588
|
);
|
|
21589
|
+
annotations.selectAll(".connector-end").style("fill", connectorColor).style("stroke", connectorColor);
|
|
21332
21590
|
annotations.selectAll(".annotation-note-label").filter((d) => !d.data.isVisible).style("display", "none");
|
|
21333
21591
|
annotations.selectAll(".annotation-note-label").filter((d) => formatOptions.plotArea.hideInsignificantValue && d.data.x1 - d.data.x0 < 0.09).style("visibility", "hidden");
|
|
21334
21592
|
} catch (error) {
|
|
@@ -21756,7 +22014,8 @@
|
|
|
21756
22014
|
formatOptions.bins.binsCalculation === "Automatic" ? xAxis.ticks(thresholds) : xAxis.tickValues(periods).ticks(innerWidth2 / 50);
|
|
21757
22015
|
};
|
|
21758
22016
|
const getChartType = (lineData) => {
|
|
21759
|
-
|
|
22017
|
+
const shouldAnimate = formatOptions.animation.animationEnabled;
|
|
22018
|
+
const bars = gTag.append("g").attr("class", "parentGroup").selectAll("#scaling-svg" + chartId + " .rect").data(bins).enter().append("g").selectAll("rect").data((d) => d).enter().append("rect").attr("class", "rect").attr(
|
|
21760
22019
|
"stroke",
|
|
21761
22020
|
formatOptions.bins.binsBorderVisibility && formatOptions.bins.binsBorderColor
|
|
21762
22021
|
).attr(
|
|
@@ -21766,12 +22025,10 @@
|
|
|
21766
22025
|
"stroke-opacity",
|
|
21767
22026
|
formatOptions.bins.binsBorderVisibility && formatOptions.bins.binsBorderOpacity
|
|
21768
22027
|
).attr("x", 1).attr("transform", function(d) {
|
|
21769
|
-
return "translate(" + xScale(d.x0) + "," +
|
|
22028
|
+
return "translate(" + xScale(d.x0) + "," + innerHeight2 + ")";
|
|
21770
22029
|
}).attr("width", function(d) {
|
|
21771
22030
|
return xScale(d.x1) - xScale(d.x0) - parseFloat(formatOptions.bins.binsGapWidth) < 0 ? 0 : xScale(d.x1) - xScale(d.x0) - parseFloat(formatOptions.bins.binsGapWidth);
|
|
21772
|
-
}).attr("height",
|
|
21773
|
-
return innerHeight2 - yScaleLeft(d.length);
|
|
21774
|
-
}).style("fill", (d) => d.color !== commonColors.white ? d.color : "none").style("opacity", formatOptions.bins.binsFillOpacity).style("shape-rendering", "crispEdges").on("mousemove", (event2, d) => {
|
|
22031
|
+
}).attr("height", 0).style("fill", (d) => d.color !== commonColors.white ? d.color : "none").style("opacity", formatOptions.bins.binsFillOpacity).style("shape-rendering", "crispEdges").on("mousemove", (event2, d) => {
|
|
21775
22032
|
showTooltipOnMouseMove(
|
|
21776
22033
|
[
|
|
21777
22034
|
{
|
|
@@ -21793,6 +22050,12 @@
|
|
|
21793
22050
|
event2
|
|
21794
22051
|
);
|
|
21795
22052
|
}).on("mouseout", hideTooltipOnMouseOut);
|
|
22053
|
+
const finalBars = shouldAnimate ? bars.transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]) : bars;
|
|
22054
|
+
finalBars.attr("transform", function(d) {
|
|
22055
|
+
return "translate(" + xScale(d.x0) + "," + (yScaleLeft(d.length) > 0 ? yScaleLeft(d.length) : 0) + ")";
|
|
22056
|
+
}).attr("height", function(d) {
|
|
22057
|
+
return innerHeight2 - yScaleLeft(d.length);
|
|
22058
|
+
});
|
|
21796
22059
|
gTag.selectAll(".parentGroup").raise();
|
|
21797
22060
|
};
|
|
21798
22061
|
const setSVGContainer = (margin2) => {
|
|
@@ -22300,6 +22563,8 @@
|
|
|
22300
22563
|
).defined(
|
|
22301
22564
|
(d) => d.hideZero || chartJSON.hideZeroValues ? Boolean(d.value) : true
|
|
22302
22565
|
).curve(getCurveType(formatOptions));
|
|
22566
|
+
const shouldAnimate = formatOptions.animation.animationEnabled;
|
|
22567
|
+
const applyTransition = (sel) => shouldAnimate ? sel.transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]) : sel;
|
|
22303
22568
|
let lines = gTag.selectAll(".parentGroup").data([reversedLineData]);
|
|
22304
22569
|
lines = lines.enter().append("g").attr("class", "lines parentGroup").merge(lines);
|
|
22305
22570
|
let lineGroups = lines.selectAll(".line-group").data((d) => d);
|
|
@@ -22307,7 +22572,7 @@
|
|
|
22307
22572
|
lineGroupsEnter.append("path").attr("class", "visibleLine").attr("fill", "none");
|
|
22308
22573
|
lineGroupsEnter.merge(lineGroups).each(function(d) {
|
|
22309
22574
|
const g = select$2(this);
|
|
22310
|
-
g.selectAll("path.visibleLine").data([d]).join("path").attr("class", "visibleLine").attr("d", (d2) => lineGenerator(d2.data)).attr(
|
|
22575
|
+
const pathSel = g.selectAll("path.visibleLine").data([d]).join("path").attr("class", "visibleLine").attr("d", (d2) => lineGenerator(d2.data)).attr(
|
|
22311
22576
|
"stroke",
|
|
22312
22577
|
(d2) => d2.properties.color !== commonColors.white ? d2.properties.color : "none"
|
|
22313
22578
|
).attr("stroke-dasharray", (d2) => {
|
|
@@ -22330,6 +22595,14 @@
|
|
|
22330
22595
|
"hoverId",
|
|
22331
22596
|
(d.properties.alias || d.properties.name || "Legend").replace(/\s+/g, "-")
|
|
22332
22597
|
).attr("clip-path", `url(#${chartId}-clip)`).attr("d", (d2) => lineGenerator(d2.data));
|
|
22598
|
+
if (shouldAnimate) {
|
|
22599
|
+
pathSel.each(function() {
|
|
22600
|
+
const path2 = select$2(this);
|
|
22601
|
+
const totalLength = this.getTotalLength();
|
|
22602
|
+
path2.attr("stroke-dasharray", totalLength + " " + totalLength).attr("stroke-dashoffset", totalLength);
|
|
22603
|
+
applyTransition(path2).attr("stroke-dashoffset", 0);
|
|
22604
|
+
});
|
|
22605
|
+
}
|
|
22333
22606
|
});
|
|
22334
22607
|
lineGroups.exit().remove();
|
|
22335
22608
|
lineMarkers(
|
|
@@ -22860,7 +23133,13 @@
|
|
|
22860
23133
|
"stroke-width",
|
|
22861
23134
|
seriesData[i].properties.lineStyle !== staticLineStyle.none ? seriesData[i].properties.lineWidth : 0
|
|
22862
23135
|
).attr("fill", "none");
|
|
22863
|
-
|
|
23136
|
+
const enableTransition = formatOptions.animation.animationEnabled;
|
|
23137
|
+
const totalLength = pathSel.node().getTotalLength();
|
|
23138
|
+
if (enableTransition) {
|
|
23139
|
+
pathSel.attr("stroke-dasharray", totalLength + " " + totalLength).attr("stroke-dashoffset", totalLength).transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]).attr("stroke-dashoffset", 0);
|
|
23140
|
+
} else {
|
|
23141
|
+
pathSel.attr("stroke-dasharray", totalLength + " " + totalLength).attr("stroke-dashoffset", 0);
|
|
23142
|
+
}
|
|
22864
23143
|
g.selectAll("path.hoverLine").data([d]).join("path").attr("class", "hoverLine").attr("d", lineGenerator(d)).attr("stroke", commonColors.transparent).attr("stroke-width", 20).attr("fill", "none").style("pointer-events", "stroke").on("mouseenter", function() {
|
|
22865
23144
|
svg.selectAll(".parentGroup").classed("highlight", false).classed("unhighlight", true);
|
|
22866
23145
|
svg.selectAll(
|
|
@@ -23364,7 +23643,7 @@
|
|
|
23364
23643
|
).append("path").attr("class", "line").attr("fill", "none");
|
|
23365
23644
|
lineGroupsEnter.merge(lineGroups).each(function(d, i) {
|
|
23366
23645
|
const g = select$2(this);
|
|
23367
|
-
g.selectAll("path.visibleLine").data([d]).join("path").attr("class", "visibleLine").attr("d", lineGenerator(d)).attr("stroke", d.color !== commonColors.white ? d.color : "none").attr("stroke-dasharray", (d2) => {
|
|
23646
|
+
const pathSel = g.selectAll("path.visibleLine").data([d]).join("path").attr("class", "visibleLine").attr("d", lineGenerator(d)).attr("stroke", d.color !== commonColors.white ? d.color : "none").attr("stroke-dasharray", (d2) => {
|
|
23368
23647
|
const lineWidth = parseInt(
|
|
23369
23648
|
seriesData[i].properties.lineWidth.toString()
|
|
23370
23649
|
);
|
|
@@ -23383,6 +23662,13 @@
|
|
|
23383
23662
|
"stroke-width",
|
|
23384
23663
|
seriesData[i].properties.lineStyle !== staticLineStyle.none ? seriesData[i].properties.lineWidth : 0
|
|
23385
23664
|
).attr("fill", "none");
|
|
23665
|
+
const enableTransition = formatOptions.animation.animationEnabled;
|
|
23666
|
+
const totalLength = pathSel.node().getTotalLength();
|
|
23667
|
+
if (enableTransition) {
|
|
23668
|
+
pathSel.attr("stroke-dasharray", totalLength + " " + totalLength).attr("stroke-dashoffset", totalLength).transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]).attr("stroke-dashoffset", 0);
|
|
23669
|
+
} else {
|
|
23670
|
+
pathSel.attr("stroke-dasharray", totalLength + " " + totalLength).attr("stroke-dashoffset", 0);
|
|
23671
|
+
}
|
|
23386
23672
|
g.selectAll("path.hoverLine").data([d]).join("path").attr("class", "hoverLine").attr("d", lineGenerator(d)).attr("stroke", commonColors.transparent).attr("stroke-width", 20).attr("fill", "none").style("pointer-events", "stroke").on("mouseenter", function(event2, d2) {
|
|
23387
23673
|
svg.selectAll(".parentGroup").classed("highlight", false).classed("unhighlight", true);
|
|
23388
23674
|
svg.selectAll(
|
|
@@ -23972,7 +24258,7 @@
|
|
|
23972
24258
|
"visibility",
|
|
23973
24259
|
(d) => d.value === 0 && formatOptions.xAxisLabel.hideZeroValues ? "hidden" : "visible"
|
|
23974
24260
|
);
|
|
23975
|
-
const finalBars = bars;
|
|
24261
|
+
const finalBars = formatOptions.animation.animationEnabled ? bars.transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]) : bars;
|
|
23976
24262
|
finalBars.attr("x", (d) => {
|
|
23977
24263
|
const xScaleUsed = data2.properties.axis === axisTypes.primary ? xScaleBottom : xScaleTop;
|
|
23978
24264
|
return d.value >= 0 ? xScaleUsed(0) : xScaleUsed(d.value);
|
|
@@ -24495,7 +24781,7 @@
|
|
|
24495
24781
|
hideTooltipOnMouseOut();
|
|
24496
24782
|
});
|
|
24497
24783
|
baseRects.attr("x", (d) => xScaleBottom(0));
|
|
24498
|
-
const finalRects = baseRects;
|
|
24784
|
+
const finalRects = formatOptions.animation.animationEnabled ? baseRects.transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]) : baseRects;
|
|
24499
24785
|
finalRects.attr("x", (d) => Math.min(xScaleBottom(d[0]), xScaleBottom(d[1]))).attr("width", (d) => Math.abs(xScaleBottom(d[1]) - xScaleBottom(d[0])));
|
|
24500
24786
|
columnGroups.exit().remove();
|
|
24501
24787
|
gTag.selectAll(".parentGroup").raise();
|
|
@@ -25198,7 +25484,7 @@
|
|
|
25198
25484
|
selectAll('[hoverId="' + legend + '"]').classed("highlight", false).classed("unhighlight", false);
|
|
25199
25485
|
hideTooltipOnMouseOut();
|
|
25200
25486
|
});
|
|
25201
|
-
const finalRects = baseRects;
|
|
25487
|
+
const finalRects = formatOptions.animation.animationEnabled ? baseRects.transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]) : baseRects;
|
|
25202
25488
|
finalRects.attr("x", (d) => Math.min(xScaleBottom(d[0]), xScaleBottom(d[1]))).attr("width", (d) => Math.abs(xScaleBottom(d[1]) - xScaleBottom(d[0])));
|
|
25203
25489
|
columnGroups.exit().remove();
|
|
25204
25490
|
gTag.selectAll(".parentGroup").raise();
|
|
@@ -25342,7 +25628,6 @@
|
|
|
25342
25628
|
let gTag;
|
|
25343
25629
|
let xScaleBottom;
|
|
25344
25630
|
let yScale;
|
|
25345
|
-
let yScaleLegend;
|
|
25346
25631
|
let calculatedRange;
|
|
25347
25632
|
let xAxisBottom;
|
|
25348
25633
|
let yAxis;
|
|
@@ -25582,7 +25867,7 @@
|
|
|
25582
25867
|
getYScale();
|
|
25583
25868
|
};
|
|
25584
25869
|
const getYScale = () => {
|
|
25585
|
-
|
|
25870
|
+
band().domain(["layeredLegend"]).range([0, columnWidth]).paddingInner(
|
|
25586
25871
|
chartJSON.legendList.length > 1 ? 0.3 * parseFloat(formatOptions.plotArea.plotAreaSeriesWidth) / 100 : 0
|
|
25587
25872
|
);
|
|
25588
25873
|
yScale = point$7().domain(filteredDimension).range(calculatedRange).padding(0.5);
|
|
@@ -25629,58 +25914,63 @@
|
|
|
25629
25914
|
});
|
|
25630
25915
|
});
|
|
25631
25916
|
lineData.forEach((data2, index2) => {
|
|
25632
|
-
let column = gTag.selectAll(
|
|
25633
|
-
column = column.enter().append("g").attr("class", `column parentGroup`).attr("clip-path", `url(#${chartId}-clip)`).merge(column);
|
|
25634
|
-
let columnGroups = column.selectAll(".column-group").data(data2.data, (d) => d.properties.legendUniqueId);
|
|
25917
|
+
let column = gTag.selectAll(`.parentGroup-${data2.properties.legendUniqueId}`).data([data2], (d) => d.properties.legendUniqueId);
|
|
25918
|
+
column = column.enter().append("g").attr("class", `column parentGroup parentGroup-${data2.properties.legendUniqueId}`).attr("clip-path", `url(#${chartId}-clip)`).merge(column);
|
|
25919
|
+
let columnGroups = column.selectAll(".column-group").data(data2.data, (d) => d.dimension + "_" + data2.properties.legendUniqueId);
|
|
25635
25920
|
let columnGroupsEnter = columnGroups.enter().append("g").attr("class", "column-group").attr(
|
|
25636
25921
|
"hoverId",
|
|
25637
|
-
(data2.properties.alias || data2.properties.name || "Legend").replace(
|
|
25638
|
-
/\s+/g,
|
|
25639
|
-
"-"
|
|
25640
|
-
)
|
|
25922
|
+
(data2.properties.alias || data2.properties.name || "Legend").replace(/\s+/g, "-")
|
|
25641
25923
|
).attr(
|
|
25642
25924
|
"transform",
|
|
25643
|
-
(d) => index2 === 0 ? `translate(0
|
|
25925
|
+
(d) => index2 === 0 ? `translate(0, ${yScale(d.dimension) - columnWidth / 2})` : `translate(0, ${yScale(d.dimension) - columnWidth / (2 + index2 * 2)})`
|
|
25644
25926
|
);
|
|
25645
25927
|
columnGroups.attr(
|
|
25646
25928
|
"transform",
|
|
25647
|
-
(d) => index2 === 0 ? `translate(0
|
|
25929
|
+
(d) => index2 === 0 ? `translate(0, ${yScale(d.dimension) - columnWidth / 2})` : `translate(0, ${yScale(d.dimension) - columnWidth / (2 + index2 * 2)})`
|
|
25648
25930
|
);
|
|
25649
25931
|
columnGroupsEnter.merge(columnGroups).attr(
|
|
25650
25932
|
"transform",
|
|
25651
|
-
(d) => index2 === 0 ? `translate(0
|
|
25933
|
+
(d) => index2 === 0 ? `translate(0, ${yScale(d.dimension) - columnWidth / 2})` : `translate(0, ${yScale(d.dimension) - columnWidth / (2 + index2 * 2)})`
|
|
25652
25934
|
);
|
|
25653
|
-
columnGroupsEnter.append("rect").attr("y",
|
|
25654
|
-
|
|
25655
|
-
|
|
25656
|
-
|
|
25657
|
-
(d) => d.value > 0 ? customYaxisMaxValue && d.value > customYaxisMaxValue ? xScaleBottom(customYaxisMaxValue) - xScaleBottom(0) : xScaleBottom(d.value) - xScaleBottom(0) : Math.abs(xScaleBottom(0) - xScaleBottom(d.value))
|
|
25658
|
-
).attr("fill", (d) => colorScaleMap.get(data2.properties.legendUniqueId)?.(d.value) ?? data2.properties.color).attr(
|
|
25935
|
+
const bars = columnGroupsEnter.append("rect").attr("y", 0).attr("height", index2 === 0 ? columnWidth : columnWidth / 2).attr("x", () => xScaleBottom(0)).attr("width", 0).attr(
|
|
25936
|
+
"fill",
|
|
25937
|
+
(d) => colorScaleMap.get(data2.properties.legendUniqueId)?.(d.value) ?? data2.properties.color
|
|
25938
|
+
).attr(
|
|
25659
25939
|
"stroke-dasharray",
|
|
25660
|
-
(
|
|
25661
|
-
).attr("stroke-width",
|
|
25940
|
+
() => data2.properties.stackBorderStyle == 2 ? "5,3" : "0"
|
|
25941
|
+
).attr("stroke-width", `${data2.properties.stackBorderWidth}px`).attr(
|
|
25662
25942
|
"stroke",
|
|
25663
|
-
(
|
|
25943
|
+
() => data2.properties.stackBorderStyle == 0 ? "none" : formatOptions.column.stackBorderVisibility ? data2.properties.stackBorderColor : "none"
|
|
25664
25944
|
).style("clip-path", "inset(0px) fill-box").style("shape-rendering", "crispEdges").attr("opacity", 0.7).attr(
|
|
25665
25945
|
"visibility",
|
|
25666
25946
|
(d) => d.value === 0 && formatOptions.xAxisLabel.hideZeroValues ? "hidden" : "visible"
|
|
25667
|
-
)
|
|
25947
|
+
);
|
|
25948
|
+
const finalBars = formatOptions.animation.animationEnabled ? bars.transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]) : bars;
|
|
25949
|
+
finalBars.attr(
|
|
25950
|
+
"x",
|
|
25951
|
+
(d) => d.value > 0 ? xScaleBottom(0) : xScaleBottom(d.value)
|
|
25952
|
+
).attr(
|
|
25953
|
+
"width",
|
|
25954
|
+
(d) => d.value > 0 ? xScaleBottom(d.value) - xScaleBottom(0) : Math.abs(xScaleBottom(0) - xScaleBottom(d.value))
|
|
25955
|
+
);
|
|
25956
|
+
columnGroups.select("rect").transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]).attr(
|
|
25957
|
+
"x",
|
|
25958
|
+
(d) => d.value > 0 ? xScaleBottom(0) : xScaleBottom(d.value)
|
|
25959
|
+
).attr(
|
|
25960
|
+
"width",
|
|
25961
|
+
(d) => d.value > 0 ? xScaleBottom(d.value) - xScaleBottom(0) : Math.abs(xScaleBottom(0) - xScaleBottom(d.value))
|
|
25962
|
+
);
|
|
25963
|
+
columnGroupsEnter.merge(columnGroups).on("mousemove", (event2, d) => {
|
|
25668
25964
|
showTooltipOnMouseMove(
|
|
25669
25965
|
[
|
|
25670
25966
|
{
|
|
25671
25967
|
key: formatOptions.xAxisTitle.xAxisTitleHTML !== "" ? new DOMParser().parseFromString(formatOptions.xAxisTitle.xAxisTitleHTML, "text/html").body.textContent?.trim() : formatOptions.xAxisTitle.xAxisTitleText.includes("~$~") ? formatOptions.xAxisTitle.xAxisTitleText.split("~$~")[1] : formatOptions.xAxisTitle.xAxisTitleText,
|
|
25672
|
-
value: chartJSON.formattedDimensionListMap.get(
|
|
25673
|
-
Array.isArray(d.dimension) ? d.dimension[0] : d.dimension
|
|
25674
|
-
)
|
|
25968
|
+
value: chartJSON.formattedDimensionListMap.get(d.dimension)
|
|
25675
25969
|
},
|
|
25676
25970
|
{
|
|
25677
|
-
key: formatOptions.yAxisTitle.yAxisTitleHTML !== "" ? new DOMParser().parseFromString(formatOptions.yAxisTitle.yAxisTitleHTML, "text/html").body.textContent?.trim() : d.properties?.currentMeasure
|
|
25971
|
+
key: formatOptions.yAxisTitle.yAxisTitleHTML !== "" ? new DOMParser().parseFromString(formatOptions.yAxisTitle.yAxisTitleHTML, "text/html").body.textContent?.trim() : d.properties?.currentMeasure || formatOptions.yAxisTitle.yAxisTitleText || d.value,
|
|
25678
25972
|
value: getNumberWithFormat(
|
|
25679
|
-
|
|
25680
|
-
chartTypes.NormalizedStackLineChart,
|
|
25681
|
-
chartTypes.NormalizedStackAreaChart,
|
|
25682
|
-
""
|
|
25683
|
-
].includes(chartType) ? d[1] - d[0] : d.value,
|
|
25973
|
+
d.value,
|
|
25684
25974
|
formatOptions.toolTip.toolTipDisplayUnits,
|
|
25685
25975
|
formatOptions.toolTip.toolTipNumberFormat,
|
|
25686
25976
|
formatOptions.toolTip.toolTipDecimalPrecision
|
|
@@ -25695,13 +25985,7 @@
|
|
|
25695
25985
|
event2,
|
|
25696
25986
|
data2.properties
|
|
25697
25987
|
);
|
|
25698
|
-
|
|
25699
|
-
selectAll(".parentGroup").classed("highlight", false).classed("unhighlight", true);
|
|
25700
|
-
selectAll('[hoverId="' + legend + '"]').classed("highlight", true).classed("unhighlight", false);
|
|
25701
|
-
}).on("mouseout", (e, d) => {
|
|
25702
|
-
let legend = (data2.properties.alias || data2.properties.name || "Legend").replace(/ /g, "-");
|
|
25703
|
-
selectAll(".parentGroup").classed("highlight", false).classed("unhighlight", false);
|
|
25704
|
-
selectAll('[hoverId="' + legend + '"]').classed("highlight", false).classed("unhighlight", false);
|
|
25988
|
+
}).on("mouseout", () => {
|
|
25705
25989
|
hideTooltipOnMouseOut();
|
|
25706
25990
|
});
|
|
25707
25991
|
columnGroups.exit().remove();
|
|
@@ -25766,8 +26050,8 @@
|
|
|
25766
26050
|
onDataLabelCoordinatesChange,
|
|
25767
26051
|
void 0,
|
|
25768
26052
|
columnWidth,
|
|
25769
|
-
false,
|
|
25770
26053
|
isReportEditable,
|
|
26054
|
+
false,
|
|
25771
26055
|
barChart
|
|
25772
26056
|
);
|
|
25773
26057
|
getConnectors();
|
|
@@ -26388,7 +26672,8 @@
|
|
|
26388
26672
|
formatOptions.bins.binsCalculation === "Automatic" ? yAxisLeft.ticks(thresholds) : yAxisLeft.tickValues(periods).ticks(innerHeight2 / 50);
|
|
26389
26673
|
};
|
|
26390
26674
|
const getChartType = (lineData) => {
|
|
26391
|
-
|
|
26675
|
+
const shouldAnimate = formatOptions.animation.animationEnabled;
|
|
26676
|
+
const bars = gTag.append("g").attr("class", "parentGroup").selectAll("#scaling-svg" + chartId + " .rect").data(bins).enter().append("g").selectAll("rect").data((d) => d).enter().append("rect").attr("class", "rect").attr(
|
|
26392
26677
|
"stroke",
|
|
26393
26678
|
formatOptions.bins.binsBorderVisibility && formatOptions.bins.binsBorderColor
|
|
26394
26679
|
).attr(
|
|
@@ -26406,7 +26691,7 @@
|
|
|
26406
26691
|
const y12 = yScaleLeft(d.x1);
|
|
26407
26692
|
const gap = parseFloat(formatOptions.bins.binsGapWidth) || 0;
|
|
26408
26693
|
return Math.max(1, Math.abs(y12 - y02) - gap);
|
|
26409
|
-
}).attr("width",
|
|
26694
|
+
}).attr("width", 0).style("fill", (d) => d.color !== commonColors.white ? d.color : "none").style("opacity", formatOptions.bins.binsFillOpacity).style("shape-rendering", "crispEdges").on("mousemove", (event2, d) => {
|
|
26410
26695
|
showTooltipOnMouseMove(
|
|
26411
26696
|
[
|
|
26412
26697
|
{
|
|
@@ -26428,6 +26713,8 @@
|
|
|
26428
26713
|
event2
|
|
26429
26714
|
);
|
|
26430
26715
|
}).on("mouseout", hideTooltipOnMouseOut);
|
|
26716
|
+
const finalBars = shouldAnimate ? bars.transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]) : bars;
|
|
26717
|
+
finalBars.attr("width", (d) => xScale(d.length));
|
|
26431
26718
|
gTag.selectAll(".parentGroup").raise();
|
|
26432
26719
|
};
|
|
26433
26720
|
const setSVGContainer = (margin2) => {
|
|
@@ -26923,6 +27210,7 @@
|
|
|
26923
27210
|
const areaGeneratorStart = area().x(
|
|
26924
27211
|
(d) => xScale(d.dimension) ? xScale(d.dimension) : null
|
|
26925
27212
|
).y0(() => yScaleLeft(0)).y1(() => yScaleLeft(0)).defined((d) => d.hideZero ? Boolean(d.value) : true).curve(getCurveType(formatOptions));
|
|
27213
|
+
const enableTransition = formatOptions.animation.animationEnabled;
|
|
26926
27214
|
let areas = gTag.selectAll(".parentGroup").data([lineData]);
|
|
26927
27215
|
let focus = gTag.append("g").attr("class", "focusClass");
|
|
26928
27216
|
areas = areas.enter().append("g").attr("class", "areas lineGroup").attr("clip-path", `url(#${chartId}-clip)`).merge(areas);
|
|
@@ -26938,7 +27226,9 @@
|
|
|
26938
27226
|
"-"
|
|
26939
27227
|
)
|
|
26940
27228
|
).attr("d", (d) => areaGeneratorStart(d.data)).each(function(d) {
|
|
26941
|
-
{
|
|
27229
|
+
if (enableTransition) {
|
|
27230
|
+
select$2(this).transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]).attr("d", areaGenerator(d.data));
|
|
27231
|
+
} else {
|
|
26942
27232
|
select$2(this).attr("d", areaGenerator(d.data));
|
|
26943
27233
|
}
|
|
26944
27234
|
});
|
|
@@ -27459,6 +27749,7 @@
|
|
|
27459
27749
|
).tickSizeOuter(0).tickValues(responsiveXaxisLabel(filteredDimension, innerWidth2));
|
|
27460
27750
|
};
|
|
27461
27751
|
const getChartType = (lineData) => {
|
|
27752
|
+
const enableTransition = formatOptions.animation.animationEnabled;
|
|
27462
27753
|
const isLinesAndMarkersVisible = formatOptions.plotArea.plotAreaHideLineAndMarkers;
|
|
27463
27754
|
lineData.forEach((lData) => {
|
|
27464
27755
|
lData.data.forEach((cData) => {
|
|
@@ -27485,7 +27776,9 @@
|
|
|
27485
27776
|
"hoverId",
|
|
27486
27777
|
(d) => (lineData[d.index].properties.alias || lineData[d.index].properties.name || "Legend").replace(/\s+/g, "-")
|
|
27487
27778
|
).attr("class", "area parentGroup").attr("fill", (d) => d.color !== commonColors.white ? d.color : "none").style("fill-opacity", formatOptions.plotArea.fillOpacity).style("pointer-events", "none").attr("d", (d) => areaGeneratorStart(d)).each(function(d) {
|
|
27488
|
-
{
|
|
27779
|
+
if (enableTransition) {
|
|
27780
|
+
select$2(this).transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]).attr("d", areaGenerator(d));
|
|
27781
|
+
} else {
|
|
27489
27782
|
select$2(this).attr("d", areaGenerator(d));
|
|
27490
27783
|
}
|
|
27491
27784
|
});
|
|
@@ -28014,6 +28307,7 @@
|
|
|
28014
28307
|
).tickSizeOuter(0).tickValues(responsiveXaxisLabel(filteredDimension, innerWidth2));
|
|
28015
28308
|
};
|
|
28016
28309
|
const getChartType = (lineData) => {
|
|
28310
|
+
const enableTransition = formatOptions.animation.animationEnabled;
|
|
28017
28311
|
const isLinesAndMarkersVisible = formatOptions.plotArea.plotAreaHideLineAndMarkers;
|
|
28018
28312
|
stackChartData.forEach(
|
|
28019
28313
|
(data2, i) => data2.forEach((item, position) => {
|
|
@@ -28048,7 +28342,9 @@
|
|
|
28048
28342
|
(d) => (lineData[d.index]?.properties?.alias || lineData[d.index]?.properties?.name || "Legend").replace(/\s+/g, "-")
|
|
28049
28343
|
).attr("class", "area parentGroup").attr("fill", (d) => d.color !== commonColors.white ? d.color : "none").style("fill-opacity", formatOptions.plotArea.fillOpacity).style("pointer-events", "none").attr("d", (d) => columnGeneratorStart(d)).each(function(d) {
|
|
28050
28344
|
const path2 = select$2(this);
|
|
28051
|
-
{
|
|
28345
|
+
if (enableTransition) {
|
|
28346
|
+
path2.transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]).attr("d", columnGenerator(d));
|
|
28347
|
+
} else {
|
|
28052
28348
|
path2.attr("d", columnGenerator(d));
|
|
28053
28349
|
}
|
|
28054
28350
|
});
|
|
@@ -28483,13 +28779,13 @@
|
|
|
28483
28779
|
try {
|
|
28484
28780
|
const arc2 = arc$1().innerRadius(0).outerRadius(radius);
|
|
28485
28781
|
const arcOver = arc$1().innerRadius(0).outerRadius(radius + 10);
|
|
28486
|
-
chartAreaTagG.append("g").attr("class", "parentGroup").attr("fill-opacity", chartFormatOptions.plotArea.opacity).attr("transform", `${getPiePosition()}`).selectAll("path").data(pieChartData).enter().append("path").attr("class", (d) => "path").attr(
|
|
28782
|
+
const paths = chartAreaTagG.append("g").attr("class", "parentGroup").attr("fill-opacity", chartFormatOptions.plotArea.opacity).attr("transform", `${getPiePosition()}`).selectAll("path").data(pieChartData).enter().append("path").attr("class", (d) => "path").attr(
|
|
28487
28783
|
"hoverId",
|
|
28488
28784
|
(d) => (d.data?.properties?.alias || d.data?.properties?.name || "Legend").replace(/\s+/g, "-")
|
|
28489
28785
|
).attr(
|
|
28490
28786
|
"fill",
|
|
28491
28787
|
(d) => d.data.properties.color !== commonColors.white ? d.data.properties.color : "none"
|
|
28492
|
-
).
|
|
28788
|
+
).on("mouseover.arc", function(d) {
|
|
28493
28789
|
select$2(this).transition().duration(100).attr("d", arcOver);
|
|
28494
28790
|
}).on("mousemove. ", (d) => {
|
|
28495
28791
|
showTooltipOnMouseMove(
|
|
@@ -28520,6 +28816,17 @@
|
|
|
28520
28816
|
select$2(this).transition().duration(100).attr("d", arc2);
|
|
28521
28817
|
hideTooltipOnMouseOut();
|
|
28522
28818
|
});
|
|
28819
|
+
if (chartFormatOptions.animation.animationEnabled) {
|
|
28820
|
+
paths.transition().duration(chartFormatOptions.animation.animationDuration).ease(effectsMap[chartFormatOptions.animation.animationEffect]).attrTween("d", function(d) {
|
|
28821
|
+
const interpolate2 = interpolate$4(
|
|
28822
|
+
{ startAngle: d.startAngle, endAngle: d.startAngle },
|
|
28823
|
+
d
|
|
28824
|
+
);
|
|
28825
|
+
return (t) => arc2(interpolate2(t));
|
|
28826
|
+
});
|
|
28827
|
+
} else {
|
|
28828
|
+
paths.attr("d", (d) => arc2(d));
|
|
28829
|
+
}
|
|
28523
28830
|
} catch (error) {
|
|
28524
28831
|
logError$2(fileName$8, "drawPieChart", error);
|
|
28525
28832
|
}
|
|
@@ -28892,7 +29199,7 @@
|
|
|
28892
29199
|
};
|
|
28893
29200
|
const drawDonutChart = () => {
|
|
28894
29201
|
try {
|
|
28895
|
-
const enableTransition =
|
|
29202
|
+
const enableTransition = chartFormatOptions.animation.animationEnabled;
|
|
28896
29203
|
const arc2 = arc$1().innerRadius(innerRadius).outerRadius(radius);
|
|
28897
29204
|
const arcOver = arc$1().innerRadius(innerRadius).outerRadius(radius + 10);
|
|
28898
29205
|
const parentGroup = chartAreaTagG.append("g").attr("class", "parentGroup").attr("fill-opacity", chartFormatOptions.plotArea.opacity).attr("transform", `${getPiePosition()}`);
|
|
@@ -28906,8 +29213,9 @@
|
|
|
28906
29213
|
const thisPath = d;
|
|
28907
29214
|
thisPath._current = { startAngle: 0, endAngle: 0 };
|
|
28908
29215
|
}).on("mouseover.arc", function() {
|
|
28909
|
-
if (enableTransition)
|
|
28910
|
-
|
|
29216
|
+
if (enableTransition) {
|
|
29217
|
+
select$2(this).transition().duration(150).attr("d", arcOver);
|
|
29218
|
+
} else {
|
|
28911
29219
|
select$2(this).attr("d", arcOver);
|
|
28912
29220
|
}
|
|
28913
29221
|
}).on("mousemove.text", (d) => {
|
|
@@ -28934,13 +29242,23 @@
|
|
|
28934
29242
|
d.currentTarget.__data__.data.properties
|
|
28935
29243
|
);
|
|
28936
29244
|
}).on("mouseout.text", () => hideTooltipOnMouseOut()).on("mouseout.arc", function() {
|
|
28937
|
-
if (enableTransition)
|
|
28938
|
-
|
|
29245
|
+
if (enableTransition) {
|
|
29246
|
+
select$2(this).transition().duration(150).attr("d", arc2);
|
|
29247
|
+
} else {
|
|
28939
29248
|
select$2(this).attr("d", arc2);
|
|
28940
29249
|
}
|
|
28941
29250
|
});
|
|
28942
|
-
if (enableTransition)
|
|
28943
|
-
|
|
29251
|
+
if (enableTransition) {
|
|
29252
|
+
paths.transition().duration(chartFormatOptions.animation.animationDuration).ease(effectsMap[chartFormatOptions.animation.animationEffect]).attrTween("d", function(d) {
|
|
29253
|
+
const interpolate2 = interpolate$4(
|
|
29254
|
+
{ startAngle: d.startAngle, endAngle: d.startAngle },
|
|
29255
|
+
d
|
|
29256
|
+
);
|
|
29257
|
+
return function(t) {
|
|
29258
|
+
return arc2(interpolate2(t));
|
|
29259
|
+
};
|
|
29260
|
+
});
|
|
29261
|
+
} else {
|
|
28944
29262
|
paths.attr("d", (d) => arc2(d));
|
|
28945
29263
|
}
|
|
28946
29264
|
} catch (error) {
|
|
@@ -29388,8 +29706,9 @@
|
|
|
29388
29706
|
};
|
|
29389
29707
|
const initChartRect = () => {
|
|
29390
29708
|
try {
|
|
29709
|
+
const shouldAnimate = chartFormatOptions.animation.animationEnabled;
|
|
29391
29710
|
const leaf = chartAreaTagG.selectAll("g").data(chartData).enter().append("g").attr("transform", (d) => `translate(${d.x0},${d.y0})`);
|
|
29392
|
-
leaf.append("rect").attr("fill", (d) => getColor(d.data)).attr("fill-opacity", 0.7).attr("width", (d) => d.x1 - d.x0).attr("height", (d) => d.y1 - d.y0).on("mousemove", (d, data2) => {
|
|
29711
|
+
const rects = leaf.append("rect").attr("fill", (d) => getColor(d.data)).attr("fill-opacity", shouldAnimate ? 0 : 0.7).attr("width", (d) => d.x1 - d.x0).attr("height", (d) => d.y1 - d.y0).on("mousemove", (d, data2) => {
|
|
29393
29712
|
showTooltipOnMouseMove(
|
|
29394
29713
|
[
|
|
29395
29714
|
{
|
|
@@ -29407,6 +29726,9 @@
|
|
|
29407
29726
|
getMarkerColorForTooltip(d)
|
|
29408
29727
|
);
|
|
29409
29728
|
}).on("mouseout", () => hideTooltipOnMouseOut());
|
|
29729
|
+
if (shouldAnimate) {
|
|
29730
|
+
rects.transition().duration(chartFormatOptions.animation.animationDuration).ease(effectsMap[chartFormatOptions.animation.animationEffect]).attr("fill-opacity", 0.7);
|
|
29731
|
+
}
|
|
29410
29732
|
leaf.append("clipPath").attr("id", (d, i) => `clip-${i}-${chartId}`).append("rect").attr("width", (d) => d.x1 - d.x0).attr("height", (d) => d.y1 - d.y0);
|
|
29411
29733
|
if (chartFormatOptions.plotArea.dataLabels) {
|
|
29412
29734
|
leaf.append("text").style("fill", (d) => d.data.properties.labelFontColor).style("font-family", (d) => d.data.properties.fontFamily).style("font-size", (d) => d.data.properties.fontSize).style(
|
|
@@ -29567,10 +29889,10 @@
|
|
|
29567
29889
|
try {
|
|
29568
29890
|
const arc2 = arc$1().innerRadius(0).outerRadius(radius);
|
|
29569
29891
|
const arcOver = arc$1().innerRadius(0).outerRadius(radius + 10);
|
|
29570
|
-
chartAreaTagG.append("g").attr("class", "parentGroup").attr("fill-opacity", chartFormatOptions.plotArea.opacity).attr("transform", `${getParentPiePosition()}`).selectAll("path").data(pieOfPieData).enter().append("path").attr("class", (d) => "path " + d.data.legend).attr("hoverId", (d) => d.data.legend.replace(/ /g, "-")).attr(
|
|
29892
|
+
const paths = chartAreaTagG.append("g").attr("class", "parentGroup").attr("fill-opacity", chartFormatOptions.plotArea.opacity).attr("transform", `${getParentPiePosition()}`).selectAll("path").data(pieOfPieData).enter().append("path").attr("class", (d) => "path " + d.data.legend).attr("hoverId", (d) => d.data.legend.replace(/ /g, "-")).attr(
|
|
29571
29893
|
"fill",
|
|
29572
29894
|
(d) => d.data.properties.color !== commonColors.white ? d.data.properties.color : "none"
|
|
29573
|
-
).
|
|
29895
|
+
).on("mouseover.arc", function(d) {
|
|
29574
29896
|
select$2(this).transition().duration(100).attr("d", arcOver);
|
|
29575
29897
|
}).on("mousemove.text", (d) => {
|
|
29576
29898
|
showTooltipOnMouseMove(
|
|
@@ -29615,14 +29937,25 @@
|
|
|
29615
29937
|
logError$2(fileName$5, "drawPieChart_onClick", error);
|
|
29616
29938
|
}
|
|
29617
29939
|
});
|
|
29940
|
+
if (chartFormatOptions.animation.animationEnabled) {
|
|
29941
|
+
paths.transition().duration(chartFormatOptions.animation.animationDuration).ease(effectsMap[chartFormatOptions.animation.animationEffect]).attrTween("d", function(d) {
|
|
29942
|
+
const interpolate2 = interpolate$4(
|
|
29943
|
+
{ startAngle: d.startAngle, endAngle: d.startAngle },
|
|
29944
|
+
d
|
|
29945
|
+
);
|
|
29946
|
+
return (t) => arc2(interpolate2(t));
|
|
29947
|
+
});
|
|
29948
|
+
} else {
|
|
29949
|
+
paths.attr("d", (d) => arc2(d));
|
|
29950
|
+
}
|
|
29618
29951
|
} catch (error) {
|
|
29619
29952
|
logError$2(fileName$5, "drawPieChart", error);
|
|
29620
29953
|
}
|
|
29621
29954
|
};
|
|
29622
29955
|
const drawChildPie = (childData, rotate2, parentArc) => {
|
|
29623
29956
|
try {
|
|
29624
|
-
chartAreaTagG.select(".parentGroup").transition().attr("transform", `${getParentPiePosition()} rotate(${rotate2})`)
|
|
29625
|
-
chartAreaTagG.selectAll(".parentLabels").transition().attr("transform", `${getParentPiePosition()} rotate(${rotate2})`)
|
|
29957
|
+
chartAreaTagG.select(".parentGroup").transition().duration(chartFormatOptions.animation.animationDuration).ease(effectsMap[chartFormatOptions.animation.animationEffect]).attr("transform", `${getParentPiePosition()} rotate(${rotate2})`);
|
|
29958
|
+
chartAreaTagG.selectAll(".parentLabels").transition().duration(chartFormatOptions.animation.animationDuration).ease(effectsMap[chartFormatOptions.animation.animationEffect]).attr("transform", `${getParentPiePosition()} rotate(${rotate2})`);
|
|
29626
29959
|
const childPie = pie().value((d) => d.data[0].value);
|
|
29627
29960
|
let childPieData = childPie(childData).map((d, i) => ({
|
|
29628
29961
|
...d,
|
|
@@ -29850,8 +30183,8 @@
|
|
|
29850
30183
|
let radius2 = angleData.y1;
|
|
29851
30184
|
let y2 = radius2 * Math.sin(arcAngle);
|
|
29852
30185
|
let x2 = y2 / Math.tan(arcAngle);
|
|
29853
|
-
chartAreaTagG.append("line").
|
|
29854
|
-
chartAreaTagG.append("line").
|
|
30186
|
+
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);
|
|
30187
|
+
chartAreaTagG.append("line").style("stroke", chartFormatOptions.pieofPie.pieOfPieLineColor).style("stroke-width", chartFormatOptions.pieofPie.pieOfPieLineWidth).style("stroke-dasharray", "3, 3").attr("opacity", 0.5).attr("x1", parentPieX + x2).attr("y1", parentPieY + y2).attr("x2", childPieX).attr("y2", childPieY + childRadius);
|
|
29855
30188
|
} catch (error) {
|
|
29856
30189
|
logError$2(fileName$5, "drawLines", error);
|
|
29857
30190
|
}
|
|
@@ -29883,7 +30216,8 @@
|
|
|
29883
30216
|
const PyramidChart = ({
|
|
29884
30217
|
data,
|
|
29885
30218
|
formatOptions,
|
|
29886
|
-
chartId
|
|
30219
|
+
chartId,
|
|
30220
|
+
onDataLabelCoordinatesChange
|
|
29887
30221
|
}) => {
|
|
29888
30222
|
const svgRef = require$$0$1.useRef();
|
|
29889
30223
|
let seriesData = generalizedChartData(data.ChartData);
|
|
@@ -29991,7 +30325,8 @@
|
|
|
29991
30325
|
const bottomWidth = pyramidSide * (inversionConstant - stackHeightArray[i + 1] / pyramidHeight);
|
|
29992
30326
|
const centerX = innerWidth2 / 2;
|
|
29993
30327
|
const pyramidContainer = chartAreaTagG.append("g").attr("id", "PyramidChart").attr("class", "parentGroup");
|
|
29994
|
-
|
|
30328
|
+
const shouldAnimate = chartFormatOptions.animation.animationEnabled;
|
|
30329
|
+
const polygon = pyramidContainer.append("polygon").attr("class", "segment").attr("hoverId", d.legend.replace(/\s+/g, "-")).attr(
|
|
29995
30330
|
"points",
|
|
29996
30331
|
`
|
|
29997
30332
|
${centerX - topWidth / 2},${yTop}
|
|
@@ -29999,7 +30334,7 @@
|
|
|
29999
30334
|
${centerX + bottomWidth / 2},${yBottom}
|
|
30000
30335
|
${centerX - bottomWidth / 2},${yBottom}
|
|
30001
30336
|
`
|
|
30002
|
-
).attr("fill", d.properties.color || "#4cb2ff").on("mousemove", function() {
|
|
30337
|
+
).attr("fill", d.properties.color || "#4cb2ff").attr("opacity", shouldAnimate ? 0 : 1).on("mousemove", function() {
|
|
30003
30338
|
try {
|
|
30004
30339
|
showTooltipOnMouseMove(
|
|
30005
30340
|
[
|
|
@@ -30032,6 +30367,9 @@
|
|
|
30032
30367
|
logError$2(fileName$4, "drawPyramidChart.onMouseOut", error);
|
|
30033
30368
|
}
|
|
30034
30369
|
});
|
|
30370
|
+
if (shouldAnimate) {
|
|
30371
|
+
polygon.transition().duration(chartFormatOptions.animation.animationDuration).ease(effectsMap[chartFormatOptions.animation.animationEffect]).attr("opacity", 1);
|
|
30372
|
+
}
|
|
30035
30373
|
} catch (error) {
|
|
30036
30374
|
logError$2(fileName$4, "drawPyramidChart.forEach", error);
|
|
30037
30375
|
}
|
|
@@ -30042,14 +30380,11 @@
|
|
|
30042
30380
|
};
|
|
30043
30381
|
const pyramidAnnotations = (oldAnnotationList) => {
|
|
30044
30382
|
try {
|
|
30045
|
-
const self2 = void 0;
|
|
30046
|
-
let AnnotationType = chartFormatOptions.annotation.annotationType ?? "1";
|
|
30047
30383
|
if (chartFormatOptions.annotation.annotationVisibility) {
|
|
30048
|
-
let Disable = [AnnotationType == "1" ? "connector" : ""];
|
|
30049
30384
|
let makeAnnotations = annotation();
|
|
30050
30385
|
let ConnectorType = chartFormatOptions.annotation.connectorType ? chartFormatOptions.annotation.connectorType.toLowerCase() : "None";
|
|
30051
|
-
let AnnotationsList = annotationsList;
|
|
30052
30386
|
let finalAnnotationList = annotationsList;
|
|
30387
|
+
const connectorStyleKey = chartFormatOptions.annotation.connectorStyle?.toLowerCase();
|
|
30053
30388
|
makeAnnotations.editMode(chartFormatOptions.annotation.annotationDraggable).accessors({
|
|
30054
30389
|
x: function() {
|
|
30055
30390
|
return innerWidth2 * 0.5;
|
|
@@ -30059,13 +30394,29 @@
|
|
|
30059
30394
|
}
|
|
30060
30395
|
}).on("dragend", function(annotation2) {
|
|
30061
30396
|
try {
|
|
30397
|
+
finalAnnotationList.forEach((d) => {
|
|
30398
|
+
if (d.data.legend === annotation2.data.legend) {
|
|
30399
|
+
d.dx = annotation2._dx;
|
|
30400
|
+
d.dy = annotation2._dy;
|
|
30401
|
+
d.width = width;
|
|
30402
|
+
d.height = height;
|
|
30403
|
+
}
|
|
30404
|
+
});
|
|
30405
|
+
if (onDataLabelCoordinatesChange) {
|
|
30406
|
+
onDataLabelCoordinatesChange(
|
|
30407
|
+
finalAnnotationList.map((d) => ({
|
|
30408
|
+
data: { legend: d.data.legend, isVisible: d.data.isVisible ?? true },
|
|
30409
|
+
dx: d.dx,
|
|
30410
|
+
dy: d.dy,
|
|
30411
|
+
width,
|
|
30412
|
+
height
|
|
30413
|
+
}))
|
|
30414
|
+
);
|
|
30415
|
+
}
|
|
30062
30416
|
annotations.selectAll(".connector").attr("hoverId", (d) => d.data.legend.replace(/\s+/g, "-")).style(
|
|
30063
30417
|
"stroke",
|
|
30064
30418
|
chartFormatOptions.annotation.connectorColor || "#ccc"
|
|
30065
|
-
).attr(
|
|
30066
|
-
"stroke-dasharray",
|
|
30067
|
-
ConnectedStyle[chartFormatOptions.annotation.connectorStyle]
|
|
30068
|
-
);
|
|
30419
|
+
).attr("stroke-dasharray", connectedStyle[connectorStyleKey]);
|
|
30069
30420
|
annotations.selectAll(`.connector-${ConnectorType}`).attr(
|
|
30070
30421
|
"fill",
|
|
30071
30422
|
chartFormatOptions.annotation.connectorColor || "#ccc"
|
|
@@ -30076,10 +30427,7 @@
|
|
|
30076
30427
|
annotations.selectAll(".note-line").attr("hoverId", (d) => d.data.currentLegend.replace(/\s+/g, "-")).style(
|
|
30077
30428
|
"stroke",
|
|
30078
30429
|
chartFormatOptions.annotation.connectorColor || "#ccc"
|
|
30079
|
-
).attr(
|
|
30080
|
-
"stroke-dasharray",
|
|
30081
|
-
ConnectedStyle[chartFormatOptions.annotation.connectorStyle]
|
|
30082
|
-
).filter((d) => d._dx == 0 && d._dy == 0).remove();
|
|
30430
|
+
).attr("stroke-dasharray", connectedStyle[connectorStyleKey]).filter((d) => d._dx == 0 && d._dy == 0).remove();
|
|
30083
30431
|
annotations.selectAll(".annotation-note-label").filter((d) => d.data && d.data.isVisible).style("display", "block");
|
|
30084
30432
|
annotations.selectAll(".annotation-note-title").filter((d) => d.data && d.data.isVisible).style("display", "block");
|
|
30085
30433
|
} catch (error) {
|
|
@@ -30092,10 +30440,7 @@
|
|
|
30092
30440
|
annotations.selectAll(".connector").style(
|
|
30093
30441
|
"stroke",
|
|
30094
30442
|
chartFormatOptions.annotation.connectorColor || "#ccc"
|
|
30095
|
-
).attr(
|
|
30096
|
-
"stroke-dasharray",
|
|
30097
|
-
ConnectedStyle[chartFormatOptions.annotation.connectorStyle]
|
|
30098
|
-
);
|
|
30443
|
+
).attr("stroke-dasharray", connectedStyle[connectorStyleKey]);
|
|
30099
30444
|
annotations.selectAll(`.connector-${ConnectorType}`).attr("fill", chartFormatOptions.annotation.connectorColor || "#ccc").style(
|
|
30100
30445
|
"stroke",
|
|
30101
30446
|
chartFormatOptions.annotation.connectorColor || "#ccc"
|
|
@@ -30103,10 +30448,7 @@
|
|
|
30103
30448
|
annotations.selectAll(".note-line").style(
|
|
30104
30449
|
"stroke",
|
|
30105
30450
|
chartFormatOptions.annotation.connectorColor || "#ccc"
|
|
30106
|
-
).attr(
|
|
30107
|
-
"stroke-dasharray",
|
|
30108
|
-
ConnectedStyle[chartFormatOptions.annotation.connectorStyle]
|
|
30109
|
-
).filter((d) => d._dx == 0 && d._dy == 0).remove();
|
|
30451
|
+
).attr("stroke-dasharray", connectedStyle[connectorStyleKey]).filter((d) => d._dx == 0 && d._dy == 0).remove();
|
|
30110
30452
|
annotations.selectAll(".connector-end").filter((d) => d.connector.end == "dot" && d._dx == 0 && d._dy == 0).remove();
|
|
30111
30453
|
annotations.selectAll(".annotation-note-label").filter((d) => d.data && !d.data.isVisible).style("display", "none");
|
|
30112
30454
|
annotations.selectAll(".annotation-note-title").filter((d) => d.data && !d.data.isVisible).style("display", "none");
|
|
@@ -30152,7 +30494,12 @@
|
|
|
30152
30494
|
const prepareNewAnnotationsList = () => {
|
|
30153
30495
|
try {
|
|
30154
30496
|
let annotationType = chartFormatOptions.annotation.annotationType ?? "1";
|
|
30497
|
+
let disable = [annotationType == "1" ? "connector" : ""];
|
|
30155
30498
|
let connectorType = chartFormatOptions.annotation.connectorType ? chartFormatOptions.annotation.connectorType.toLowerCase() : "none";
|
|
30499
|
+
const savedList = JSON.parse(
|
|
30500
|
+
JSON.stringify(chartFormatOptions.plotArea.dataLabelsCoordinates || [])
|
|
30501
|
+
);
|
|
30502
|
+
const oldMap = new Map(savedList.map((d) => [d.data?.legend, d]));
|
|
30156
30503
|
annotationsList = [];
|
|
30157
30504
|
seriesData.forEach((d, i) => {
|
|
30158
30505
|
try {
|
|
@@ -30197,6 +30544,7 @@
|
|
|
30197
30544
|
end: connectorType,
|
|
30198
30545
|
curve: ConnecterCurve[chartFormatOptions.annotation.connectorCurve]
|
|
30199
30546
|
},
|
|
30547
|
+
disable,
|
|
30200
30548
|
subject: {
|
|
30201
30549
|
height: 15,
|
|
30202
30550
|
width: 15
|
|
@@ -30207,6 +30555,12 @@
|
|
|
30207
30555
|
width,
|
|
30208
30556
|
index: i
|
|
30209
30557
|
};
|
|
30558
|
+
const old = oldMap.get(d.legend);
|
|
30559
|
+
if (old) {
|
|
30560
|
+
singleAnnotation.dx = old.dx * width / (old.width || width);
|
|
30561
|
+
singleAnnotation.dy = old.dy * height / (old.height || height);
|
|
30562
|
+
singleAnnotation.data.isVisible = old.data?.isVisible ?? true;
|
|
30563
|
+
}
|
|
30210
30564
|
annotationsList.push(singleAnnotation);
|
|
30211
30565
|
} catch (error) {
|
|
30212
30566
|
logError$2(fileName$4, "prepareNewAnnotationsList.forEach", error);
|
|
@@ -30433,7 +30787,7 @@
|
|
|
30433
30787
|
}).attr(
|
|
30434
30788
|
"transform",
|
|
30435
30789
|
"translate(" + innerWidth2 / 2 + "," + innerHeight2 / 2 + ")"
|
|
30436
|
-
).transition().duration(
|
|
30790
|
+
).transition().duration(chartFormatOptions.animation.animationEnabled ? chartFormatOptions.animation.animationDuration : 0).ease(effectsMap[chartFormatOptions.animation.animationEffect]).attrTween("d", function(d) {
|
|
30437
30791
|
try {
|
|
30438
30792
|
const interpolate2 = interpolate$4(0, progressAngle);
|
|
30439
30793
|
return function(t) {
|
|
@@ -30841,7 +31195,7 @@
|
|
|
30841
31195
|
}
|
|
30842
31196
|
let ratio = scale2(newValue);
|
|
30843
31197
|
let newAngle = config.minAngle + ratio * range2;
|
|
30844
|
-
pointer2.transition().duration(
|
|
31198
|
+
pointer2.transition().duration(chartFormatOptions.animation.animationEnabled ? chartFormatOptions.animation.animationDuration : 0).ease(effectsMap[chartFormatOptions.animation.animationEffect]).attr("transform", "rotate(" + newAngle + ")");
|
|
30845
31199
|
} catch (error) {
|
|
30846
31200
|
logError$2(fileName2, "gauge.update", error);
|
|
30847
31201
|
}
|
|
@@ -31258,9 +31612,7 @@
|
|
|
31258
31612
|
}).on("mouseout", () => {
|
|
31259
31613
|
hideTooltipOnMouseOut();
|
|
31260
31614
|
});
|
|
31261
|
-
arcs.transition().
|
|
31262
|
-
(d, i) => chartFormatOptions.plotArea.arcTransition ? i * 200 : 0
|
|
31263
|
-
).duration(chartFormatOptions.plotArea.arcTransition ? 500 : 0).attrTween("d", arcTween);
|
|
31615
|
+
arcs.transition().duration(chartFormatOptions.animation.animationEnabled ? chartFormatOptions.animation.animationDuration : 0).ease(effectsMap[chartFormatOptions.animation.animationEffect]).attrTween("d", arcTween);
|
|
31264
31616
|
if (chartFormatOptions.plotArea.dataLabels) {
|
|
31265
31617
|
const labelsData = getModifiedDataForLabels(ChartData);
|
|
31266
31618
|
svg2.selectAll(".arc-label-" + chartId).data(labelsData).enter().append("text").attr("class", "arc-label-" + chartId).attr("class", "parentGroup").attr("text-anchor", "start").attr("dy", (d, i) => (getOuterRadius(d.index ?? i) - getInnerRadius(d.index ?? i)) / 1.75).append("textPath").attr("xlink:href", (d, i) => `#arc-path-${d.index ?? i}-` + chartId).style("startOffset", "50%").attr("hoverId", (d) => d.legend.replaceAll(" ", "-")).text(
|
|
@@ -31650,11 +32002,11 @@
|
|
|
31650
32002
|
return false;
|
|
31651
32003
|
}
|
|
31652
32004
|
function cloudBounds(bounds, d) {
|
|
31653
|
-
var
|
|
31654
|
-
if (d.x + d.x0 <
|
|
31655
|
-
if (d.y + d.y0 <
|
|
31656
|
-
if (d.x + d.x1 >
|
|
31657
|
-
if (d.y + d.y1 >
|
|
32005
|
+
var b02 = bounds[0], b12 = bounds[1];
|
|
32006
|
+
if (d.x + d.x0 < b02.x) b02.x = d.x + d.x0;
|
|
32007
|
+
if (d.y + d.y0 < b02.y) b02.y = d.y + d.y0;
|
|
32008
|
+
if (d.x + d.x1 > b12.x) b12.x = d.x + d.x1;
|
|
32009
|
+
if (d.y + d.y1 > b12.y) b12.y = d.y + d.y1;
|
|
31658
32010
|
}
|
|
31659
32011
|
function collideRects(a2, b) {
|
|
31660
32012
|
return a2.x + a2.x1 > b[0].x && a2.x + a2.x0 < b[1].x && a2.y + a2.y1 > b[0].y && a2.y + a2.y0 < b[1].y;
|
|
@@ -32332,8 +32684,8 @@
|
|
|
32332
32684
|
pairs[[b, a2]] = true;
|
|
32333
32685
|
}
|
|
32334
32686
|
}
|
|
32335
|
-
ids.sort(function(a3,
|
|
32336
|
-
return a3 >
|
|
32687
|
+
ids.sort(function(a3, b10) {
|
|
32688
|
+
return a3 > b10;
|
|
32337
32689
|
});
|
|
32338
32690
|
for (i = 0; i < ids.length; ++i) {
|
|
32339
32691
|
a2 = ids[i];
|
|
@@ -54377,7 +54729,8 @@
|
|
|
54377
54729
|
let maxBubbleSize = 30;
|
|
54378
54730
|
let sizeData = { minimumValue: minMeasure, maximumValue: maxMeasure };
|
|
54379
54731
|
const circles = chartAreaTagG.append("g").attr("class", "circles").attr("class", "parentGroup");
|
|
54380
|
-
|
|
54732
|
+
const shouldAnimate = chartFormatOptions.animation.animationEnabled;
|
|
54733
|
+
const bubblePaths = circles.append("g").selectAll(".bubbleScatter").data(data).enter().append("g").attr(
|
|
54381
54734
|
"hoverId",
|
|
54382
54735
|
(d) => d.legendName.replace(/ /g, "-")
|
|
54383
54736
|
).attr(
|
|
@@ -54400,7 +54753,7 @@
|
|
|
54400
54753
|
);
|
|
54401
54754
|
}).attr("transform", function(d) {
|
|
54402
54755
|
return `translate(${xScale(d.dimension)}, ${yScale(d.measure)})`;
|
|
54403
|
-
}).attr("opacity", chartFormatOptions.plotArea.fillOpacity).style(
|
|
54756
|
+
}).attr("opacity", shouldAnimate ? 0 : chartFormatOptions.plotArea.fillOpacity).style(
|
|
54404
54757
|
"visibility",
|
|
54405
54758
|
(d, i) => d.dimension[0] === 0 || d.measure === 0 && chartFormatOptions.plotArea.hideZeroValues || d.dimension < customXaxisMinValue || d.dimension > customXaxisMaxValue || d.measure < customYaxisMinValue || d.measure > customYaxisMaxValue ? "hidden" : "visible"
|
|
54406
54759
|
).on("mousemove", (event2, d) => {
|
|
@@ -54430,6 +54783,9 @@
|
|
|
54430
54783
|
}).on("mouseout", () => {
|
|
54431
54784
|
hideTooltipOnMouseOut();
|
|
54432
54785
|
});
|
|
54786
|
+
if (shouldAnimate) {
|
|
54787
|
+
bubblePaths.transition().duration(chartFormatOptions.animation.animationDuration).ease(effectsMap[chartFormatOptions.animation.animationEffect]).attr("opacity", chartFormatOptions.plotArea.fillOpacity);
|
|
54788
|
+
}
|
|
54433
54789
|
} catch (e) {
|
|
54434
54790
|
logError$2("BubbleChart", "initCircles", e);
|
|
54435
54791
|
}
|
|
@@ -54827,7 +55183,8 @@
|
|
|
54827
55183
|
return Shape == "Square" ? square : Shape == "Circle" ? circle : Shape == "Cross" ? cross : Shape == "Triangle" ? triangle : Shape == "Star" ? star : Shape == "Diamond" ? diamond : Shape == "Wye" ? wye : circle;
|
|
54828
55184
|
};
|
|
54829
55185
|
const circles = chartAreaTagG.append("g").attr("class", "circles").attr("class", "parentGroup");
|
|
54830
|
-
|
|
55186
|
+
const shouldAnimate = chartFormatOptions.animation.animationEnabled;
|
|
55187
|
+
const scatterPaths = circles.append("g").selectAll(".bubbleScatter").data(data).enter().append("g").attr("fill", (d) => d.selectedColor).attr(
|
|
54831
55188
|
"colorId",
|
|
54832
55189
|
(d) => d.legendName.includes("-") ? d.legendName.split("-")[0].replace(/ /g, "-") : d.legendName.replace(/ /g, "-")
|
|
54833
55190
|
).attr(
|
|
@@ -54844,7 +55201,7 @@
|
|
|
54844
55201
|
);
|
|
54845
55202
|
}).attr("transform", function(d) {
|
|
54846
55203
|
return `translate(${xScale(d.dimension)}, ${yScale(d.measure)})`;
|
|
54847
|
-
}).attr("opacity", chartFormatOptions.plotArea.fillOpacity).style(
|
|
55204
|
+
}).attr("opacity", shouldAnimate ? 0 : chartFormatOptions.plotArea.fillOpacity).style(
|
|
54848
55205
|
"visibility",
|
|
54849
55206
|
(d, i) => d.dimension[0] === 0 || d.measure === 0 && chartFormatOptions.plotArea.hideZeroValues || d.dimension < customXaxisMinValue || d.dimension > customXaxisMaxValue || d.measure < customYaxisMinValue || d.measure > customYaxisMaxValue ? "hidden" : "visible"
|
|
54850
55207
|
).on("mousemove", (event2, d) => {
|
|
@@ -54874,6 +55231,9 @@
|
|
|
54874
55231
|
}).on("mouseout", () => {
|
|
54875
55232
|
hideTooltipOnMouseOut();
|
|
54876
55233
|
});
|
|
55234
|
+
if (shouldAnimate) {
|
|
55235
|
+
scatterPaths.transition().duration(chartFormatOptions.animation.animationDuration).ease(effectsMap[chartFormatOptions.animation.animationEffect]).attr("opacity", chartFormatOptions.plotArea.fillOpacity);
|
|
55236
|
+
}
|
|
54877
55237
|
} catch (e) {
|
|
54878
55238
|
logError$2(fileName, "initCircles", e);
|
|
54879
55239
|
}
|
|
@@ -55713,6 +56073,7 @@
|
|
|
55713
56073
|
(d) => d,
|
|
55714
56074
|
(d) => d.key || d.Key
|
|
55715
56075
|
);
|
|
56076
|
+
const shouldAnimate = formatOptions.animation.animationEnabled;
|
|
55716
56077
|
const rectsEnter = rects.enter().append("rect").attr("class", "rect").attr(
|
|
55717
56078
|
"class",
|
|
55718
56079
|
(d) => d.key ? d.key.replace(/ /g, "-") : d.Key.replace(/ /g, "-")
|
|
@@ -55721,10 +56082,7 @@
|
|
|
55721
56082
|
(d) => xScale(
|
|
55722
56083
|
!isAdvancedWaterfall ? d.data.dimension || d.data.legend : d.data.xKey
|
|
55723
56084
|
)
|
|
55724
|
-
).attr("y",
|
|
55725
|
-
"height",
|
|
55726
|
-
(d) => d[1] ? yScaleLeft(d[0]) - yScaleLeft(d[1]) : 0
|
|
55727
|
-
).attr("width", xScale.bandwidth()).attr(
|
|
56085
|
+
).attr("y", yScaleLeft(0) ?? 0).attr("clip-path", `url(#${chartId}-clip)`).attr("height", 0).attr("width", xScale.bandwidth()).attr(
|
|
55728
56086
|
"visibility",
|
|
55729
56087
|
(d) => k2 === 0 && d.data.dimension && stackTotalData ? "hidden" : "visible"
|
|
55730
56088
|
).style("shape-rendering", "crispEdges").on("mousemove", (event2, d) => {
|
|
@@ -55756,6 +56114,8 @@
|
|
|
55756
56114
|
}).on("mouseout", () => {
|
|
55757
56115
|
hideTooltipOnMouseOut();
|
|
55758
56116
|
});
|
|
56117
|
+
const finalRects = shouldAnimate ? rectsEnter.transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]) : rectsEnter;
|
|
56118
|
+
finalRects.attr("y", (d) => d[1] ? yScaleLeft(d[1]) : 0).attr("height", (d) => d[1] ? yScaleLeft(d[0]) - yScaleLeft(d[1]) : 0);
|
|
55759
56119
|
rects.exit().remove();
|
|
55760
56120
|
rects = rectsEnter.merge(rects);
|
|
55761
56121
|
if (formatOptions.plotArea.plotAreaDataLabel == "2" && k2 != 1) {
|
|
@@ -56399,7 +56759,8 @@
|
|
|
56399
56759
|
const positiveBarColor = formatOptions.plotArea.plotAreaCalculatedHigh;
|
|
56400
56760
|
const negativeBarColor = formatOptions.plotArea.plotAreaCalculatedLow;
|
|
56401
56761
|
const parent = gTag.append("g").attr("class", "parentGroup");
|
|
56402
|
-
|
|
56762
|
+
const shouldAnimate = formatOptions.animation.animationEnabled;
|
|
56763
|
+
const bars = parent.selectAll("rect").data(
|
|
56403
56764
|
filteredData.flatMap(
|
|
56404
56765
|
(d) => d.data.map((child) => ({
|
|
56405
56766
|
...child,
|
|
@@ -56410,7 +56771,7 @@
|
|
|
56410
56771
|
).enter().append("rect").attr("class", "rect").attr(
|
|
56411
56772
|
"y",
|
|
56412
56773
|
(d) => (d.legendText ? yScaleLeft(d.legendText) : yScaleLeft(chartTypes.TornadoDefaultEntry)) - columnWidth / 2
|
|
56413
|
-
).attr("height", columnWidth).attr("x",
|
|
56774
|
+
).attr("height", columnWidth).attr("x", xScale(0)).attr("width", 0).style("shape-rendering", "crispEdges").attr(
|
|
56414
56775
|
"stroke-dasharray",
|
|
56415
56776
|
(d) => d.properties.stackBorderStyle == 2 ? "5,3" : "0"
|
|
56416
56777
|
).attr("stroke-width", (d) => `${d.properties.stackBorderWidth}px`).attr(
|
|
@@ -56446,6 +56807,8 @@
|
|
|
56446
56807
|
!data.IsCalCSensitivity ? d.properties : d.properties.legend === "Calculated Low(-ve)" ? { markerColor: formatOptions.plotArea.plotAreaCalculatedLow } : { markerColor: formatOptions.plotArea.plotAreaCalculatedHigh }
|
|
56447
56808
|
);
|
|
56448
56809
|
}).on("mouseout", hideTooltipOnMouseOut);
|
|
56810
|
+
const finalBars = shouldAnimate ? bars.transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]) : bars;
|
|
56811
|
+
finalBars.attr("x", (d) => d.value >= 0 ? xScale(0) : xScale(d.value)).attr("width", (d) => Math.abs(xScale(d.value) - xScale(0)));
|
|
56449
56812
|
};
|
|
56450
56813
|
const setSVGContainer = (margin2) => {
|
|
56451
56814
|
innerWidth2 = width - margin2.left - margin2.right;
|
|
@@ -56990,14 +57353,16 @@
|
|
|
56990
57353
|
).merge(column);
|
|
56991
57354
|
let columnGroups = column.selectAll(".column-group").data(data2.data, (d) => d.dimension);
|
|
56992
57355
|
let columnGroupsEnter = columnGroups.enter().append("g").attr("class", "column-group");
|
|
56993
|
-
|
|
57356
|
+
const shouldAnimate = formatOptions.animation.animationEnabled;
|
|
57357
|
+
const enteringDots = columnGroupsEnter.append("path").attr("class", "cleveland-dot").attr("opacity", shouldAnimate ? 0 : 0.9);
|
|
57358
|
+
enteringDots.merge(columnGroups.select("path")).attr(
|
|
56994
57359
|
"d",
|
|
56995
57360
|
(d) => Symbol$1().type(Markershapes(d.markerShape)).size((d.markerSize || 6) * 70)()
|
|
56996
57361
|
).attr("transform", (d) => {
|
|
56997
57362
|
const x2 = xScaleBottom(d.value);
|
|
56998
57363
|
const y2 = yScale(d.dimension);
|
|
56999
57364
|
return `translate(${x2},${y2})`;
|
|
57000
|
-
}).attr("fill", (d) => data2.properties.color).attr(
|
|
57365
|
+
}).attr("fill", (d) => data2.properties.color).attr(
|
|
57001
57366
|
"visibility",
|
|
57002
57367
|
() => formatOptions.marker?.markerVisibility ? "visible" : "hidden"
|
|
57003
57368
|
).on("mousemove", (event2, d) => {
|
|
@@ -57030,6 +57395,9 @@
|
|
|
57030
57395
|
selectAll(".halo").remove();
|
|
57031
57396
|
hideTooltipOnMouseOut();
|
|
57032
57397
|
});
|
|
57398
|
+
if (shouldAnimate) {
|
|
57399
|
+
enteringDots.transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]).attr("opacity", 0.9);
|
|
57400
|
+
}
|
|
57033
57401
|
columnGroups.exit().remove();
|
|
57034
57402
|
});
|
|
57035
57403
|
gTag.selectAll(".parentGroup").raise();
|
|
@@ -57359,11 +57727,11 @@
|
|
|
57359
57727
|
return [];
|
|
57360
57728
|
}
|
|
57361
57729
|
function transformToChartJSData(chartData, chartType, formatOptions, colorBank = CJS_DEFAULT_COLORS) {
|
|
57362
|
-
const { ChartData: seriesList, DimensionList } = chartData;
|
|
57730
|
+
const { ChartData: seriesList, DimensionList, LegendList } = chartData;
|
|
57363
57731
|
const labels = DimensionList?.length ? DimensionList : seriesList[0]?.data?.map((d) => d.dimension) ?? [];
|
|
57364
57732
|
const fillOpacity = Number(formatOptions.plotArea?.fillOpacity ?? 0.8);
|
|
57365
57733
|
if (chartType === "pie" || chartType === "doughnut" || chartType === "polarArea") {
|
|
57366
|
-
return buildCircularData(seriesList, labels, fillOpacity, colorBank);
|
|
57734
|
+
return buildCircularData(seriesList, labels, fillOpacity, colorBank, LegendList);
|
|
57367
57735
|
}
|
|
57368
57736
|
if (chartType === "scatter") {
|
|
57369
57737
|
return buildScatterData(seriesList, colorBank);
|
|
@@ -57424,16 +57792,17 @@
|
|
|
57424
57792
|
});
|
|
57425
57793
|
return { labels, datasets };
|
|
57426
57794
|
}
|
|
57427
|
-
function buildCircularData(seriesList, labels, fillOpacity, colorBank) {
|
|
57795
|
+
function buildCircularData(seriesList, labels, fillOpacity, colorBank, legendList) {
|
|
57428
57796
|
const allSeries = seriesList.length ? seriesList : [];
|
|
57429
57797
|
const datasets = allSeries.map((series) => {
|
|
57430
57798
|
const values = labels.map((lbl) => {
|
|
57431
57799
|
const pt = series.data?.find((d) => d.dimension === lbl);
|
|
57432
57800
|
return pt?.value ?? 0;
|
|
57433
57801
|
});
|
|
57434
|
-
const backgroundColors = labels.map(
|
|
57435
|
-
|
|
57436
|
-
|
|
57802
|
+
const backgroundColors = labels.map((_, i) => {
|
|
57803
|
+
const legendColor = legendList?.[i]?.color;
|
|
57804
|
+
return hexToRgba(legendColor ?? colorBank[i % colorBank.length], fillOpacity);
|
|
57805
|
+
});
|
|
57437
57806
|
return {
|
|
57438
57807
|
label: series.properties.alias,
|
|
57439
57808
|
data: values,
|
|
@@ -57570,17 +57939,8 @@
|
|
|
57570
57939
|
maintainAspectRatio: false,
|
|
57571
57940
|
plugins: {
|
|
57572
57941
|
// ---- Title ----
|
|
57573
|
-
|
|
57574
|
-
|
|
57575
|
-
text: formatOptions.chartTitle?.dynamicTitleText || formatOptions.chartTitle?.chartTitleText || "",
|
|
57576
|
-
color: formatOptions.chartTitle?.chartTitleColor ?? "#000000",
|
|
57577
|
-
font: {
|
|
57578
|
-
size: parseInt(formatOptions.chartTitle?.chartTitleFontSize ?? "15", 10),
|
|
57579
|
-
family: formatOptions.chartTitle?.chartTitleFontFamily ?? "Helvetica",
|
|
57580
|
-
style: getFontStyle(formatOptions.chartTitle?.chartTitleFontStyle),
|
|
57581
|
-
weight: getFontWeight(formatOptions.chartTitle?.chartTitleFontStyle)
|
|
57582
|
-
}
|
|
57583
|
-
},
|
|
57942
|
+
// Title is rendered as a separate DOM element in ChartJSWrapper
|
|
57943
|
+
title: { display: false },
|
|
57584
57944
|
// ---- Legend ----
|
|
57585
57945
|
legend: {
|
|
57586
57946
|
display: formatOptions.legends?.legendVisibility !== false && formatOptions.legends?.legendPosition !== "None",
|
|
@@ -57610,9 +57970,10 @@
|
|
|
57610
57970
|
callbacks: {
|
|
57611
57971
|
label(ctx) {
|
|
57612
57972
|
const value2 = typeof ctx.raw === "number" ? ctx.raw : ctx.raw?.y ?? 0;
|
|
57613
|
-
const formatted =
|
|
57973
|
+
const formatted = getNumberWithFormat(
|
|
57614
57974
|
value2,
|
|
57615
57975
|
formatOptions.toolTip?.toolTipDisplayUnits ?? "None",
|
|
57976
|
+
formatOptions.toolTip?.toolTipNumberFormat ?? ",",
|
|
57616
57977
|
formatOptions.toolTip?.toolTipDecimalPrecision ?? "2"
|
|
57617
57978
|
);
|
|
57618
57979
|
return ` ${ctx.dataset.label}: ${formatted}`;
|
|
@@ -57623,13 +57984,13 @@
|
|
|
57623
57984
|
// This block is only active when chartjs-plugin-datalabels is registered in ChartJSWrapper.
|
|
57624
57985
|
datalabels: buildDataLabelsConfig(formatOptions, chartType)
|
|
57625
57986
|
},
|
|
57626
|
-
animation: formatOptions.
|
|
57627
|
-
duration: formatOptions.
|
|
57987
|
+
animation: formatOptions.animation?.animationEnabled === true ? {
|
|
57988
|
+
duration: formatOptions.animation?.animationDuration ?? 1e3
|
|
57628
57989
|
} : false
|
|
57629
57990
|
};
|
|
57630
57991
|
if (!isCircular) {
|
|
57631
57992
|
const xScaleOptions = {
|
|
57632
|
-
display:
|
|
57993
|
+
display: true,
|
|
57633
57994
|
title: {
|
|
57634
57995
|
display: formatOptions.xAxisTitle?.xAxisTitleVisibility !== false,
|
|
57635
57996
|
text: formatOptions.xAxisTitle?.xAxisTitleText ?? "Dimension",
|
|
@@ -57641,14 +58002,16 @@
|
|
|
57641
58002
|
}
|
|
57642
58003
|
},
|
|
57643
58004
|
ticks: {
|
|
58005
|
+
display: formatOptions.xAxisLabel?.xAxisLabelVisibility !== false,
|
|
57644
58006
|
color: formatOptions.xAxisLabel?.xAxisLabelColor ?? "#000000",
|
|
57645
58007
|
font: {
|
|
57646
58008
|
size: parseInt(formatOptions.xAxisLabel?.xAxisLabelFontSize ?? "11", 10),
|
|
57647
58009
|
family: formatOptions.xAxisLabel?.xAxisLabelFontFamily ?? "Helvetica",
|
|
57648
|
-
style: getFontStyle(formatOptions.xAxisLabel?.xAxisLabelFontStyle)
|
|
58010
|
+
style: getFontStyle(formatOptions.xAxisLabel?.xAxisLabelFontStyle),
|
|
58011
|
+
weight: getFontWeight(formatOptions.xAxisLabel?.xAxisLabelFontStyle)
|
|
57649
58012
|
},
|
|
57650
|
-
maxRotation:
|
|
57651
|
-
minRotation: 0
|
|
58013
|
+
maxRotation: formatOptions.xAxisLabel?.xAxisLabelRotation ?? 0,
|
|
58014
|
+
minRotation: formatOptions.xAxisLabel?.xAxisLabelRotation ?? 0
|
|
57652
58015
|
},
|
|
57653
58016
|
grid: {
|
|
57654
58017
|
display: formatOptions.plotArea?.gridLinesVisibility !== false && formatOptions.plotArea?.gridLinesVertical !== false,
|
|
@@ -57660,7 +58023,7 @@
|
|
|
57660
58023
|
}
|
|
57661
58024
|
};
|
|
57662
58025
|
const yScaleOptions = {
|
|
57663
|
-
display:
|
|
58026
|
+
display: true,
|
|
57664
58027
|
position: "left",
|
|
57665
58028
|
title: {
|
|
57666
58029
|
display: formatOptions.yAxisTitle?.yAxisTitleVisibility !== false,
|
|
@@ -57673,11 +58036,13 @@
|
|
|
57673
58036
|
}
|
|
57674
58037
|
},
|
|
57675
58038
|
ticks: {
|
|
58039
|
+
display: formatOptions.yAxisLabel?.yAxisLabelVisibility !== false,
|
|
57676
58040
|
color: formatOptions.yAxisLabel?.yAxisLabelColor ?? "#000000",
|
|
57677
58041
|
font: {
|
|
57678
58042
|
size: parseInt(formatOptions.yAxisLabel?.yAxisLabelFontSize ?? "11", 10),
|
|
57679
58043
|
family: formatOptions.yAxisLabel?.yAxisLabelFontFamily ?? "Helvetica",
|
|
57680
|
-
style: getFontStyle(formatOptions.yAxisLabel?.yAxisLabelFontStyle)
|
|
58044
|
+
style: getFontStyle(formatOptions.yAxisLabel?.yAxisLabelFontStyle),
|
|
58045
|
+
weight: getFontWeight(formatOptions.yAxisLabel?.yAxisLabelFontStyle)
|
|
57681
58046
|
},
|
|
57682
58047
|
callback(value2) {
|
|
57683
58048
|
return formatValueForAxis(
|
|
@@ -57692,7 +58057,7 @@
|
|
|
57692
58057
|
color: gridColor
|
|
57693
58058
|
},
|
|
57694
58059
|
border: {
|
|
57695
|
-
color: formatOptions.yAxisLabel?.
|
|
58060
|
+
color: formatOptions.yAxisLabel?.yAxisColor ?? "#cccccc",
|
|
57696
58061
|
width: parseFloat(formatOptions.yAxisLabel?.yAxisWidth ?? "0.5")
|
|
57697
58062
|
}
|
|
57698
58063
|
};
|
|
@@ -57712,7 +58077,7 @@
|
|
|
57712
58077
|
}
|
|
57713
58078
|
if (hasSecondaryAxis) {
|
|
57714
58079
|
opts.scales.y1 = {
|
|
57715
|
-
display:
|
|
58080
|
+
display: true,
|
|
57716
58081
|
position: "right",
|
|
57717
58082
|
title: {
|
|
57718
58083
|
display: formatOptions.secondaryYAxisTitle?.secondaryYAxisTitleVisibility !== false,
|
|
@@ -57724,9 +58089,13 @@
|
|
|
57724
58089
|
}
|
|
57725
58090
|
},
|
|
57726
58091
|
ticks: {
|
|
58092
|
+
display: formatOptions.secondaryYAxisLabel?.secondaryYAxisLabelVisibility !== false,
|
|
57727
58093
|
color: formatOptions.secondaryYAxisLabel?.secondaryYAxisLabelColor ?? "#000000",
|
|
57728
58094
|
font: {
|
|
57729
|
-
size: parseInt(formatOptions.secondaryYAxisLabel?.secondaryYAxisLabelFontSize ?? "11", 10)
|
|
58095
|
+
size: parseInt(formatOptions.secondaryYAxisLabel?.secondaryYAxisLabelFontSize ?? "11", 10),
|
|
58096
|
+
family: formatOptions.secondaryYAxisLabel?.secondaryYAxisLabelFontFamily ?? "Helvetica",
|
|
58097
|
+
style: getFontStyle(formatOptions.secondaryYAxisLabel?.secondaryYAxisLabelFontStyle),
|
|
58098
|
+
weight: getFontWeight(formatOptions.secondaryYAxisLabel?.secondaryYAxisLabelFontStyle)
|
|
57730
58099
|
},
|
|
57731
58100
|
callback(value2) {
|
|
57732
58101
|
return formatValueForAxis(
|
|
@@ -57736,7 +58105,11 @@
|
|
|
57736
58105
|
);
|
|
57737
58106
|
}
|
|
57738
58107
|
},
|
|
57739
|
-
grid: { drawOnChartArea: false }
|
|
58108
|
+
grid: { drawOnChartArea: false },
|
|
58109
|
+
border: {
|
|
58110
|
+
color: formatOptions.secondaryYAxisLabel?.secondaryYAxisColor ?? "#000000",
|
|
58111
|
+
width: parseFloat(formatOptions.secondaryYAxisLabel?.secondaryYAxisWidth ?? "0.5")
|
|
58112
|
+
}
|
|
57740
58113
|
};
|
|
57741
58114
|
}
|
|
57742
58115
|
const isStacked2 = chartType.toLowerCase().includes("stack");
|
|
@@ -57758,6 +58131,7 @@
|
|
|
57758
58131
|
function buildDataLabelsConfig(formatOptions, chartType = "bar") {
|
|
57759
58132
|
const annotation2 = formatOptions.annotation;
|
|
57760
58133
|
const isCircular = chartType === "pie" || chartType === "doughnut" || chartType === "polarArea";
|
|
58134
|
+
const isHorizontal = chartType === "horizontalBar";
|
|
57761
58135
|
const visibilityStr = annotation2?.annotationVisibility ?? "5";
|
|
57762
58136
|
if (visibilityStr === "5" || !visibilityStr) {
|
|
57763
58137
|
return { display: false };
|
|
@@ -57769,7 +58143,8 @@
|
|
|
57769
58143
|
const fontStyle = getFontStyle(annotation2?.annotationFontStyle);
|
|
57770
58144
|
const fontWeight = getFontWeight(annotation2?.annotationFontStyle);
|
|
57771
58145
|
const labelColor = annotation2?.annotationColor ?? "#000000";
|
|
57772
|
-
const
|
|
58146
|
+
const useSeriesColor = annotation2?.annotationSetLabelColor === "2";
|
|
58147
|
+
const decimalPrecision = annotation2?.annotationDecimalPrecision ?? "2";
|
|
57773
58148
|
const numberFormat = annotation2?.annotationNumberFormat ?? ",";
|
|
57774
58149
|
const displayUnits = annotation2?.annotationDisplayUnits ?? "None";
|
|
57775
58150
|
function display(ctx) {
|
|
@@ -57819,14 +58194,25 @@
|
|
|
57819
58194
|
return positionStr === "2" ? "center" : "end";
|
|
57820
58195
|
}
|
|
57821
58196
|
const v = getCtxValue(ctx);
|
|
58197
|
+
if (isHorizontal) {
|
|
58198
|
+
switch (positionStr) {
|
|
58199
|
+
case "2":
|
|
58200
|
+
return "center";
|
|
58201
|
+
case "3":
|
|
58202
|
+
return "right";
|
|
58203
|
+
// baseline side → point into bar (rightward from zero for pos, rightward toward zero for neg)
|
|
58204
|
+
case "1":
|
|
58205
|
+
case "4":
|
|
58206
|
+
default:
|
|
58207
|
+
return v < 0 ? "left" : "right";
|
|
58208
|
+
}
|
|
58209
|
+
}
|
|
57822
58210
|
switch (positionStr) {
|
|
57823
58211
|
case "2":
|
|
57824
58212
|
return "center";
|
|
57825
58213
|
case "3":
|
|
57826
58214
|
return v > 0 ? "top" : "bottom";
|
|
57827
|
-
//
|
|
57828
|
-
// positive: above zero = inside bar base
|
|
57829
|
-
// negative: above extreme = toward zero = inside bar
|
|
58215
|
+
// inside bar near baseline
|
|
57830
58216
|
case "1":
|
|
57831
58217
|
case "4":
|
|
57832
58218
|
default:
|
|
@@ -57836,23 +58222,7 @@
|
|
|
57836
58222
|
function formatter2(raw, ctx) {
|
|
57837
58223
|
const v = getRawValue(raw);
|
|
57838
58224
|
if (hideZero && v === 0) return null;
|
|
57839
|
-
|
|
57840
|
-
if (displayUnits === "Thousands") scaled = v / 1e3;
|
|
57841
|
-
else if (displayUnits === "Millions") scaled = v / 1e6;
|
|
57842
|
-
else if (displayUnits === "Billions") scaled = v / 1e9;
|
|
57843
|
-
let formattedValue;
|
|
57844
|
-
if (numberFormat === ",.0%") {
|
|
57845
|
-
formattedValue = (scaled / 100).toLocaleString(void 0, {
|
|
57846
|
-
style: "percent",
|
|
57847
|
-
minimumFractionDigits: decimalPrecision,
|
|
57848
|
-
maximumFractionDigits: decimalPrecision
|
|
57849
|
-
});
|
|
57850
|
-
} else {
|
|
57851
|
-
formattedValue = scaled.toLocaleString(void 0, {
|
|
57852
|
-
minimumFractionDigits: decimalPrecision,
|
|
57853
|
-
maximumFractionDigits: decimalPrecision
|
|
57854
|
-
});
|
|
57855
|
-
}
|
|
58225
|
+
const formattedValue = getNumberWithFormat(v, displayUnits, numberFormat, decimalPrecision);
|
|
57856
58226
|
if (isCircular) {
|
|
57857
58227
|
const label = ctx?.chart?.data?.labels?.[ctx.dataIndex] ?? "";
|
|
57858
58228
|
return label ? `${label}
|
|
@@ -57865,7 +58235,12 @@ ${formattedValue}` : formattedValue;
|
|
|
57865
58235
|
anchor,
|
|
57866
58236
|
align,
|
|
57867
58237
|
offset: isCircular ? positionStr === "2" ? 0 : 8 : positionStr === "2" ? 0 : 4,
|
|
57868
|
-
color:
|
|
58238
|
+
color: useSeriesColor ? (ctx) => {
|
|
58239
|
+
const bg = ctx.dataset?.backgroundColor;
|
|
58240
|
+
const border = ctx.dataset?.borderColor;
|
|
58241
|
+
const c2 = Array.isArray(bg) ? bg[ctx.dataIndex] : bg;
|
|
58242
|
+
return typeof c2 === "string" && c2 ? c2 : typeof border === "string" && border ? border : labelColor;
|
|
58243
|
+
} : labelColor,
|
|
57869
58244
|
font: {
|
|
57870
58245
|
size: fontSize,
|
|
57871
58246
|
family: fontFamily,
|
|
@@ -72928,7 +73303,13 @@ ${formattedValue}` : formattedValue;
|
|
|
72928
73303
|
};
|
|
72929
73304
|
}, [chartType, data, options, isChartStacked]);
|
|
72930
73305
|
const bgColor = formatOptions.chartArea?.chartAreaColor ?? "#ffffff";
|
|
72931
|
-
|
|
73306
|
+
const titleFontStyle = Array.isArray(formatOptions.chartTitle?.chartTitleFontStyle) ? formatOptions.chartTitle.chartTitleFontStyle : [];
|
|
73307
|
+
const titleColor = formatOptions.chartTitle?.chartTitleColor && formatOptions.chartTitle.chartTitleColor !== "#ffffff" && formatOptions.chartTitle.chartTitleColor !== "#FFFFFF00" ? formatOptions.chartTitle.chartTitleColor : "rgba(119,119,119)";
|
|
73308
|
+
const titleFontSize = formatOptions.chartTitle?.chartTitleFontSize ? `${formatOptions.chartTitle.chartTitleFontSize}px` : "16px";
|
|
73309
|
+
const titleText = formatOptions.chartTitle?.dynamicTitleText || formatOptions.chartTitle?.chartTitleText || "";
|
|
73310
|
+
const titleHTML = formatOptions.chartTitle?.chartTitleHTML || titleText;
|
|
73311
|
+
const titleVisible = formatOptions.chartTitle?.chartTitleVisibility !== false;
|
|
73312
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
72932
73313
|
"div",
|
|
72933
73314
|
{
|
|
72934
73315
|
className,
|
|
@@ -72936,9 +73317,37 @@ ${formattedValue}` : formattedValue;
|
|
|
72936
73317
|
width: "100%",
|
|
72937
73318
|
height: "100%",
|
|
72938
73319
|
backgroundColor: bgColor,
|
|
72939
|
-
position: "relative"
|
|
73320
|
+
position: "relative",
|
|
73321
|
+
display: "flex",
|
|
73322
|
+
flexDirection: "column"
|
|
72940
73323
|
},
|
|
72941
|
-
children:
|
|
73324
|
+
children: [
|
|
73325
|
+
titleVisible && titleText && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
73326
|
+
"div",
|
|
73327
|
+
{
|
|
73328
|
+
id: "chartTitleId",
|
|
73329
|
+
className: "chartTiltle",
|
|
73330
|
+
title: formatOptions.chartTitle?.chartTitleText,
|
|
73331
|
+
style: {
|
|
73332
|
+
color: titleColor,
|
|
73333
|
+
fontSize: titleFontSize,
|
|
73334
|
+
fontFamily: formatOptions.chartTitle?.chartTitleFontFamily,
|
|
73335
|
+
fontStyle: titleFontStyle.includes("Italic") ? "italic" : "normal",
|
|
73336
|
+
fontWeight: titleFontStyle.includes("Bold") ? "bold" : "normal",
|
|
73337
|
+
textDecoration: titleFontStyle.includes("Underline") ? "underline" : "none",
|
|
73338
|
+
whiteSpace: "pre",
|
|
73339
|
+
textOverflow: "ellipsis",
|
|
73340
|
+
overflow: "hidden",
|
|
73341
|
+
lineHeight: "1.3em",
|
|
73342
|
+
userSelect: "none",
|
|
73343
|
+
padding: "2px 4px",
|
|
73344
|
+
flexShrink: 0
|
|
73345
|
+
},
|
|
73346
|
+
dangerouslySetInnerHTML: { __html: titleHTML }
|
|
73347
|
+
}
|
|
73348
|
+
),
|
|
73349
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { flex: 1, minHeight: 0 }, children: /* @__PURE__ */ jsxRuntimeExports.jsx("canvas", { ref: canvasRef, style: { width: "100%", height: "100%" } }) })
|
|
73350
|
+
]
|
|
72942
73351
|
}
|
|
72943
73352
|
);
|
|
72944
73353
|
};
|