pace-chart-lib 1.0.57 → 1.0.59
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.
|
@@ -188,12 +188,13 @@ export type TAnnotationObject = {
|
|
|
188
188
|
valueFontStyle: string[];
|
|
189
189
|
isVisible: boolean;
|
|
190
190
|
};
|
|
191
|
-
dx:
|
|
192
|
-
dy:
|
|
191
|
+
dx: number;
|
|
192
|
+
dy: number;
|
|
193
193
|
connector: {
|
|
194
194
|
end: string;
|
|
195
195
|
curve: d3.CurveFactory;
|
|
196
196
|
};
|
|
197
|
+
disable?: string[];
|
|
197
198
|
subject: {
|
|
198
199
|
height: number;
|
|
199
200
|
width: number;
|
|
@@ -10868,11 +10868,6 @@ const AnnotationTypeMap = {
|
|
|
10868
10868
|
4: d3CalloutElbow,
|
|
10869
10869
|
5: d3CalloutCurve
|
|
10870
10870
|
};
|
|
10871
|
-
const ConnectedStyle = {
|
|
10872
|
-
"solid": "unset",
|
|
10873
|
-
"Dotted": "2",
|
|
10874
|
-
"Dashed": "7"
|
|
10875
|
-
};
|
|
10876
10871
|
var staticLegendPosition = /* @__PURE__ */ ((staticLegendPosition2) => {
|
|
10877
10872
|
staticLegendPosition2["left"] = "Left";
|
|
10878
10873
|
staticLegendPosition2["right"] = "Right";
|
|
@@ -13125,10 +13120,20 @@ function getCurveType(formatOptions) {
|
|
|
13125
13120
|
}
|
|
13126
13121
|
function getSlicedLegendForTornado(legend) {
|
|
13127
13122
|
const index2 = legend.indexOf(" - ");
|
|
13128
|
-
if (index2 == -1) return
|
|
13123
|
+
if (index2 == -1) return tornadoEntryName.default;
|
|
13129
13124
|
return legend.slice(index2 + 3);
|
|
13130
13125
|
}
|
|
13131
13126
|
const getHoverText = (d, isAATornado) => isAATornado ? d?.legend?.split(" - ")[0] : d?.properties?.alias || d?.properties?.name || "Legend";
|
|
13127
|
+
function getCurvePoints(dx, dy) {
|
|
13128
|
+
return [
|
|
13129
|
+
[0, 0],
|
|
13130
|
+
// start (anchor)
|
|
13131
|
+
[dx / 2, dy / 2],
|
|
13132
|
+
// control (curve bend)
|
|
13133
|
+
[dx, dy]
|
|
13134
|
+
// end (label)
|
|
13135
|
+
];
|
|
13136
|
+
}
|
|
13132
13137
|
function commonAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin, d3Annotation2, labelExcludeList, individualLabelColor, formatOptions, chartType, height, width, innerWidth2, dimensionList, innerHeight2, widgetId, svg, onDataLabelCoordinatesChange, xScaleForLegends, columnWidth, isReportEditable, isSensitivityChart, barChart, isAATornado) {
|
|
13133
13138
|
try {
|
|
13134
13139
|
const isTornadoChart = chartType === chartTypes.TornadoChart;
|
|
@@ -13136,6 +13141,7 @@ function commonAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin, d
|
|
|
13136
13141
|
let annotationType = formatOptions.annotation.annotationType ?? "1";
|
|
13137
13142
|
let annotationPosition = formatOptions.annotation.annotationPosition.toString() != "4" ? formatOptions.annotation.annotationPosition : null;
|
|
13138
13143
|
let dataLabelColor = formatOptions?.annotation?.annotationSetLabelColor == "2" ? "color" : "labelColor";
|
|
13144
|
+
const isCurve = formatOptions.annotation.connectorType?.toLowerCase() === "curve";
|
|
13139
13145
|
if (formatOptions.annotation.annotationVisibility) {
|
|
13140
13146
|
let Disable = [annotationType == "1" ? "connector" : ""];
|
|
13141
13147
|
let labelData = [];
|
|
@@ -13366,7 +13372,8 @@ function commonAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin, d
|
|
|
13366
13372
|
dy: 0,
|
|
13367
13373
|
connector: {
|
|
13368
13374
|
end: connectorType,
|
|
13369
|
-
curve: connecterCurve[formatOptions.annotation.connectorCurve]
|
|
13375
|
+
curve: connecterCurve[formatOptions.annotation.connectorCurve],
|
|
13376
|
+
points: isCurve ? getCurvePoints(0, 0) : [[0, 0], [0, 0]]
|
|
13370
13377
|
},
|
|
13371
13378
|
disable: Disable,
|
|
13372
13379
|
subject: {
|
|
@@ -13424,12 +13431,10 @@ function commonAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin, d
|
|
|
13424
13431
|
newAnnotation.dx = old.dx;
|
|
13425
13432
|
newAnnotation.dy = old.dy;
|
|
13426
13433
|
newAnnotation.data.isVisible = old.isVisible ?? true;
|
|
13427
|
-
|
|
13428
|
-
|
|
13429
|
-
|
|
13430
|
-
|
|
13431
|
-
[0, 0]
|
|
13432
|
-
];
|
|
13434
|
+
if (old?.connectorPoints && old.connectorPoints.length >= (isCurve ? 3 : 2)) {
|
|
13435
|
+
newAnnotation.connector.points = old.connectorPoints;
|
|
13436
|
+
} else {
|
|
13437
|
+
newAnnotation.connector.points = isCurve ? getCurvePoints(newAnnotation.dx, newAnnotation.dy) : [[0, 0], [0, 0]];
|
|
13433
13438
|
}
|
|
13434
13439
|
}
|
|
13435
13440
|
}
|
|
@@ -13492,7 +13497,7 @@ function commonAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin, d
|
|
|
13492
13497
|
if (d.data?.legendUniqueId == annotation2.data.legendUniqueId || d.legendUniqueId == annotation2.data.legendUniqueId) {
|
|
13493
13498
|
d.dx = annotation2._dx * width / d.width;
|
|
13494
13499
|
d.dy = annotation2._dy * height / d.height;
|
|
13495
|
-
d.connectorPoints = annotation2.connector
|
|
13500
|
+
d.connectorPoints = annotation2.connector?.points?.map((p) => [...p]) || [];
|
|
13496
13501
|
}
|
|
13497
13502
|
});
|
|
13498
13503
|
if (onDataLabelCoordinatesChange) {
|
|
@@ -13582,6 +13587,7 @@ function commonAnnotationsForCustomChart(chartData, xScale, yScaleLeft, yScaleRi
|
|
|
13582
13587
|
let stackData = [];
|
|
13583
13588
|
let getChartType = [];
|
|
13584
13589
|
let connectorType = formatOptions.annotation.connectorType ? formatOptions.annotation.connectorType.toLowerCase() : "None";
|
|
13590
|
+
const isCurve = formatOptions.annotation.connectorType?.toLowerCase() === "curve";
|
|
13585
13591
|
let oldAnnotationList = JSON.parse(JSON.stringify(formatOptions.plotArea.dataLabelsCoordinates));
|
|
13586
13592
|
oldAnnotationList = conditionallyResetOldAnnotations(oldAnnotationList, formatOptions, chartTypes.CustomColumnChart);
|
|
13587
13593
|
let annotationsList = [];
|
|
@@ -13913,7 +13919,8 @@ function commonAnnotationsForCustomChart(chartData, xScale, yScaleLeft, yScaleRi
|
|
|
13913
13919
|
dy: 0,
|
|
13914
13920
|
connector: {
|
|
13915
13921
|
end: connectorType,
|
|
13916
|
-
curve: connecterCurve[formatOptions.annotation.connectorCurve]
|
|
13922
|
+
curve: connecterCurve[formatOptions.annotation.connectorCurve],
|
|
13923
|
+
points: isCurve ? getCurvePoints(0, 0) : [[0, 0], [0, 0]]
|
|
13917
13924
|
},
|
|
13918
13925
|
disable: Disable,
|
|
13919
13926
|
subject: {
|
|
@@ -13935,6 +13942,9 @@ function commonAnnotationsForCustomChart(chartData, xScale, yScaleLeft, yScaleRi
|
|
|
13935
13942
|
!labelExcludeList.includes(d["key"]) && (d.data.axis == axisTypes.primary ? yScaleLeft(d[1]) <= innerHeight2 && yScaleLeft(d[1]) >= 0 : yScaleRight(d[1]) <= innerHeight2 && yScaleRight(d[1]) >= 0) ? annotationsList.push(singleAnnotation) : null
|
|
13936
13943
|
);
|
|
13937
13944
|
});
|
|
13945
|
+
if (formatOptions.annotation.annotationHideZeroValues) {
|
|
13946
|
+
annotationsList = annotationsList.filter((d) => d.data.y !== 0);
|
|
13947
|
+
}
|
|
13938
13948
|
if (oldAnnotationList.length === 0) {
|
|
13939
13949
|
oldAnnotationList = annotationsList;
|
|
13940
13950
|
oldMap = new Map(
|
|
@@ -13969,7 +13979,11 @@ function commonAnnotationsForCustomChart(chartData, xScale, yScaleLeft, yScaleRi
|
|
|
13969
13979
|
newAnnotation.dx = old.dx;
|
|
13970
13980
|
newAnnotation.dy = old.dy;
|
|
13971
13981
|
newAnnotation.data.isVisible = old.isVisible ?? true;
|
|
13972
|
-
|
|
13982
|
+
if (old?.connectorPoints && old.connectorPoints.length >= (isCurve ? 3 : 2)) {
|
|
13983
|
+
newAnnotation.connector.points = old.connectorPoints;
|
|
13984
|
+
} else {
|
|
13985
|
+
newAnnotation.connector.points = isCurve ? getCurvePoints(newAnnotation.dx, newAnnotation.dy) : [[0, 0], [0, 0]];
|
|
13986
|
+
}
|
|
13973
13987
|
if (formatOptions.annotation.annotationType == "5" && newAnnotation.dx == 0 && newAnnotation.dy == 0) {
|
|
13974
13988
|
newAnnotation.connector["points"] = [
|
|
13975
13989
|
[0, 0],
|
|
@@ -14023,7 +14037,7 @@ function commonAnnotationsForCustomChart(chartData, xScale, yScaleLeft, yScaleRi
|
|
|
14023
14037
|
if (d.data?.legendUniqueId == annotation2.data.legendUniqueId || d.legendUniqueId == annotation2.data.legendUniqueId) {
|
|
14024
14038
|
d.dx = annotation2._dx * width / d.width;
|
|
14025
14039
|
d.dy = annotation2._dy * height / d.height;
|
|
14026
|
-
d.connectorPoints = annotation2.connector
|
|
14040
|
+
d.connectorPoints = annotation2.connector?.points?.map((p) => [...p]) || [];
|
|
14027
14041
|
}
|
|
14028
14042
|
});
|
|
14029
14043
|
if (onDataLabelCoordinatesChange) {
|
|
@@ -15265,6 +15279,7 @@ function stacklineAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin
|
|
|
15265
15279
|
let dataLabelColor = formatOptions?.annotation?.annotationSetLabelColor == "2" ? "color" : "labelColor";
|
|
15266
15280
|
let fontStyle = formatOptions.annotation.annotationFontStyle;
|
|
15267
15281
|
let connectorType = formatOptions.annotation.connectorType ? formatOptions.annotation.connectorType.toLowerCase() : "None";
|
|
15282
|
+
const isCurve = formatOptions.annotation.connectorType?.toLowerCase() === "curve";
|
|
15268
15283
|
let oldAnnotationList = JSON.parse(JSON.stringify(formatOptions.plotArea.dataLabelsCoordinates));
|
|
15269
15284
|
oldAnnotationList = conditionallyResetOldAnnotations(oldAnnotationList, formatOptions, chartType);
|
|
15270
15285
|
let annotationsList = [];
|
|
@@ -15369,7 +15384,8 @@ function stacklineAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin
|
|
|
15369
15384
|
dy: 0,
|
|
15370
15385
|
connector: {
|
|
15371
15386
|
end: connectorType,
|
|
15372
|
-
curve: connecterCurve[formatOptions.annotation.connectorCurve]
|
|
15387
|
+
curve: connecterCurve[formatOptions.annotation.connectorCurve],
|
|
15388
|
+
points: isCurve ? getCurvePoints(0, 0) : [[0, 0], [0, 0]]
|
|
15373
15389
|
},
|
|
15374
15390
|
disable: Disable,
|
|
15375
15391
|
subject: {
|
|
@@ -15419,12 +15435,10 @@ function stacklineAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin
|
|
|
15419
15435
|
newAnnotation.dx = old.dx;
|
|
15420
15436
|
newAnnotation.dy = old.dy;
|
|
15421
15437
|
newAnnotation.data.isVisible = old.isVisible ?? true;
|
|
15422
|
-
|
|
15423
|
-
|
|
15424
|
-
|
|
15425
|
-
|
|
15426
|
-
[0, 0]
|
|
15427
|
-
];
|
|
15438
|
+
if (old?.connectorPoints && old.connectorPoints.length >= (isCurve ? 3 : 2)) {
|
|
15439
|
+
newAnnotation.connector.points = old.connectorPoints;
|
|
15440
|
+
} else {
|
|
15441
|
+
newAnnotation.connector.points = isCurve ? getCurvePoints(newAnnotation.dx, newAnnotation.dy) : [[0, 0], [0, 0]];
|
|
15428
15442
|
}
|
|
15429
15443
|
}
|
|
15430
15444
|
}
|
|
@@ -15460,7 +15474,7 @@ function stacklineAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin
|
|
|
15460
15474
|
if (d.data?.legendUniqueId == annotation2.data.legendUniqueId || d.legendUniqueId == annotation2.data.legendUniqueId) {
|
|
15461
15475
|
d.dx = annotation2._dx * width / d.width;
|
|
15462
15476
|
d.dy = annotation2._dy * height / d.height;
|
|
15463
|
-
d.connectorPoints = annotation2.connector
|
|
15477
|
+
d.connectorPoints = annotation2.connector?.points?.map((p) => [...p]) || [];
|
|
15464
15478
|
}
|
|
15465
15479
|
});
|
|
15466
15480
|
if (onDataLabelCoordinatesChange) {
|
|
@@ -21380,6 +21394,7 @@ function pieFamilyAnnotation(d3Annotation2, chartData, formatOptions, getPiePosi
|
|
|
21380
21394
|
const AnnotationType = formatOptions.plotArea.annotationType ?? "1";
|
|
21381
21395
|
const Disable = [AnnotationType === "1" ? "connector" : ""];
|
|
21382
21396
|
const ConnectorType = formatOptions.plotArea.connectorType?.toLowerCase() ?? "none";
|
|
21397
|
+
const isCurve = AnnotationType === "5";
|
|
21383
21398
|
const rotationAngle = formatOptions.plotArea.rotation ?? 0;
|
|
21384
21399
|
const multiplicationFactor = chartType === chartTypes.PieChart ? 1.06 : 1.1;
|
|
21385
21400
|
const connecterCurve2 = {
|
|
@@ -21387,6 +21402,11 @@ function pieFamilyAnnotation(d3Annotation2, chartData, formatOptions, getPiePosi
|
|
|
21387
21402
|
"2": curveLinear$1,
|
|
21388
21403
|
"3": step
|
|
21389
21404
|
};
|
|
21405
|
+
const getCurvePoints2 = (dx, dy) => [
|
|
21406
|
+
[0, 0],
|
|
21407
|
+
[dx / 2, dy / 2],
|
|
21408
|
+
[dx, dy]
|
|
21409
|
+
];
|
|
21390
21410
|
const connectedStyle2 = {
|
|
21391
21411
|
solid: "unset",
|
|
21392
21412
|
dotted: "2,2",
|
|
@@ -21442,12 +21462,13 @@ function pieFamilyAnnotation(d3Annotation2, chartData, formatOptions, getPiePosi
|
|
|
21442
21462
|
dy: 0,
|
|
21443
21463
|
connector: {
|
|
21444
21464
|
end: ConnectorType,
|
|
21445
|
-
curve: connecterCurve2[formatOptions.plotArea.connectorCurve]
|
|
21465
|
+
curve: connecterCurve2[formatOptions.plotArea.connectorCurve],
|
|
21466
|
+
points: isCurve ? getCurvePoints2(0, 0) : [[0, 0], [0, 0]]
|
|
21446
21467
|
},
|
|
21447
21468
|
disable: Disable,
|
|
21448
21469
|
subject: { radius: 3 },
|
|
21449
21470
|
type: annotationTypeforCharts(d3Annotation2, AnnotationType),
|
|
21450
|
-
color: formatOptions.plotArea.
|
|
21471
|
+
color: formatOptions.plotArea.connectorColor ?? "#ccc",
|
|
21451
21472
|
width,
|
|
21452
21473
|
height,
|
|
21453
21474
|
index: index2
|
|
@@ -21477,7 +21498,11 @@ function pieFamilyAnnotation(d3Annotation2, chartData, formatOptions, getPiePosi
|
|
|
21477
21498
|
newAnnotation.dy = old.dy * scaleFactor;
|
|
21478
21499
|
}
|
|
21479
21500
|
newAnnotation.data.isVisible = old.data?.isVisible ?? true;
|
|
21480
|
-
|
|
21501
|
+
if (old.connectorPoints?.length >= (isCurve ? 3 : 2)) {
|
|
21502
|
+
newAnnotation.connector.points = old.connectorPoints;
|
|
21503
|
+
} else {
|
|
21504
|
+
newAnnotation.connector.points = isCurve ? getCurvePoints2(newAnnotation.dx, newAnnotation.dy) : [[0, 0], [0, 0]];
|
|
21505
|
+
}
|
|
21481
21506
|
}
|
|
21482
21507
|
finalAnnotationList.push(newAnnotation);
|
|
21483
21508
|
});
|
|
@@ -21523,6 +21548,26 @@ function pieFamilyAnnotation(d3Annotation2, chartData, formatOptions, getPiePosi
|
|
|
21523
21548
|
}
|
|
21524
21549
|
}).annotations(finalAnnotationList);
|
|
21525
21550
|
const annotations = svg.append("g").attr("class", "annotation-group parentGroup").attr("transform", getPiePosition).call(makeAnnotations);
|
|
21551
|
+
const fontStyleName = formatOptions.plotArea.dataLabelNameFontStyle ?? [];
|
|
21552
|
+
annotations.selectAll(".annotation-note-title").style("font-family", formatOptions.plotArea.dataLabelNameFontFamily).style("font-size", `${formatOptions.plotArea.dataLabelNameFontSize}px`).style("font-style", fontStyleName.includes("Italic") ? "italic" : "").style("text-decoration", fontStyleName.includes("Underline") ? "underline" : "").style("font-weight", fontStyleName.includes("Bold") ? "bold" : "").style("fill", formatOptions.plotArea.dataLabelNameColor ?? "#000");
|
|
21553
|
+
const fontStyleValue = formatOptions.plotArea.dataLabelValueFontStyle ?? [];
|
|
21554
|
+
annotations.selectAll(".annotation-note-label").style("font-family", formatOptions.plotArea.dataLabelValueFontFamily).style("font-size", `${formatOptions.plotArea.dataLabelValueFontSize}px`).style("font-style", fontStyleValue.includes("Italic") ? "italic" : "").style("text-decoration", fontStyleValue.includes("Underline") ? "underline" : "").style("font-weight", fontStyleValue.includes("Bold") ? "bold" : "").style("fill", formatOptions.plotArea.dataLabelValueColor ?? "#000");
|
|
21555
|
+
if (formatOptions.plotArea.plotAreaAbsoluteValue) {
|
|
21556
|
+
annotations.selectAll(".annotation-note-label").each(function(d) {
|
|
21557
|
+
const labelEl = select$2(this);
|
|
21558
|
+
const absText = format(".2s")(Math.abs(d.data.y.value));
|
|
21559
|
+
labelEl.append("tspan").attr("x", labelEl.attr("x") ?? "0").attr("dy", "1.2em").attr("fill-opacity", 0.5).attr("font-weight", "300").style("font-family", formatOptions.plotArea.dataLabelValueFontFamily).style("font-size", `${formatOptions.plotArea.dataLabelValueFontSize}px`).style("fill", formatOptions.plotArea.dataLabelValueColor ?? "#000").text(absText);
|
|
21560
|
+
});
|
|
21561
|
+
}
|
|
21562
|
+
if (ConnectorType === "diamond") {
|
|
21563
|
+
const connectorColor2 = formatOptions.plotArea.connectorColor ?? "#ccc";
|
|
21564
|
+
const size = 5;
|
|
21565
|
+
annotations.selectAll(".annotation-connector").each(function() {
|
|
21566
|
+
if (!select$2(this).select("path.connector").empty()) {
|
|
21567
|
+
select$2(this).append("polygon").attr("class", "connector-end connector-diamond").attr("points", `0,${-size} ${size},0 0,${size} ${-size},0`).style("fill", connectorColor2).style("stroke", connectorColor2);
|
|
21568
|
+
}
|
|
21569
|
+
});
|
|
21570
|
+
}
|
|
21526
21571
|
annotations.selectAll("rect,.annotation-subject").remove();
|
|
21527
21572
|
if (formatOptions.animation?.animationEnabled) {
|
|
21528
21573
|
const duration = formatOptions.animation.animationDuration;
|
|
@@ -21533,10 +21578,12 @@ function pieFamilyAnnotation(d3Annotation2, chartData, formatOptions, getPiePosi
|
|
|
21533
21578
|
labels.transition().delay((d, i) => i * 30).duration(duration).ease(ease).style("opacity", 1);
|
|
21534
21579
|
}, 50);
|
|
21535
21580
|
}
|
|
21536
|
-
|
|
21581
|
+
const connectorColor = formatOptions.plotArea.connectorColor ?? "#ccc";
|
|
21582
|
+
annotations.selectAll(".connector").style("stroke", connectorColor).attr(
|
|
21537
21583
|
"stroke-dasharray",
|
|
21538
21584
|
connectedStyle2[formatOptions.plotArea.connectorStyle?.toLowerCase()]
|
|
21539
21585
|
);
|
|
21586
|
+
annotations.selectAll(".connector-end").style("fill", connectorColor).style("stroke", connectorColor);
|
|
21540
21587
|
annotations.selectAll(".annotation-note-label").filter((d) => !d.data.isVisible).style("display", "none");
|
|
21541
21588
|
annotations.selectAll(".annotation-note-label").filter((d) => formatOptions.plotArea.hideInsignificantValue && d.data.x1 - d.data.x0 < 0.09).style("visibility", "hidden");
|
|
21542
21589
|
} catch (error) {
|
|
@@ -26000,8 +26047,8 @@ const LayeredHorizontalBarChart = ({
|
|
|
26000
26047
|
onDataLabelCoordinatesChange,
|
|
26001
26048
|
void 0,
|
|
26002
26049
|
columnWidth,
|
|
26003
|
-
false,
|
|
26004
26050
|
isReportEditable,
|
|
26051
|
+
false,
|
|
26005
26052
|
barChart
|
|
26006
26053
|
);
|
|
26007
26054
|
getConnectors();
|
|
@@ -30166,7 +30213,8 @@ const fileName$4 = "PyramidChart.tsx";
|
|
|
30166
30213
|
const PyramidChart = ({
|
|
30167
30214
|
data,
|
|
30168
30215
|
formatOptions,
|
|
30169
|
-
chartId
|
|
30216
|
+
chartId,
|
|
30217
|
+
onDataLabelCoordinatesChange
|
|
30170
30218
|
}) => {
|
|
30171
30219
|
const svgRef = useRef();
|
|
30172
30220
|
let seriesData = generalizedChartData(data.ChartData);
|
|
@@ -30329,14 +30377,11 @@ const PyramidChart = ({
|
|
|
30329
30377
|
};
|
|
30330
30378
|
const pyramidAnnotations = (oldAnnotationList) => {
|
|
30331
30379
|
try {
|
|
30332
|
-
const self = void 0;
|
|
30333
|
-
let AnnotationType = chartFormatOptions.annotation.annotationType ?? "1";
|
|
30334
30380
|
if (chartFormatOptions.annotation.annotationVisibility) {
|
|
30335
|
-
let Disable = [AnnotationType == "1" ? "connector" : ""];
|
|
30336
30381
|
let makeAnnotations = annotation();
|
|
30337
30382
|
let ConnectorType = chartFormatOptions.annotation.connectorType ? chartFormatOptions.annotation.connectorType.toLowerCase() : "None";
|
|
30338
|
-
let AnnotationsList = annotationsList;
|
|
30339
30383
|
let finalAnnotationList = annotationsList;
|
|
30384
|
+
const connectorStyleKey = chartFormatOptions.annotation.connectorStyle?.toLowerCase();
|
|
30340
30385
|
makeAnnotations.editMode(chartFormatOptions.annotation.annotationDraggable).accessors({
|
|
30341
30386
|
x: function() {
|
|
30342
30387
|
return innerWidth2 * 0.5;
|
|
@@ -30346,13 +30391,29 @@ const PyramidChart = ({
|
|
|
30346
30391
|
}
|
|
30347
30392
|
}).on("dragend", function(annotation2) {
|
|
30348
30393
|
try {
|
|
30394
|
+
finalAnnotationList.forEach((d) => {
|
|
30395
|
+
if (d.data.legend === annotation2.data.legend) {
|
|
30396
|
+
d.dx = annotation2._dx;
|
|
30397
|
+
d.dy = annotation2._dy;
|
|
30398
|
+
d.width = width;
|
|
30399
|
+
d.height = height;
|
|
30400
|
+
}
|
|
30401
|
+
});
|
|
30402
|
+
if (onDataLabelCoordinatesChange) {
|
|
30403
|
+
onDataLabelCoordinatesChange(
|
|
30404
|
+
finalAnnotationList.map((d) => ({
|
|
30405
|
+
data: { legend: d.data.legend, isVisible: d.data.isVisible ?? true },
|
|
30406
|
+
dx: d.dx,
|
|
30407
|
+
dy: d.dy,
|
|
30408
|
+
width,
|
|
30409
|
+
height
|
|
30410
|
+
}))
|
|
30411
|
+
);
|
|
30412
|
+
}
|
|
30349
30413
|
annotations.selectAll(".connector").attr("hoverId", (d) => d.data.legend.replace(/\s+/g, "-")).style(
|
|
30350
30414
|
"stroke",
|
|
30351
30415
|
chartFormatOptions.annotation.connectorColor || "#ccc"
|
|
30352
|
-
).attr(
|
|
30353
|
-
"stroke-dasharray",
|
|
30354
|
-
ConnectedStyle[chartFormatOptions.annotation.connectorStyle]
|
|
30355
|
-
);
|
|
30416
|
+
).attr("stroke-dasharray", connectedStyle[connectorStyleKey]);
|
|
30356
30417
|
annotations.selectAll(`.connector-${ConnectorType}`).attr(
|
|
30357
30418
|
"fill",
|
|
30358
30419
|
chartFormatOptions.annotation.connectorColor || "#ccc"
|
|
@@ -30363,10 +30424,7 @@ const PyramidChart = ({
|
|
|
30363
30424
|
annotations.selectAll(".note-line").attr("hoverId", (d) => d.data.currentLegend.replace(/\s+/g, "-")).style(
|
|
30364
30425
|
"stroke",
|
|
30365
30426
|
chartFormatOptions.annotation.connectorColor || "#ccc"
|
|
30366
|
-
).attr(
|
|
30367
|
-
"stroke-dasharray",
|
|
30368
|
-
ConnectedStyle[chartFormatOptions.annotation.connectorStyle]
|
|
30369
|
-
).filter((d) => d._dx == 0 && d._dy == 0).remove();
|
|
30427
|
+
).attr("stroke-dasharray", connectedStyle[connectorStyleKey]).filter((d) => d._dx == 0 && d._dy == 0).remove();
|
|
30370
30428
|
annotations.selectAll(".annotation-note-label").filter((d) => d.data && d.data.isVisible).style("display", "block");
|
|
30371
30429
|
annotations.selectAll(".annotation-note-title").filter((d) => d.data && d.data.isVisible).style("display", "block");
|
|
30372
30430
|
} catch (error) {
|
|
@@ -30379,10 +30437,7 @@ const PyramidChart = ({
|
|
|
30379
30437
|
annotations.selectAll(".connector").style(
|
|
30380
30438
|
"stroke",
|
|
30381
30439
|
chartFormatOptions.annotation.connectorColor || "#ccc"
|
|
30382
|
-
).attr(
|
|
30383
|
-
"stroke-dasharray",
|
|
30384
|
-
ConnectedStyle[chartFormatOptions.annotation.connectorStyle]
|
|
30385
|
-
);
|
|
30440
|
+
).attr("stroke-dasharray", connectedStyle[connectorStyleKey]);
|
|
30386
30441
|
annotations.selectAll(`.connector-${ConnectorType}`).attr("fill", chartFormatOptions.annotation.connectorColor || "#ccc").style(
|
|
30387
30442
|
"stroke",
|
|
30388
30443
|
chartFormatOptions.annotation.connectorColor || "#ccc"
|
|
@@ -30390,10 +30445,7 @@ const PyramidChart = ({
|
|
|
30390
30445
|
annotations.selectAll(".note-line").style(
|
|
30391
30446
|
"stroke",
|
|
30392
30447
|
chartFormatOptions.annotation.connectorColor || "#ccc"
|
|
30393
|
-
).attr(
|
|
30394
|
-
"stroke-dasharray",
|
|
30395
|
-
ConnectedStyle[chartFormatOptions.annotation.connectorStyle]
|
|
30396
|
-
).filter((d) => d._dx == 0 && d._dy == 0).remove();
|
|
30448
|
+
).attr("stroke-dasharray", connectedStyle[connectorStyleKey]).filter((d) => d._dx == 0 && d._dy == 0).remove();
|
|
30397
30449
|
annotations.selectAll(".connector-end").filter((d) => d.connector.end == "dot" && d._dx == 0 && d._dy == 0).remove();
|
|
30398
30450
|
annotations.selectAll(".annotation-note-label").filter((d) => d.data && !d.data.isVisible).style("display", "none");
|
|
30399
30451
|
annotations.selectAll(".annotation-note-title").filter((d) => d.data && !d.data.isVisible).style("display", "none");
|
|
@@ -30439,7 +30491,12 @@ const PyramidChart = ({
|
|
|
30439
30491
|
const prepareNewAnnotationsList = () => {
|
|
30440
30492
|
try {
|
|
30441
30493
|
let annotationType = chartFormatOptions.annotation.annotationType ?? "1";
|
|
30494
|
+
let disable = [annotationType == "1" ? "connector" : ""];
|
|
30442
30495
|
let connectorType = chartFormatOptions.annotation.connectorType ? chartFormatOptions.annotation.connectorType.toLowerCase() : "none";
|
|
30496
|
+
const savedList = JSON.parse(
|
|
30497
|
+
JSON.stringify(chartFormatOptions.plotArea.dataLabelsCoordinates || [])
|
|
30498
|
+
);
|
|
30499
|
+
const oldMap = new Map(savedList.map((d) => [d.data?.legend, d]));
|
|
30443
30500
|
annotationsList = [];
|
|
30444
30501
|
seriesData.forEach((d, i) => {
|
|
30445
30502
|
try {
|
|
@@ -30484,6 +30541,7 @@ const PyramidChart = ({
|
|
|
30484
30541
|
end: connectorType,
|
|
30485
30542
|
curve: ConnecterCurve[chartFormatOptions.annotation.connectorCurve]
|
|
30486
30543
|
},
|
|
30544
|
+
disable,
|
|
30487
30545
|
subject: {
|
|
30488
30546
|
height: 15,
|
|
30489
30547
|
width: 15
|
|
@@ -30494,6 +30552,12 @@ const PyramidChart = ({
|
|
|
30494
30552
|
width,
|
|
30495
30553
|
index: i
|
|
30496
30554
|
};
|
|
30555
|
+
const old = oldMap.get(d.legend);
|
|
30556
|
+
if (old) {
|
|
30557
|
+
singleAnnotation.dx = old.dx * width / (old.width || width);
|
|
30558
|
+
singleAnnotation.dy = old.dy * height / (old.height || height);
|
|
30559
|
+
singleAnnotation.data.isVisible = old.data?.isVisible ?? true;
|
|
30560
|
+
}
|
|
30497
30561
|
annotationsList.push(singleAnnotation);
|
|
30498
30562
|
} catch (error) {
|
|
30499
30563
|
logError$2(fileName$4, "prepareNewAnnotationsList.forEach", error);
|
|
@@ -57660,11 +57724,11 @@ function getBorderDash(lineStyle) {
|
|
|
57660
57724
|
return [];
|
|
57661
57725
|
}
|
|
57662
57726
|
function transformToChartJSData(chartData, chartType, formatOptions, colorBank = CJS_DEFAULT_COLORS) {
|
|
57663
|
-
const { ChartData: seriesList, DimensionList } = chartData;
|
|
57727
|
+
const { ChartData: seriesList, DimensionList, LegendList } = chartData;
|
|
57664
57728
|
const labels = DimensionList?.length ? DimensionList : seriesList[0]?.data?.map((d) => d.dimension) ?? [];
|
|
57665
57729
|
const fillOpacity = Number(formatOptions.plotArea?.fillOpacity ?? 0.8);
|
|
57666
57730
|
if (chartType === "pie" || chartType === "doughnut" || chartType === "polarArea") {
|
|
57667
|
-
return buildCircularData(seriesList, labels, fillOpacity, colorBank);
|
|
57731
|
+
return buildCircularData(seriesList, labels, fillOpacity, colorBank, LegendList);
|
|
57668
57732
|
}
|
|
57669
57733
|
if (chartType === "scatter") {
|
|
57670
57734
|
return buildScatterData(seriesList, colorBank);
|
|
@@ -57725,16 +57789,17 @@ function buildCartesianData(seriesList, labels, chartType, formatOptions, fillOp
|
|
|
57725
57789
|
});
|
|
57726
57790
|
return { labels, datasets };
|
|
57727
57791
|
}
|
|
57728
|
-
function buildCircularData(seriesList, labels, fillOpacity, colorBank) {
|
|
57792
|
+
function buildCircularData(seriesList, labels, fillOpacity, colorBank, legendList) {
|
|
57729
57793
|
const allSeries = seriesList.length ? seriesList : [];
|
|
57730
57794
|
const datasets = allSeries.map((series) => {
|
|
57731
57795
|
const values = labels.map((lbl) => {
|
|
57732
57796
|
const pt = series.data?.find((d) => d.dimension === lbl);
|
|
57733
57797
|
return pt?.value ?? 0;
|
|
57734
57798
|
});
|
|
57735
|
-
const backgroundColors = labels.map(
|
|
57736
|
-
|
|
57737
|
-
|
|
57799
|
+
const backgroundColors = labels.map((_, i) => {
|
|
57800
|
+
const legendColor = legendList?.[i]?.color;
|
|
57801
|
+
return hexToRgba(legendColor ?? colorBank[i % colorBank.length], fillOpacity);
|
|
57802
|
+
});
|
|
57738
57803
|
return {
|
|
57739
57804
|
label: series.properties.alias,
|
|
57740
57805
|
data: values,
|
|
@@ -57942,8 +58007,8 @@ function mapFormatOptionsToChartJS(formatOptions, chartType, hasSecondaryAxis =
|
|
|
57942
58007
|
style: getFontStyle(formatOptions.xAxisLabel?.xAxisLabelFontStyle),
|
|
57943
58008
|
weight: getFontWeight(formatOptions.xAxisLabel?.xAxisLabelFontStyle)
|
|
57944
58009
|
},
|
|
57945
|
-
maxRotation:
|
|
57946
|
-
minRotation:
|
|
58010
|
+
maxRotation: formatOptions.xAxisLabel?.xAxisLabelRotation ?? 0,
|
|
58011
|
+
minRotation: formatOptions.xAxisLabel?.xAxisLabelRotation ?? 0
|
|
57947
58012
|
},
|
|
57948
58013
|
grid: {
|
|
57949
58014
|
display: formatOptions.plotArea?.gridLinesVisibility !== false && formatOptions.plotArea?.gridLinesVertical !== false,
|
|
@@ -57996,7 +58061,7 @@ function mapFormatOptionsToChartJS(formatOptions, chartType, hasSecondaryAxis =
|
|
|
57996
58061
|
if (isHorizontal) {
|
|
57997
58062
|
opts.scales = {
|
|
57998
58063
|
x: { ...yScaleOptions, position: "bottom" },
|
|
57999
|
-
y: { ...xScaleOptions, position: "left" }
|
|
58064
|
+
y: { ...xScaleOptions, position: "left", reverse: true }
|
|
58000
58065
|
};
|
|
58001
58066
|
if (opts.scales.x.title) {
|
|
58002
58067
|
opts.scales.x.title.text = formatOptions.yAxisTitle?.yAxisTitleText ?? "Measure";
|
|
@@ -58004,11 +58069,6 @@ function mapFormatOptionsToChartJS(formatOptions, chartType, hasSecondaryAxis =
|
|
|
58004
58069
|
if (opts.scales.y.title) {
|
|
58005
58070
|
opts.scales.y.title.text = formatOptions.xAxisTitle?.xAxisTitleText ?? "Dimension";
|
|
58006
58071
|
}
|
|
58007
|
-
const hRot = formatOptions.xAxisLabel?.xAxisLabelRotation ?? 0;
|
|
58008
|
-
if (opts.scales.x.ticks) {
|
|
58009
|
-
opts.scales.x.ticks.maxRotation = hRot;
|
|
58010
|
-
opts.scales.x.ticks.minRotation = hRot;
|
|
58011
|
-
}
|
|
58012
58072
|
} else {
|
|
58013
58073
|
opts.scales = { x: xScaleOptions, y: yScaleOptions };
|
|
58014
58074
|
}
|
|
@@ -10871,11 +10871,6 @@
|
|
|
10871
10871
|
4: d3CalloutElbow,
|
|
10872
10872
|
5: d3CalloutCurve
|
|
10873
10873
|
};
|
|
10874
|
-
const ConnectedStyle = {
|
|
10875
|
-
"solid": "unset",
|
|
10876
|
-
"Dotted": "2",
|
|
10877
|
-
"Dashed": "7"
|
|
10878
|
-
};
|
|
10879
10874
|
var staticLegendPosition = /* @__PURE__ */ ((staticLegendPosition2) => {
|
|
10880
10875
|
staticLegendPosition2["left"] = "Left";
|
|
10881
10876
|
staticLegendPosition2["right"] = "Right";
|
|
@@ -13128,10 +13123,20 @@
|
|
|
13128
13123
|
}
|
|
13129
13124
|
function getSlicedLegendForTornado(legend) {
|
|
13130
13125
|
const index2 = legend.indexOf(" - ");
|
|
13131
|
-
if (index2 == -1) return
|
|
13126
|
+
if (index2 == -1) return tornadoEntryName.default;
|
|
13132
13127
|
return legend.slice(index2 + 3);
|
|
13133
13128
|
}
|
|
13134
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
|
+
}
|
|
13135
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) {
|
|
13136
13141
|
try {
|
|
13137
13142
|
const isTornadoChart = chartType === chartTypes.TornadoChart;
|
|
@@ -13139,6 +13144,7 @@
|
|
|
13139
13144
|
let annotationType = formatOptions.annotation.annotationType ?? "1";
|
|
13140
13145
|
let annotationPosition = formatOptions.annotation.annotationPosition.toString() != "4" ? formatOptions.annotation.annotationPosition : null;
|
|
13141
13146
|
let dataLabelColor = formatOptions?.annotation?.annotationSetLabelColor == "2" ? "color" : "labelColor";
|
|
13147
|
+
const isCurve = formatOptions.annotation.connectorType?.toLowerCase() === "curve";
|
|
13142
13148
|
if (formatOptions.annotation.annotationVisibility) {
|
|
13143
13149
|
let Disable = [annotationType == "1" ? "connector" : ""];
|
|
13144
13150
|
let labelData = [];
|
|
@@ -13369,7 +13375,8 @@
|
|
|
13369
13375
|
dy: 0,
|
|
13370
13376
|
connector: {
|
|
13371
13377
|
end: connectorType,
|
|
13372
|
-
curve: connecterCurve[formatOptions.annotation.connectorCurve]
|
|
13378
|
+
curve: connecterCurve[formatOptions.annotation.connectorCurve],
|
|
13379
|
+
points: isCurve ? getCurvePoints(0, 0) : [[0, 0], [0, 0]]
|
|
13373
13380
|
},
|
|
13374
13381
|
disable: Disable,
|
|
13375
13382
|
subject: {
|
|
@@ -13427,12 +13434,10 @@
|
|
|
13427
13434
|
newAnnotation.dx = old.dx;
|
|
13428
13435
|
newAnnotation.dy = old.dy;
|
|
13429
13436
|
newAnnotation.data.isVisible = old.isVisible ?? true;
|
|
13430
|
-
|
|
13431
|
-
|
|
13432
|
-
|
|
13433
|
-
|
|
13434
|
-
[0, 0]
|
|
13435
|
-
];
|
|
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]];
|
|
13436
13441
|
}
|
|
13437
13442
|
}
|
|
13438
13443
|
}
|
|
@@ -13495,7 +13500,7 @@
|
|
|
13495
13500
|
if (d.data?.legendUniqueId == annotation2.data.legendUniqueId || d.legendUniqueId == annotation2.data.legendUniqueId) {
|
|
13496
13501
|
d.dx = annotation2._dx * width / d.width;
|
|
13497
13502
|
d.dy = annotation2._dy * height / d.height;
|
|
13498
|
-
d.connectorPoints = annotation2.connector
|
|
13503
|
+
d.connectorPoints = annotation2.connector?.points?.map((p) => [...p]) || [];
|
|
13499
13504
|
}
|
|
13500
13505
|
});
|
|
13501
13506
|
if (onDataLabelCoordinatesChange) {
|
|
@@ -13585,6 +13590,7 @@
|
|
|
13585
13590
|
let stackData = [];
|
|
13586
13591
|
let getChartType = [];
|
|
13587
13592
|
let connectorType = formatOptions.annotation.connectorType ? formatOptions.annotation.connectorType.toLowerCase() : "None";
|
|
13593
|
+
const isCurve = formatOptions.annotation.connectorType?.toLowerCase() === "curve";
|
|
13588
13594
|
let oldAnnotationList = JSON.parse(JSON.stringify(formatOptions.plotArea.dataLabelsCoordinates));
|
|
13589
13595
|
oldAnnotationList = conditionallyResetOldAnnotations(oldAnnotationList, formatOptions, chartTypes.CustomColumnChart);
|
|
13590
13596
|
let annotationsList = [];
|
|
@@ -13916,7 +13922,8 @@
|
|
|
13916
13922
|
dy: 0,
|
|
13917
13923
|
connector: {
|
|
13918
13924
|
end: connectorType,
|
|
13919
|
-
curve: connecterCurve[formatOptions.annotation.connectorCurve]
|
|
13925
|
+
curve: connecterCurve[formatOptions.annotation.connectorCurve],
|
|
13926
|
+
points: isCurve ? getCurvePoints(0, 0) : [[0, 0], [0, 0]]
|
|
13920
13927
|
},
|
|
13921
13928
|
disable: Disable,
|
|
13922
13929
|
subject: {
|
|
@@ -13938,6 +13945,9 @@
|
|
|
13938
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
|
|
13939
13946
|
);
|
|
13940
13947
|
});
|
|
13948
|
+
if (formatOptions.annotation.annotationHideZeroValues) {
|
|
13949
|
+
annotationsList = annotationsList.filter((d) => d.data.y !== 0);
|
|
13950
|
+
}
|
|
13941
13951
|
if (oldAnnotationList.length === 0) {
|
|
13942
13952
|
oldAnnotationList = annotationsList;
|
|
13943
13953
|
oldMap = new Map(
|
|
@@ -13972,7 +13982,11 @@
|
|
|
13972
13982
|
newAnnotation.dx = old.dx;
|
|
13973
13983
|
newAnnotation.dy = old.dy;
|
|
13974
13984
|
newAnnotation.data.isVisible = old.isVisible ?? true;
|
|
13975
|
-
|
|
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
|
+
}
|
|
13976
13990
|
if (formatOptions.annotation.annotationType == "5" && newAnnotation.dx == 0 && newAnnotation.dy == 0) {
|
|
13977
13991
|
newAnnotation.connector["points"] = [
|
|
13978
13992
|
[0, 0],
|
|
@@ -14026,7 +14040,7 @@
|
|
|
14026
14040
|
if (d.data?.legendUniqueId == annotation2.data.legendUniqueId || d.legendUniqueId == annotation2.data.legendUniqueId) {
|
|
14027
14041
|
d.dx = annotation2._dx * width / d.width;
|
|
14028
14042
|
d.dy = annotation2._dy * height / d.height;
|
|
14029
|
-
d.connectorPoints = annotation2.connector
|
|
14043
|
+
d.connectorPoints = annotation2.connector?.points?.map((p) => [...p]) || [];
|
|
14030
14044
|
}
|
|
14031
14045
|
});
|
|
14032
14046
|
if (onDataLabelCoordinatesChange) {
|
|
@@ -15268,6 +15282,7 @@
|
|
|
15268
15282
|
let dataLabelColor = formatOptions?.annotation?.annotationSetLabelColor == "2" ? "color" : "labelColor";
|
|
15269
15283
|
let fontStyle = formatOptions.annotation.annotationFontStyle;
|
|
15270
15284
|
let connectorType = formatOptions.annotation.connectorType ? formatOptions.annotation.connectorType.toLowerCase() : "None";
|
|
15285
|
+
const isCurve = formatOptions.annotation.connectorType?.toLowerCase() === "curve";
|
|
15271
15286
|
let oldAnnotationList = JSON.parse(JSON.stringify(formatOptions.plotArea.dataLabelsCoordinates));
|
|
15272
15287
|
oldAnnotationList = conditionallyResetOldAnnotations(oldAnnotationList, formatOptions, chartType);
|
|
15273
15288
|
let annotationsList = [];
|
|
@@ -15372,7 +15387,8 @@
|
|
|
15372
15387
|
dy: 0,
|
|
15373
15388
|
connector: {
|
|
15374
15389
|
end: connectorType,
|
|
15375
|
-
curve: connecterCurve[formatOptions.annotation.connectorCurve]
|
|
15390
|
+
curve: connecterCurve[formatOptions.annotation.connectorCurve],
|
|
15391
|
+
points: isCurve ? getCurvePoints(0, 0) : [[0, 0], [0, 0]]
|
|
15376
15392
|
},
|
|
15377
15393
|
disable: Disable,
|
|
15378
15394
|
subject: {
|
|
@@ -15422,12 +15438,10 @@
|
|
|
15422
15438
|
newAnnotation.dx = old.dx;
|
|
15423
15439
|
newAnnotation.dy = old.dy;
|
|
15424
15440
|
newAnnotation.data.isVisible = old.isVisible ?? true;
|
|
15425
|
-
|
|
15426
|
-
|
|
15427
|
-
|
|
15428
|
-
|
|
15429
|
-
[0, 0]
|
|
15430
|
-
];
|
|
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]];
|
|
15431
15445
|
}
|
|
15432
15446
|
}
|
|
15433
15447
|
}
|
|
@@ -15463,7 +15477,7 @@
|
|
|
15463
15477
|
if (d.data?.legendUniqueId == annotation2.data.legendUniqueId || d.legendUniqueId == annotation2.data.legendUniqueId) {
|
|
15464
15478
|
d.dx = annotation2._dx * width / d.width;
|
|
15465
15479
|
d.dy = annotation2._dy * height / d.height;
|
|
15466
|
-
d.connectorPoints = annotation2.connector
|
|
15480
|
+
d.connectorPoints = annotation2.connector?.points?.map((p) => [...p]) || [];
|
|
15467
15481
|
}
|
|
15468
15482
|
});
|
|
15469
15483
|
if (onDataLabelCoordinatesChange) {
|
|
@@ -21383,6 +21397,7 @@
|
|
|
21383
21397
|
const AnnotationType = formatOptions.plotArea.annotationType ?? "1";
|
|
21384
21398
|
const Disable = [AnnotationType === "1" ? "connector" : ""];
|
|
21385
21399
|
const ConnectorType = formatOptions.plotArea.connectorType?.toLowerCase() ?? "none";
|
|
21400
|
+
const isCurve = AnnotationType === "5";
|
|
21386
21401
|
const rotationAngle = formatOptions.plotArea.rotation ?? 0;
|
|
21387
21402
|
const multiplicationFactor = chartType === chartTypes.PieChart ? 1.06 : 1.1;
|
|
21388
21403
|
const connecterCurve2 = {
|
|
@@ -21390,6 +21405,11 @@
|
|
|
21390
21405
|
"2": curveLinear$1,
|
|
21391
21406
|
"3": step
|
|
21392
21407
|
};
|
|
21408
|
+
const getCurvePoints2 = (dx, dy) => [
|
|
21409
|
+
[0, 0],
|
|
21410
|
+
[dx / 2, dy / 2],
|
|
21411
|
+
[dx, dy]
|
|
21412
|
+
];
|
|
21393
21413
|
const connectedStyle2 = {
|
|
21394
21414
|
solid: "unset",
|
|
21395
21415
|
dotted: "2,2",
|
|
@@ -21445,12 +21465,13 @@
|
|
|
21445
21465
|
dy: 0,
|
|
21446
21466
|
connector: {
|
|
21447
21467
|
end: ConnectorType,
|
|
21448
|
-
curve: connecterCurve2[formatOptions.plotArea.connectorCurve]
|
|
21468
|
+
curve: connecterCurve2[formatOptions.plotArea.connectorCurve],
|
|
21469
|
+
points: isCurve ? getCurvePoints2(0, 0) : [[0, 0], [0, 0]]
|
|
21449
21470
|
},
|
|
21450
21471
|
disable: Disable,
|
|
21451
21472
|
subject: { radius: 3 },
|
|
21452
21473
|
type: annotationTypeforCharts(d3Annotation2, AnnotationType),
|
|
21453
|
-
color: formatOptions.plotArea.
|
|
21474
|
+
color: formatOptions.plotArea.connectorColor ?? "#ccc",
|
|
21454
21475
|
width,
|
|
21455
21476
|
height,
|
|
21456
21477
|
index: index2
|
|
@@ -21480,7 +21501,11 @@
|
|
|
21480
21501
|
newAnnotation.dy = old.dy * scaleFactor;
|
|
21481
21502
|
}
|
|
21482
21503
|
newAnnotation.data.isVisible = old.data?.isVisible ?? true;
|
|
21483
|
-
|
|
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
|
+
}
|
|
21484
21509
|
}
|
|
21485
21510
|
finalAnnotationList.push(newAnnotation);
|
|
21486
21511
|
});
|
|
@@ -21526,6 +21551,26 @@
|
|
|
21526
21551
|
}
|
|
21527
21552
|
}).annotations(finalAnnotationList);
|
|
21528
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
|
+
}
|
|
21529
21574
|
annotations.selectAll("rect,.annotation-subject").remove();
|
|
21530
21575
|
if (formatOptions.animation?.animationEnabled) {
|
|
21531
21576
|
const duration = formatOptions.animation.animationDuration;
|
|
@@ -21536,10 +21581,12 @@
|
|
|
21536
21581
|
labels.transition().delay((d, i) => i * 30).duration(duration).ease(ease).style("opacity", 1);
|
|
21537
21582
|
}, 50);
|
|
21538
21583
|
}
|
|
21539
|
-
|
|
21584
|
+
const connectorColor = formatOptions.plotArea.connectorColor ?? "#ccc";
|
|
21585
|
+
annotations.selectAll(".connector").style("stroke", connectorColor).attr(
|
|
21540
21586
|
"stroke-dasharray",
|
|
21541
21587
|
connectedStyle2[formatOptions.plotArea.connectorStyle?.toLowerCase()]
|
|
21542
21588
|
);
|
|
21589
|
+
annotations.selectAll(".connector-end").style("fill", connectorColor).style("stroke", connectorColor);
|
|
21543
21590
|
annotations.selectAll(".annotation-note-label").filter((d) => !d.data.isVisible).style("display", "none");
|
|
21544
21591
|
annotations.selectAll(".annotation-note-label").filter((d) => formatOptions.plotArea.hideInsignificantValue && d.data.x1 - d.data.x0 < 0.09).style("visibility", "hidden");
|
|
21545
21592
|
} catch (error) {
|
|
@@ -26003,8 +26050,8 @@
|
|
|
26003
26050
|
onDataLabelCoordinatesChange,
|
|
26004
26051
|
void 0,
|
|
26005
26052
|
columnWidth,
|
|
26006
|
-
false,
|
|
26007
26053
|
isReportEditable,
|
|
26054
|
+
false,
|
|
26008
26055
|
barChart
|
|
26009
26056
|
);
|
|
26010
26057
|
getConnectors();
|
|
@@ -30169,7 +30216,8 @@
|
|
|
30169
30216
|
const PyramidChart = ({
|
|
30170
30217
|
data,
|
|
30171
30218
|
formatOptions,
|
|
30172
|
-
chartId
|
|
30219
|
+
chartId,
|
|
30220
|
+
onDataLabelCoordinatesChange
|
|
30173
30221
|
}) => {
|
|
30174
30222
|
const svgRef = require$$0$1.useRef();
|
|
30175
30223
|
let seriesData = generalizedChartData(data.ChartData);
|
|
@@ -30332,14 +30380,11 @@
|
|
|
30332
30380
|
};
|
|
30333
30381
|
const pyramidAnnotations = (oldAnnotationList) => {
|
|
30334
30382
|
try {
|
|
30335
|
-
const self2 = void 0;
|
|
30336
|
-
let AnnotationType = chartFormatOptions.annotation.annotationType ?? "1";
|
|
30337
30383
|
if (chartFormatOptions.annotation.annotationVisibility) {
|
|
30338
|
-
let Disable = [AnnotationType == "1" ? "connector" : ""];
|
|
30339
30384
|
let makeAnnotations = annotation();
|
|
30340
30385
|
let ConnectorType = chartFormatOptions.annotation.connectorType ? chartFormatOptions.annotation.connectorType.toLowerCase() : "None";
|
|
30341
|
-
let AnnotationsList = annotationsList;
|
|
30342
30386
|
let finalAnnotationList = annotationsList;
|
|
30387
|
+
const connectorStyleKey = chartFormatOptions.annotation.connectorStyle?.toLowerCase();
|
|
30343
30388
|
makeAnnotations.editMode(chartFormatOptions.annotation.annotationDraggable).accessors({
|
|
30344
30389
|
x: function() {
|
|
30345
30390
|
return innerWidth2 * 0.5;
|
|
@@ -30349,13 +30394,29 @@
|
|
|
30349
30394
|
}
|
|
30350
30395
|
}).on("dragend", function(annotation2) {
|
|
30351
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
|
+
}
|
|
30352
30416
|
annotations.selectAll(".connector").attr("hoverId", (d) => d.data.legend.replace(/\s+/g, "-")).style(
|
|
30353
30417
|
"stroke",
|
|
30354
30418
|
chartFormatOptions.annotation.connectorColor || "#ccc"
|
|
30355
|
-
).attr(
|
|
30356
|
-
"stroke-dasharray",
|
|
30357
|
-
ConnectedStyle[chartFormatOptions.annotation.connectorStyle]
|
|
30358
|
-
);
|
|
30419
|
+
).attr("stroke-dasharray", connectedStyle[connectorStyleKey]);
|
|
30359
30420
|
annotations.selectAll(`.connector-${ConnectorType}`).attr(
|
|
30360
30421
|
"fill",
|
|
30361
30422
|
chartFormatOptions.annotation.connectorColor || "#ccc"
|
|
@@ -30366,10 +30427,7 @@
|
|
|
30366
30427
|
annotations.selectAll(".note-line").attr("hoverId", (d) => d.data.currentLegend.replace(/\s+/g, "-")).style(
|
|
30367
30428
|
"stroke",
|
|
30368
30429
|
chartFormatOptions.annotation.connectorColor || "#ccc"
|
|
30369
|
-
).attr(
|
|
30370
|
-
"stroke-dasharray",
|
|
30371
|
-
ConnectedStyle[chartFormatOptions.annotation.connectorStyle]
|
|
30372
|
-
).filter((d) => d._dx == 0 && d._dy == 0).remove();
|
|
30430
|
+
).attr("stroke-dasharray", connectedStyle[connectorStyleKey]).filter((d) => d._dx == 0 && d._dy == 0).remove();
|
|
30373
30431
|
annotations.selectAll(".annotation-note-label").filter((d) => d.data && d.data.isVisible).style("display", "block");
|
|
30374
30432
|
annotations.selectAll(".annotation-note-title").filter((d) => d.data && d.data.isVisible).style("display", "block");
|
|
30375
30433
|
} catch (error) {
|
|
@@ -30382,10 +30440,7 @@
|
|
|
30382
30440
|
annotations.selectAll(".connector").style(
|
|
30383
30441
|
"stroke",
|
|
30384
30442
|
chartFormatOptions.annotation.connectorColor || "#ccc"
|
|
30385
|
-
).attr(
|
|
30386
|
-
"stroke-dasharray",
|
|
30387
|
-
ConnectedStyle[chartFormatOptions.annotation.connectorStyle]
|
|
30388
|
-
);
|
|
30443
|
+
).attr("stroke-dasharray", connectedStyle[connectorStyleKey]);
|
|
30389
30444
|
annotations.selectAll(`.connector-${ConnectorType}`).attr("fill", chartFormatOptions.annotation.connectorColor || "#ccc").style(
|
|
30390
30445
|
"stroke",
|
|
30391
30446
|
chartFormatOptions.annotation.connectorColor || "#ccc"
|
|
@@ -30393,10 +30448,7 @@
|
|
|
30393
30448
|
annotations.selectAll(".note-line").style(
|
|
30394
30449
|
"stroke",
|
|
30395
30450
|
chartFormatOptions.annotation.connectorColor || "#ccc"
|
|
30396
|
-
).attr(
|
|
30397
|
-
"stroke-dasharray",
|
|
30398
|
-
ConnectedStyle[chartFormatOptions.annotation.connectorStyle]
|
|
30399
|
-
).filter((d) => d._dx == 0 && d._dy == 0).remove();
|
|
30451
|
+
).attr("stroke-dasharray", connectedStyle[connectorStyleKey]).filter((d) => d._dx == 0 && d._dy == 0).remove();
|
|
30400
30452
|
annotations.selectAll(".connector-end").filter((d) => d.connector.end == "dot" && d._dx == 0 && d._dy == 0).remove();
|
|
30401
30453
|
annotations.selectAll(".annotation-note-label").filter((d) => d.data && !d.data.isVisible).style("display", "none");
|
|
30402
30454
|
annotations.selectAll(".annotation-note-title").filter((d) => d.data && !d.data.isVisible).style("display", "none");
|
|
@@ -30442,7 +30494,12 @@
|
|
|
30442
30494
|
const prepareNewAnnotationsList = () => {
|
|
30443
30495
|
try {
|
|
30444
30496
|
let annotationType = chartFormatOptions.annotation.annotationType ?? "1";
|
|
30497
|
+
let disable = [annotationType == "1" ? "connector" : ""];
|
|
30445
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]));
|
|
30446
30503
|
annotationsList = [];
|
|
30447
30504
|
seriesData.forEach((d, i) => {
|
|
30448
30505
|
try {
|
|
@@ -30487,6 +30544,7 @@
|
|
|
30487
30544
|
end: connectorType,
|
|
30488
30545
|
curve: ConnecterCurve[chartFormatOptions.annotation.connectorCurve]
|
|
30489
30546
|
},
|
|
30547
|
+
disable,
|
|
30490
30548
|
subject: {
|
|
30491
30549
|
height: 15,
|
|
30492
30550
|
width: 15
|
|
@@ -30497,6 +30555,12 @@
|
|
|
30497
30555
|
width,
|
|
30498
30556
|
index: i
|
|
30499
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
|
+
}
|
|
30500
30564
|
annotationsList.push(singleAnnotation);
|
|
30501
30565
|
} catch (error) {
|
|
30502
30566
|
logError$2(fileName$4, "prepareNewAnnotationsList.forEach", error);
|
|
@@ -57663,11 +57727,11 @@
|
|
|
57663
57727
|
return [];
|
|
57664
57728
|
}
|
|
57665
57729
|
function transformToChartJSData(chartData, chartType, formatOptions, colorBank = CJS_DEFAULT_COLORS) {
|
|
57666
|
-
const { ChartData: seriesList, DimensionList } = chartData;
|
|
57730
|
+
const { ChartData: seriesList, DimensionList, LegendList } = chartData;
|
|
57667
57731
|
const labels = DimensionList?.length ? DimensionList : seriesList[0]?.data?.map((d) => d.dimension) ?? [];
|
|
57668
57732
|
const fillOpacity = Number(formatOptions.plotArea?.fillOpacity ?? 0.8);
|
|
57669
57733
|
if (chartType === "pie" || chartType === "doughnut" || chartType === "polarArea") {
|
|
57670
|
-
return buildCircularData(seriesList, labels, fillOpacity, colorBank);
|
|
57734
|
+
return buildCircularData(seriesList, labels, fillOpacity, colorBank, LegendList);
|
|
57671
57735
|
}
|
|
57672
57736
|
if (chartType === "scatter") {
|
|
57673
57737
|
return buildScatterData(seriesList, colorBank);
|
|
@@ -57728,16 +57792,17 @@
|
|
|
57728
57792
|
});
|
|
57729
57793
|
return { labels, datasets };
|
|
57730
57794
|
}
|
|
57731
|
-
function buildCircularData(seriesList, labels, fillOpacity, colorBank) {
|
|
57795
|
+
function buildCircularData(seriesList, labels, fillOpacity, colorBank, legendList) {
|
|
57732
57796
|
const allSeries = seriesList.length ? seriesList : [];
|
|
57733
57797
|
const datasets = allSeries.map((series) => {
|
|
57734
57798
|
const values = labels.map((lbl) => {
|
|
57735
57799
|
const pt = series.data?.find((d) => d.dimension === lbl);
|
|
57736
57800
|
return pt?.value ?? 0;
|
|
57737
57801
|
});
|
|
57738
|
-
const backgroundColors = labels.map(
|
|
57739
|
-
|
|
57740
|
-
|
|
57802
|
+
const backgroundColors = labels.map((_, i) => {
|
|
57803
|
+
const legendColor = legendList?.[i]?.color;
|
|
57804
|
+
return hexToRgba(legendColor ?? colorBank[i % colorBank.length], fillOpacity);
|
|
57805
|
+
});
|
|
57741
57806
|
return {
|
|
57742
57807
|
label: series.properties.alias,
|
|
57743
57808
|
data: values,
|
|
@@ -57945,8 +58010,8 @@
|
|
|
57945
58010
|
style: getFontStyle(formatOptions.xAxisLabel?.xAxisLabelFontStyle),
|
|
57946
58011
|
weight: getFontWeight(formatOptions.xAxisLabel?.xAxisLabelFontStyle)
|
|
57947
58012
|
},
|
|
57948
|
-
maxRotation:
|
|
57949
|
-
minRotation:
|
|
58013
|
+
maxRotation: formatOptions.xAxisLabel?.xAxisLabelRotation ?? 0,
|
|
58014
|
+
minRotation: formatOptions.xAxisLabel?.xAxisLabelRotation ?? 0
|
|
57950
58015
|
},
|
|
57951
58016
|
grid: {
|
|
57952
58017
|
display: formatOptions.plotArea?.gridLinesVisibility !== false && formatOptions.plotArea?.gridLinesVertical !== false,
|
|
@@ -57999,7 +58064,7 @@
|
|
|
57999
58064
|
if (isHorizontal) {
|
|
58000
58065
|
opts.scales = {
|
|
58001
58066
|
x: { ...yScaleOptions, position: "bottom" },
|
|
58002
|
-
y: { ...xScaleOptions, position: "left" }
|
|
58067
|
+
y: { ...xScaleOptions, position: "left", reverse: true }
|
|
58003
58068
|
};
|
|
58004
58069
|
if (opts.scales.x.title) {
|
|
58005
58070
|
opts.scales.x.title.text = formatOptions.yAxisTitle?.yAxisTitleText ?? "Measure";
|
|
@@ -58007,11 +58072,6 @@
|
|
|
58007
58072
|
if (opts.scales.y.title) {
|
|
58008
58073
|
opts.scales.y.title.text = formatOptions.xAxisTitle?.xAxisTitleText ?? "Dimension";
|
|
58009
58074
|
}
|
|
58010
|
-
const hRot = formatOptions.xAxisLabel?.xAxisLabelRotation ?? 0;
|
|
58011
|
-
if (opts.scales.x.ticks) {
|
|
58012
|
-
opts.scales.x.ticks.maxRotation = hRot;
|
|
58013
|
-
opts.scales.x.ticks.minRotation = hRot;
|
|
58014
|
-
}
|
|
58015
58075
|
} else {
|
|
58016
58076
|
opts.scales = { x: xScaleOptions, y: yScaleOptions };
|
|
58017
58077
|
}
|