pace-chart-lib 1.0.59 → 1.0.61
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.
- package/dist/Components/Charts/ChartsWithAxis/ChartsWithAxisFunctions.d.ts +10 -0
- package/dist/Components/Charts/ChartsWithoutAxis/ChartsWithoutAxisFunctions.d.ts +1 -0
- package/dist/Components/Charts/Core/DefaultProperties.types.d.ts +12 -0
- package/dist/pace-chart-lib.es.js +155 -42
- package/dist/pace-chart-lib.umd.js +155 -42
- package/package.json +1 -1
|
@@ -417,6 +417,16 @@ export declare function setChartTitle(svg: any, formatOptions: TDefaultChartForm
|
|
|
417
417
|
* @returns The appropriate D3 curve function based on the interpolation and smoothing settings.
|
|
418
418
|
*/
|
|
419
419
|
export declare function getCurveType(formatOptions: TDefaultChartFormatOptionsType): d3.CurveFactory;
|
|
420
|
+
/**
|
|
421
|
+
* Filters an annotation list based on the user-configured range condition in the right pane
|
|
422
|
+
* (formatOptions.annotation.annotationRangeFilter).
|
|
423
|
+
*
|
|
424
|
+
* @param annotationsList - The array of built annotation objects to filter.
|
|
425
|
+
* @param formatOptions - Chart format options containing the range filter config.
|
|
426
|
+
* @param getMeasure - Callback that extracts the numeric measure from one annotation item.
|
|
427
|
+
* @returns The filtered array (same reference when the filter is disabled).
|
|
428
|
+
*/
|
|
429
|
+
export declare function applyAnnotationRangeFilter<T>(annotationsList: T[], formatOptions: TDefaultChartFormatOptionsType, getMeasure: (item: T) => number): T[];
|
|
420
430
|
export declare function commonAnnotations(chartData: TSeries[], xScale: any, yScaleLeft: any, yScaleRight: any, margin: TMargin, d3Annotation: any, labelExcludeList: string[], individualLabelColor: any[], formatOptions: TDefaultChartFormatOptionsType, chartType: string, height: number, width: number, innerWidth: number, dimensionList: string[], innerHeight: number, widgetId: string, svg: any, onDataLabelCoordinatesChange: (coordinates: any[]) => void, xScaleForLegends?: any, columnWidth?: number, isReportEditable?: boolean, isSensitivityChart?: boolean, barChart?: boolean, isAATornado?: boolean): void;
|
|
421
431
|
/**
|
|
422
432
|
* @param {Array} chartData - The main data used to render the chart.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as d3 from "d3";
|
|
2
2
|
import { TChartMargins, TDefaultChartFormatOptionsType } from "../Core/Common.types";
|
|
3
|
+
export declare function applyPlotAreaRangeFilter<T>(labelsList: T[], formatOptions: TDefaultChartFormatOptionsType, getMeasure: (item: T) => number): T[];
|
|
3
4
|
/**
|
|
4
5
|
* Calculates margins for Bubble and Scatter charts based on various parameters.
|
|
5
6
|
* @param width // Width of the chart container.
|
|
@@ -267,6 +267,12 @@ export declare const defaultChartFormatOptions: {
|
|
|
267
267
|
hideInsignificantValue: boolean;
|
|
268
268
|
sortBy: string;
|
|
269
269
|
chartDirection: string;
|
|
270
|
+
plotAreaRangeFilter: {
|
|
271
|
+
enabled: boolean;
|
|
272
|
+
condition: string;
|
|
273
|
+
minVal: number;
|
|
274
|
+
maxVal: number;
|
|
275
|
+
};
|
|
270
276
|
};
|
|
271
277
|
heatMap: {
|
|
272
278
|
showHeatMap: boolean;
|
|
@@ -300,6 +306,12 @@ export declare const defaultChartFormatOptions: {
|
|
|
300
306
|
annotationHideZeroValues: boolean;
|
|
301
307
|
annotationShowHiddenValues: boolean;
|
|
302
308
|
annotationSetLabelColor: string;
|
|
309
|
+
annotationRangeFilter: {
|
|
310
|
+
enabled: boolean;
|
|
311
|
+
condition: string;
|
|
312
|
+
minVal: number;
|
|
313
|
+
maxVal: number;
|
|
314
|
+
};
|
|
303
315
|
};
|
|
304
316
|
total: {
|
|
305
317
|
totalVisibility: boolean;
|
|
@@ -11261,7 +11261,13 @@ const defaultChartFormatOptions = {
|
|
|
11261
11261
|
dataLabelsCoordinates: [],
|
|
11262
11262
|
hideInsignificantValue: false,
|
|
11263
11263
|
sortBy: "default",
|
|
11264
|
-
chartDirection: "top"
|
|
11264
|
+
chartDirection: "top",
|
|
11265
|
+
plotAreaRangeFilter: {
|
|
11266
|
+
enabled: false,
|
|
11267
|
+
condition: "lt",
|
|
11268
|
+
minVal: 0,
|
|
11269
|
+
maxVal: 100
|
|
11270
|
+
}
|
|
11265
11271
|
},
|
|
11266
11272
|
heatMap: {
|
|
11267
11273
|
showHeatMap: false,
|
|
@@ -11294,7 +11300,13 @@ const defaultChartFormatOptions = {
|
|
|
11294
11300
|
annotationBoxVisibility: [],
|
|
11295
11301
|
annotationHideZeroValues: true,
|
|
11296
11302
|
annotationShowHiddenValues: true,
|
|
11297
|
-
annotationSetLabelColor: "1"
|
|
11303
|
+
annotationSetLabelColor: "1",
|
|
11304
|
+
annotationRangeFilter: {
|
|
11305
|
+
enabled: false,
|
|
11306
|
+
condition: "lt",
|
|
11307
|
+
minVal: 0,
|
|
11308
|
+
maxVal: 100
|
|
11309
|
+
}
|
|
11298
11310
|
},
|
|
11299
11311
|
total: {
|
|
11300
11312
|
totalVisibility: false,
|
|
@@ -13134,6 +13146,25 @@ function getCurvePoints(dx, dy) {
|
|
|
13134
13146
|
// end (label)
|
|
13135
13147
|
];
|
|
13136
13148
|
}
|
|
13149
|
+
function applyAnnotationRangeFilter(annotationsList, formatOptions, getMeasure) {
|
|
13150
|
+
if (!formatOptions.annotation.annotationRangeFilter?.enabled) return annotationsList;
|
|
13151
|
+
const { condition, minVal, maxVal } = formatOptions.annotation.annotationRangeFilter;
|
|
13152
|
+
return annotationsList.filter((item) => {
|
|
13153
|
+
const measure = getMeasure(item);
|
|
13154
|
+
switch (condition) {
|
|
13155
|
+
case "lt":
|
|
13156
|
+
return measure <= maxVal;
|
|
13157
|
+
case "gt":
|
|
13158
|
+
return measure >= minVal;
|
|
13159
|
+
case "in":
|
|
13160
|
+
return measure >= minVal && measure <= maxVal;
|
|
13161
|
+
case "not-in":
|
|
13162
|
+
return measure < minVal || measure > maxVal;
|
|
13163
|
+
default:
|
|
13164
|
+
return true;
|
|
13165
|
+
}
|
|
13166
|
+
});
|
|
13167
|
+
}
|
|
13137
13168
|
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) {
|
|
13138
13169
|
try {
|
|
13139
13170
|
const isTornadoChart = chartType === chartTypes.TornadoChart;
|
|
@@ -13397,6 +13428,11 @@ function commonAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin, d
|
|
|
13397
13428
|
(d) => barChart ? d.data.x.measure !== 0 : d.data.y.measure !== 0
|
|
13398
13429
|
);
|
|
13399
13430
|
}
|
|
13431
|
+
annotationsList = applyAnnotationRangeFilter(
|
|
13432
|
+
annotationsList,
|
|
13433
|
+
formatOptions,
|
|
13434
|
+
(d) => barChart ? d.data.x.measure : d.data.y.measure
|
|
13435
|
+
);
|
|
13400
13436
|
if (oldAnnotationList.length === 0) {
|
|
13401
13437
|
oldAnnotationList = annotationsList;
|
|
13402
13438
|
oldMap = new Map(
|
|
@@ -13945,6 +13981,11 @@ function commonAnnotationsForCustomChart(chartData, xScale, yScaleLeft, yScaleRi
|
|
|
13945
13981
|
if (formatOptions.annotation.annotationHideZeroValues) {
|
|
13946
13982
|
annotationsList = annotationsList.filter((d) => d.data.y !== 0);
|
|
13947
13983
|
}
|
|
13984
|
+
annotationsList = applyAnnotationRangeFilter(
|
|
13985
|
+
annotationsList,
|
|
13986
|
+
formatOptions,
|
|
13987
|
+
(d) => d.data.y
|
|
13988
|
+
);
|
|
13948
13989
|
if (oldAnnotationList.length === 0) {
|
|
13949
13990
|
oldAnnotationList = annotationsList;
|
|
13950
13991
|
oldMap = new Map(
|
|
@@ -15401,6 +15442,11 @@ function stacklineAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin
|
|
|
15401
15442
|
// ?
|
|
15402
15443
|
annotationsList.push(singleAnnotation);
|
|
15403
15444
|
});
|
|
15445
|
+
annotationsList = applyAnnotationRangeFilter(
|
|
15446
|
+
annotationsList,
|
|
15447
|
+
formatOptions,
|
|
15448
|
+
(d) => barChart ? d.data.x : d.data.y
|
|
15449
|
+
);
|
|
15404
15450
|
if (oldAnnotationList.length === 0) {
|
|
15405
15451
|
oldAnnotationList = annotationsList;
|
|
15406
15452
|
oldMap = new Map(
|
|
@@ -20895,6 +20941,25 @@ const NormalizedStackColumnChart = ({
|
|
|
20895
20941
|
) });
|
|
20896
20942
|
};
|
|
20897
20943
|
const fileName$a = "ChartsWithoutAxisFunctions.ts";
|
|
20944
|
+
function applyPlotAreaRangeFilter(labelsList, formatOptions, getMeasure) {
|
|
20945
|
+
if (!formatOptions?.plotArea?.plotAreaRangeFilter?.enabled) return labelsList;
|
|
20946
|
+
const { condition, minVal, maxVal } = formatOptions.plotArea.plotAreaRangeFilter;
|
|
20947
|
+
return labelsList.filter((item) => {
|
|
20948
|
+
const measure = getMeasure(item);
|
|
20949
|
+
switch (condition) {
|
|
20950
|
+
case "lt":
|
|
20951
|
+
return measure <= maxVal;
|
|
20952
|
+
case "gt":
|
|
20953
|
+
return measure >= minVal;
|
|
20954
|
+
case "in":
|
|
20955
|
+
return measure >= minVal && measure <= maxVal;
|
|
20956
|
+
case "not-in":
|
|
20957
|
+
return measure < minVal || measure > maxVal;
|
|
20958
|
+
default:
|
|
20959
|
+
return true;
|
|
20960
|
+
}
|
|
20961
|
+
});
|
|
20962
|
+
}
|
|
20898
20963
|
function marginCalculationForBubbleScatter(width, height, maxMeasure, formatOptions, maxDimension, maxLegendDimensions) {
|
|
20899
20964
|
try {
|
|
20900
20965
|
formatOptions.xAxisLabel.xAxisDateFormat = formatOptions.xAxisLabel.xAxisDateFormat == "DD-MM-YYYY" ? "," : formatOptions.xAxisLabel.xAxisDateFormat;
|
|
@@ -21477,6 +21542,11 @@ function pieFamilyAnnotation(d3Annotation2, chartData, formatOptions, getPiePosi
|
|
|
21477
21542
|
let AnnotationsList = chartData.filter((d) => d.x1 - d.x0 > 1e-4).map(createAnnotation);
|
|
21478
21543
|
const visibleFilter = (d) => (d.data.y?.value ?? 0) !== 0;
|
|
21479
21544
|
AnnotationsList = AnnotationsList.filter(visibleFilter);
|
|
21545
|
+
AnnotationsList = applyAnnotationRangeFilter(
|
|
21546
|
+
AnnotationsList,
|
|
21547
|
+
formatOptions,
|
|
21548
|
+
(d) => d.data.y.value
|
|
21549
|
+
);
|
|
21480
21550
|
let oldMap = new Map(
|
|
21481
21551
|
oldAnnotationList.map((d) => [
|
|
21482
21552
|
d.data?.x?.legend,
|
|
@@ -28860,8 +28930,10 @@ const PieChart = ({ data, formatOptions, chartId, isReportEditable, onDataLabelC
|
|
|
28860
28930
|
if (chartFormatOptions.plotArea.dataLabels) {
|
|
28861
28931
|
const isSingleDataLabel = pieChartData && pieChartData.length === 1;
|
|
28862
28932
|
chartAreaTagG.append("g").attr("class", "parentGroup").attr("transform", `${getPiePosition()}`).attr("pointer-events", "none").attr("text-anchor", "middle").selectAll("text").data(
|
|
28863
|
-
|
|
28864
|
-
(d) => d.data.properties.dataLabelPosition == "1"
|
|
28933
|
+
applyAnnotationRangeFilter(
|
|
28934
|
+
pieChartData.filter((d) => d.data.properties.dataLabelPosition == "1"),
|
|
28935
|
+
chartFormatOptions,
|
|
28936
|
+
(d) => d.data.data[0].value
|
|
28865
28937
|
)
|
|
28866
28938
|
).enter().append("text").attr(
|
|
28867
28939
|
"hoverId",
|
|
@@ -28897,8 +28969,10 @@ const PieChart = ({ data, formatOptions, chartId, isReportEditable, onDataLabelC
|
|
|
28897
28969
|
return "";
|
|
28898
28970
|
});
|
|
28899
28971
|
chartAreaTagG.append("g").attr("class", "parentGroup").attr("transform", `${getPiePosition()}`).attr("pointer-events", "none").attr("text-anchor", "middle").selectAll("text").data(
|
|
28900
|
-
|
|
28901
|
-
(d) => d.data.properties.dataLabelPosition == "1"
|
|
28972
|
+
applyAnnotationRangeFilter(
|
|
28973
|
+
pieChartData.filter((d) => d.data.properties.dataLabelPosition == "1"),
|
|
28974
|
+
chartFormatOptions,
|
|
28975
|
+
(d) => d.data.data[0].value
|
|
28902
28976
|
)
|
|
28903
28977
|
).enter().append("text").attr(
|
|
28904
28978
|
"hoverId",
|
|
@@ -28965,8 +29039,10 @@ const PieChart = ({ data, formatOptions, chartId, isReportEditable, onDataLabelC
|
|
|
28965
29039
|
let outerRadius = arc$1().startAngle((d) => d.x0).endAngle((d) => d.x1).innerRadius((d) => d.depth > 1 ? d.y1 - 1 + radius / 7 : 0).outerRadius((d) => d.depth > 1 ? d.y1 - 1 + radius / 7 : 0);
|
|
28966
29040
|
let innerRadius = arc$1().startAngle((d) => d.x0).endAngle((d) => d.x1).innerRadius((d) => d.depth > 2 ? d.y0 : 0).outerRadius((d) => d.y1 + radius / 1.5);
|
|
28967
29041
|
chartAreaTagG.selectAll("polyline").data(
|
|
28968
|
-
|
|
28969
|
-
(d) => d.data.properties.dataLabelPosition == "2"
|
|
29042
|
+
applyAnnotationRangeFilter(
|
|
29043
|
+
pieChartData.filter((d) => d.data.properties.dataLabelPosition == "2"),
|
|
29044
|
+
chartFormatOptions,
|
|
29045
|
+
(d) => d.data.data[0].value
|
|
28970
29046
|
)
|
|
28971
29047
|
).join("polyline").attr("transform", getPiePosition()).style(
|
|
28972
29048
|
"stroke",
|
|
@@ -28987,8 +29063,10 @@ const PieChart = ({ data, formatOptions, chartId, isReportEditable, onDataLabelC
|
|
|
28987
29063
|
return [posA, posB, [xC, yC]].map((point2) => point2.join(",")).join(" ");
|
|
28988
29064
|
});
|
|
28989
29065
|
chartAreaTagG.append("g").attr("transform", getPiePosition()).selectAll("foreignObject").data(
|
|
28990
|
-
|
|
28991
|
-
(d) => d.data.properties.dataLabelPosition == "2"
|
|
29066
|
+
applyAnnotationRangeFilter(
|
|
29067
|
+
pieChartData.filter((d) => d.data.properties.dataLabelPosition == "2"),
|
|
29068
|
+
chartFormatOptions,
|
|
29069
|
+
(d) => d.data.data[0].value
|
|
28992
29070
|
)
|
|
28993
29071
|
).join("foreignObject").attr("width", 80).attr("height", 60).attr("x", (d) => {
|
|
28994
29072
|
let midangle = d.x0 + (d.x1 - d.x0) / 2;
|
|
@@ -29295,8 +29373,10 @@ const DonutChart = ({
|
|
|
29295
29373
|
if (chartFormatOptions.plotArea.dataLabels) {
|
|
29296
29374
|
const isSingleDataLabel = pieChartData && pieChartData.length === 1;
|
|
29297
29375
|
chartAreaTagG.append("g").attr("class", "parentGroup").attr("transform", `${getPiePosition()}`).attr("pointer-events", "none").attr("text-anchor", "middle").selectAll("text").data(
|
|
29298
|
-
|
|
29299
|
-
(d) => d.data.properties.dataLabelPosition == "1"
|
|
29376
|
+
applyAnnotationRangeFilter(
|
|
29377
|
+
pieChartData.filter((d) => d.data.properties.dataLabelPosition == "1"),
|
|
29378
|
+
chartFormatOptions,
|
|
29379
|
+
(d) => d.data.data[0].value
|
|
29300
29380
|
)
|
|
29301
29381
|
).enter().append("text").attr(
|
|
29302
29382
|
"hoverId",
|
|
@@ -29332,8 +29412,10 @@ const DonutChart = ({
|
|
|
29332
29412
|
return "";
|
|
29333
29413
|
});
|
|
29334
29414
|
chartAreaTagG.append("g").attr("class", "parentGroup").attr("transform", `${getPiePosition()}`).attr("pointer-events", "none").attr("text-anchor", "middle").selectAll("text").data(
|
|
29335
|
-
|
|
29336
|
-
(d) => d.data.properties.dataLabelPosition == "1"
|
|
29415
|
+
applyAnnotationRangeFilter(
|
|
29416
|
+
pieChartData.filter((d) => d.data.properties.dataLabelPosition == "1"),
|
|
29417
|
+
chartFormatOptions,
|
|
29418
|
+
(d) => d.data.data[0].value
|
|
29337
29419
|
)
|
|
29338
29420
|
).enter().append("text").attr(
|
|
29339
29421
|
"hoverId",
|
|
@@ -29406,8 +29488,10 @@ const DonutChart = ({
|
|
|
29406
29488
|
let outerRadius = arc$1().startAngle((d) => d.x0).endAngle((d) => d.x1).innerRadius((d) => d.depth > 1 ? d.y1 - 1 + radius / 7 : 0).outerRadius((d) => d.depth > 1 ? d.y1 - 1 + radius / 7 : 0);
|
|
29407
29489
|
let innerRadius2 = arc$1().startAngle((d) => d.x0).endAngle((d) => d.x1).innerRadius((d) => d.depth > 2 ? d.y0 : 0).outerRadius((d) => d.y1 + radius / 1.5);
|
|
29408
29490
|
chartAreaTagG.selectAll("polyline").data(
|
|
29409
|
-
|
|
29410
|
-
(d) => d.data.properties.dataLabelPosition == "2"
|
|
29491
|
+
applyAnnotationRangeFilter(
|
|
29492
|
+
pieChartData.filter((d) => d.data.properties.dataLabelPosition == "2"),
|
|
29493
|
+
chartFormatOptions,
|
|
29494
|
+
(d) => d.data.data[0].value
|
|
29411
29495
|
)
|
|
29412
29496
|
).join("polyline").attr("transform", getPiePosition()).style(
|
|
29413
29497
|
"stroke",
|
|
@@ -29428,8 +29512,10 @@ const DonutChart = ({
|
|
|
29428
29512
|
return [posA, posB, [xC, yC]].map((point2) => point2.join(",")).join(" ");
|
|
29429
29513
|
});
|
|
29430
29514
|
chartAreaTagG.append("g").attr("transform", getPiePosition()).selectAll("foreignObject").data(
|
|
29431
|
-
|
|
29432
|
-
(d) => d.data.properties.dataLabelPosition == "2"
|
|
29515
|
+
applyAnnotationRangeFilter(
|
|
29516
|
+
pieChartData.filter((d) => d.data.properties.dataLabelPosition == "2"),
|
|
29517
|
+
chartFormatOptions,
|
|
29518
|
+
(d) => d.data.data[0].value
|
|
29433
29519
|
)
|
|
29434
29520
|
).join("foreignObject").attr("width", 80).attr("height", 60).attr("x", (d) => {
|
|
29435
29521
|
let midangle = d.x0 + (d.x1 - d.x0) / 2;
|
|
@@ -29728,7 +29814,23 @@ const Treemap = ({ data, formatOptions, chartId }) => {
|
|
|
29728
29814
|
}
|
|
29729
29815
|
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);
|
|
29730
29816
|
if (chartFormatOptions.plotArea.dataLabels) {
|
|
29731
|
-
|
|
29817
|
+
const rf = chartFormatOptions.annotation.annotationRangeFilter;
|
|
29818
|
+
leaf.filter((d) => {
|
|
29819
|
+
if (!rf?.enabled) return true;
|
|
29820
|
+
const val = d.data.data[0].value;
|
|
29821
|
+
switch (rf.condition) {
|
|
29822
|
+
case "lt":
|
|
29823
|
+
return val < rf.maxVal;
|
|
29824
|
+
case "gt":
|
|
29825
|
+
return val > rf.minVal;
|
|
29826
|
+
case "in":
|
|
29827
|
+
return val >= rf.minVal && val <= rf.maxVal;
|
|
29828
|
+
case "not-in":
|
|
29829
|
+
return val < rf.minVal || val > rf.maxVal;
|
|
29830
|
+
default:
|
|
29831
|
+
return true;
|
|
29832
|
+
}
|
|
29833
|
+
}).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(
|
|
29732
29834
|
"font-style",
|
|
29733
29835
|
(d) => d.data.properties.fontStyle.includes(fontStyleOptions.italic) ? fontStyleOptions.italic : ""
|
|
29734
29836
|
).style(
|
|
@@ -30037,7 +30139,7 @@ const PieofPie = ({
|
|
|
30037
30139
|
const drawParentPieDataLabels = () => {
|
|
30038
30140
|
try {
|
|
30039
30141
|
if (chartFormatOptions.plotArea.dataLabels) {
|
|
30040
|
-
chartAreaTagG.append("g").attr("class", "parentLabels parentGroup").attr("transform", `${getParentPiePosition()}`).attr("pointer-events", "none").attr("text-anchor", "middle").selectAll("text").data(pieOfPieData).enter().append("text").attr("hoverId", (d) => d.data.legend.replace(/ /g, "-")).attr("font-size", (d) => d.data.properties?.labelFontSize ?? 11).attr(
|
|
30142
|
+
chartAreaTagG.append("g").attr("class", "parentLabels parentGroup").attr("transform", `${getParentPiePosition()}`).attr("pointer-events", "none").attr("text-anchor", "middle").selectAll("text").data(applyAnnotationRangeFilter(pieOfPieData, chartFormatOptions, (d) => d.data.data[0].value)).enter().append("text").attr("hoverId", (d) => d.data.legend.replace(/ /g, "-")).attr("font-size", (d) => d.data.properties?.labelFontSize ?? 11).attr(
|
|
30041
30143
|
"fill",
|
|
30042
30144
|
(d) => d.data.properties?.labelFontColor ?? commonColors.black
|
|
30043
30145
|
).attr(
|
|
@@ -30061,7 +30163,7 @@ const PieofPie = ({
|
|
|
30061
30163
|
}
|
|
30062
30164
|
return "";
|
|
30063
30165
|
});
|
|
30064
|
-
chartAreaTagG.append("g").attr("class", "parentLabels parentGroup").attr("transform", `${getParentPiePosition()}`).attr("pointer-events", "none").attr("text-anchor", "middle").selectAll("text").data(pieOfPieData).enter().append("text").attr("hoverId", (d) => d.data.legend.replace(/ /g, "-")).attr("font-size", (d) => d.data.properties?.valueFontSize ?? 11).attr(
|
|
30166
|
+
chartAreaTagG.append("g").attr("class", "parentLabels parentGroup").attr("transform", `${getParentPiePosition()}`).attr("pointer-events", "none").attr("text-anchor", "middle").selectAll("text").data(applyAnnotationRangeFilter(pieOfPieData, chartFormatOptions, (d) => d.data.data[0].value)).enter().append("text").attr("hoverId", (d) => d.data.legend.replace(/ /g, "-")).attr("font-size", (d) => d.data.properties?.valueFontSize ?? 11).attr(
|
|
30065
30167
|
"fill",
|
|
30066
30168
|
(d) => d.data.properties?.valueFontColor ?? commonColors.black
|
|
30067
30169
|
).attr(
|
|
@@ -30107,7 +30209,7 @@ const PieofPie = ({
|
|
|
30107
30209
|
const drawChildPieDataLabels = (childData) => {
|
|
30108
30210
|
try {
|
|
30109
30211
|
if (chartFormatOptions.plotArea.dataLabels) {
|
|
30110
|
-
chartAreaTagG.append("g").attr("class", "childLabels parentGroup").attr("transform", `${getChildPiePosition()}`).attr("pointer-events", "none").attr("text-anchor", "middle").selectAll("text").data(childData).enter().append("text").attr("hoverId", (d) => d.data.legend.replace(/ /g, "-")).attr("font-size", (d) => d.data.properties?.labelFontSize ?? 11).attr(
|
|
30212
|
+
chartAreaTagG.append("g").attr("class", "childLabels parentGroup").attr("transform", `${getChildPiePosition()}`).attr("pointer-events", "none").attr("text-anchor", "middle").selectAll("text").data(applyAnnotationRangeFilter(childData, chartFormatOptions, (d) => d.data.data[0].value)).enter().append("text").attr("hoverId", (d) => d.data.legend.replace(/ /g, "-")).attr("font-size", (d) => d.data.properties?.labelFontSize ?? 11).attr(
|
|
30111
30213
|
"fill",
|
|
30112
30214
|
(d) => d.data.properties?.labelFontColor ?? commonColors.black
|
|
30113
30215
|
).attr(
|
|
@@ -30131,7 +30233,7 @@ const PieofPie = ({
|
|
|
30131
30233
|
}
|
|
30132
30234
|
return "";
|
|
30133
30235
|
});
|
|
30134
|
-
chartAreaTagG.append("g").attr("class", "childLabels parentGroup").attr("transform", `${getChildPiePosition()}`).attr("pointer-events", "none").attr("text-anchor", "middle").selectAll("text").data(childData).enter().append("text").attr("hoverId", (d) => d.data.legend.replace(/ /g, "-")).attr("font-size", (d) => d.data.properties?.valueFontSize ?? 11).attr(
|
|
30236
|
+
chartAreaTagG.append("g").attr("class", "childLabels parentGroup").attr("transform", `${getChildPiePosition()}`).attr("pointer-events", "none").attr("text-anchor", "middle").selectAll("text").data(applyAnnotationRangeFilter(childData, chartFormatOptions, (d) => d.data.data[0].value)).enter().append("text").attr("hoverId", (d) => d.data.legend.replace(/ /g, "-")).attr("font-size", (d) => d.data.properties?.valueFontSize ?? 11).attr(
|
|
30135
30237
|
"fill",
|
|
30136
30238
|
(d) => d.data.properties?.valueFontColor ?? commonColors.black
|
|
30137
30239
|
).attr(
|
|
@@ -30380,7 +30482,11 @@ const PyramidChart = ({
|
|
|
30380
30482
|
if (chartFormatOptions.annotation.annotationVisibility) {
|
|
30381
30483
|
let makeAnnotations = annotation();
|
|
30382
30484
|
let ConnectorType = chartFormatOptions.annotation.connectorType ? chartFormatOptions.annotation.connectorType.toLowerCase() : "None";
|
|
30383
|
-
let finalAnnotationList =
|
|
30485
|
+
let finalAnnotationList = applyAnnotationRangeFilter(
|
|
30486
|
+
annotationsList,
|
|
30487
|
+
chartFormatOptions,
|
|
30488
|
+
(item) => item.data.measure
|
|
30489
|
+
);
|
|
30384
30490
|
const connectorStyleKey = chartFormatOptions.annotation.connectorStyle?.toLowerCase();
|
|
30385
30491
|
makeAnnotations.editMode(chartFormatOptions.annotation.annotationDraggable).accessors({
|
|
30386
30492
|
x: function() {
|
|
@@ -30802,7 +30908,15 @@ const ProgressChart = ({
|
|
|
30802
30908
|
});
|
|
30803
30909
|
chartAreaTagG.append("text").attr("transform", getTransformString()).attr("dy", "0.35em").attr("text-anchor", "middle").attr(
|
|
30804
30910
|
"visibility",
|
|
30805
|
-
|
|
30911
|
+
() => {
|
|
30912
|
+
if (!chartFormatOptions.plotArea.dataLabels) return "hidden";
|
|
30913
|
+
const passed = applyPlotAreaRangeFilter(
|
|
30914
|
+
[{ value: progressValue }],
|
|
30915
|
+
chartFormatOptions,
|
|
30916
|
+
(d) => d?.value ?? 0
|
|
30917
|
+
);
|
|
30918
|
+
return passed.length > 0 ? "visible" : "hidden";
|
|
30919
|
+
}
|
|
30806
30920
|
).attr(
|
|
30807
30921
|
"fill",
|
|
30808
30922
|
chartFormatOptions.plotArea.dataLabelValueColor !== commonColors.white ? chartFormatOptions.plotArea.dataLabelValueColor : chartFormatOptions.toolTip.toolTipDisplayUnits
|
|
@@ -31462,17 +31576,8 @@ const RadialBarChart = ({
|
|
|
31462
31576
|
try {
|
|
31463
31577
|
let arcTween = function(d, i) {
|
|
31464
31578
|
try {
|
|
31465
|
-
|
|
31466
|
-
|
|
31467
|
-
{ endAngle: scale2(Math.abs(d.data[0].value)) }
|
|
31468
|
-
);
|
|
31469
|
-
return (t) => arc2(
|
|
31470
|
-
{
|
|
31471
|
-
...d,
|
|
31472
|
-
endAngle: interpolate2(t)
|
|
31473
|
-
},
|
|
31474
|
-
i
|
|
31475
|
-
);
|
|
31579
|
+
const interpolate2 = interpolate$4(0, scale2(Math.abs(d.data[0].value)));
|
|
31580
|
+
return (t) => animArc({ ...d, endAngle: interpolate2(t) }, i);
|
|
31476
31581
|
} catch (error) {
|
|
31477
31582
|
logError("RadialBarChart.tsx", "arcTween", error);
|
|
31478
31583
|
}
|
|
@@ -31535,7 +31640,7 @@ const RadialBarChart = ({
|
|
|
31535
31640
|
);
|
|
31536
31641
|
const numArcs = keys.length;
|
|
31537
31642
|
const arcWidth = (chartRadius - arcMinRadius - numArcs * arcPadding) / numArcs;
|
|
31538
|
-
let
|
|
31643
|
+
let animArc = arc$1().innerRadius((_d, i) => getInnerRadius(i)).outerRadius((_d, i) => getOuterRadius(i)).startAngle(0).endAngle((d) => d.endAngle);
|
|
31539
31644
|
let dummyArc = arc$1().innerRadius((d, i) => getInnerRadius(i)).outerRadius((d, i) => getOuterRadius(i)).startAngle(0).endAngle(degToRad(360));
|
|
31540
31645
|
let radialAxis = svg2.append("g").attr("class", "r axis").selectAll("g").data(ChartData).enter().append("g");
|
|
31541
31646
|
if (chartFormatOptions.plotArea.axialGrid) {
|
|
@@ -31585,7 +31690,7 @@ const RadialBarChart = ({
|
|
|
31585
31690
|
"visibility",
|
|
31586
31691
|
chartFormatOptions.plotArea.axialAxis ? "visible" : "hidden"
|
|
31587
31692
|
);
|
|
31588
|
-
let arcs = svg2.attr("class", "data").selectAll("path").data(ChartData).enter().append("path").attr("class", "parentGroup").attr("hoverId", (d) => d.data[0].legend.replaceAll(" ", "-")).
|
|
31693
|
+
let arcs = svg2.attr("class", "data").selectAll("path").data(ChartData).enter().append("path").attr("class", "parentGroup").attr("hoverId", (d) => d.data[0].legend.replaceAll(" ", "-")).attr("fill", (d) => d.properties.color).attr("d", (d, i) => animArc({ ...d, endAngle: 0 }, i)).on("mousemove", (event2, d) => {
|
|
31589
31694
|
showTooltipOnMouseMove(
|
|
31590
31695
|
[
|
|
31591
31696
|
{
|
|
@@ -31609,9 +31714,17 @@ const RadialBarChart = ({
|
|
|
31609
31714
|
}).on("mouseout", () => {
|
|
31610
31715
|
hideTooltipOnMouseOut();
|
|
31611
31716
|
});
|
|
31612
|
-
|
|
31717
|
+
if (chartFormatOptions.animation.animationEnabled) {
|
|
31718
|
+
arcs.transition().duration(chartFormatOptions.animation.animationDuration).ease(effectsMap[chartFormatOptions.animation.animationEffect]).attrTween("d", arcTween);
|
|
31719
|
+
} else {
|
|
31720
|
+
arcs.attr("d", (d, i) => animArc({ ...d, endAngle: scale2(Math.abs(d.data[0].value)) }, i));
|
|
31721
|
+
}
|
|
31613
31722
|
if (chartFormatOptions.plotArea.dataLabels) {
|
|
31614
|
-
const labelsData =
|
|
31723
|
+
const labelsData = applyPlotAreaRangeFilter(
|
|
31724
|
+
getModifiedDataForLabels(ChartData),
|
|
31725
|
+
chartFormatOptions,
|
|
31726
|
+
(d) => d?.data?.[0]?.value ?? 0
|
|
31727
|
+
);
|
|
31615
31728
|
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(
|
|
31616
31729
|
(d) => ` ${d.properties.alias}
|
|
31617
31730
|
${chartFormatOptions.plotArea.dataLabelValue ? getNumberWithFormatFunction(
|
|
@@ -31656,7 +31769,7 @@ const RadialBarChart = ({
|
|
|
31656
31769
|
hideTooltipOnMouseOut();
|
|
31657
31770
|
});
|
|
31658
31771
|
arcs.each((d, i) => {
|
|
31659
|
-
svg2.append("path").attr("id", `arc-path-${i}-` + chartId).attr("d", dummyArc(d, i)).
|
|
31772
|
+
svg2.append("path").attr("id", `arc-path-${i}-` + chartId).attr("d", dummyArc(d, i)).attr("fill", "none").attr("stroke", "none");
|
|
31660
31773
|
});
|
|
31661
31774
|
}
|
|
31662
31775
|
} catch (error) {
|
|
@@ -73511,7 +73624,7 @@ const CJSPieChart = ({
|
|
|
73511
73624
|
formatOptions,
|
|
73512
73625
|
clientWidth,
|
|
73513
73626
|
clientHeight,
|
|
73514
|
-
colorBank
|
|
73627
|
+
colorBank
|
|
73515
73628
|
}) => {
|
|
73516
73629
|
const chartData = useMemo(
|
|
73517
73630
|
() => transformToChartJSData(data, "pie", formatOptions, colorBank),
|
|
@@ -11264,7 +11264,13 @@
|
|
|
11264
11264
|
dataLabelsCoordinates: [],
|
|
11265
11265
|
hideInsignificantValue: false,
|
|
11266
11266
|
sortBy: "default",
|
|
11267
|
-
chartDirection: "top"
|
|
11267
|
+
chartDirection: "top",
|
|
11268
|
+
plotAreaRangeFilter: {
|
|
11269
|
+
enabled: false,
|
|
11270
|
+
condition: "lt",
|
|
11271
|
+
minVal: 0,
|
|
11272
|
+
maxVal: 100
|
|
11273
|
+
}
|
|
11268
11274
|
},
|
|
11269
11275
|
heatMap: {
|
|
11270
11276
|
showHeatMap: false,
|
|
@@ -11297,7 +11303,13 @@
|
|
|
11297
11303
|
annotationBoxVisibility: [],
|
|
11298
11304
|
annotationHideZeroValues: true,
|
|
11299
11305
|
annotationShowHiddenValues: true,
|
|
11300
|
-
annotationSetLabelColor: "1"
|
|
11306
|
+
annotationSetLabelColor: "1",
|
|
11307
|
+
annotationRangeFilter: {
|
|
11308
|
+
enabled: false,
|
|
11309
|
+
condition: "lt",
|
|
11310
|
+
minVal: 0,
|
|
11311
|
+
maxVal: 100
|
|
11312
|
+
}
|
|
11301
11313
|
},
|
|
11302
11314
|
total: {
|
|
11303
11315
|
totalVisibility: false,
|
|
@@ -13137,6 +13149,25 @@
|
|
|
13137
13149
|
// end (label)
|
|
13138
13150
|
];
|
|
13139
13151
|
}
|
|
13152
|
+
function applyAnnotationRangeFilter(annotationsList, formatOptions, getMeasure) {
|
|
13153
|
+
if (!formatOptions.annotation.annotationRangeFilter?.enabled) return annotationsList;
|
|
13154
|
+
const { condition, minVal, maxVal } = formatOptions.annotation.annotationRangeFilter;
|
|
13155
|
+
return annotationsList.filter((item) => {
|
|
13156
|
+
const measure = getMeasure(item);
|
|
13157
|
+
switch (condition) {
|
|
13158
|
+
case "lt":
|
|
13159
|
+
return measure <= maxVal;
|
|
13160
|
+
case "gt":
|
|
13161
|
+
return measure >= minVal;
|
|
13162
|
+
case "in":
|
|
13163
|
+
return measure >= minVal && measure <= maxVal;
|
|
13164
|
+
case "not-in":
|
|
13165
|
+
return measure < minVal || measure > maxVal;
|
|
13166
|
+
default:
|
|
13167
|
+
return true;
|
|
13168
|
+
}
|
|
13169
|
+
});
|
|
13170
|
+
}
|
|
13140
13171
|
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) {
|
|
13141
13172
|
try {
|
|
13142
13173
|
const isTornadoChart = chartType === chartTypes.TornadoChart;
|
|
@@ -13400,6 +13431,11 @@
|
|
|
13400
13431
|
(d) => barChart ? d.data.x.measure !== 0 : d.data.y.measure !== 0
|
|
13401
13432
|
);
|
|
13402
13433
|
}
|
|
13434
|
+
annotationsList = applyAnnotationRangeFilter(
|
|
13435
|
+
annotationsList,
|
|
13436
|
+
formatOptions,
|
|
13437
|
+
(d) => barChart ? d.data.x.measure : d.data.y.measure
|
|
13438
|
+
);
|
|
13403
13439
|
if (oldAnnotationList.length === 0) {
|
|
13404
13440
|
oldAnnotationList = annotationsList;
|
|
13405
13441
|
oldMap = new Map(
|
|
@@ -13948,6 +13984,11 @@
|
|
|
13948
13984
|
if (formatOptions.annotation.annotationHideZeroValues) {
|
|
13949
13985
|
annotationsList = annotationsList.filter((d) => d.data.y !== 0);
|
|
13950
13986
|
}
|
|
13987
|
+
annotationsList = applyAnnotationRangeFilter(
|
|
13988
|
+
annotationsList,
|
|
13989
|
+
formatOptions,
|
|
13990
|
+
(d) => d.data.y
|
|
13991
|
+
);
|
|
13951
13992
|
if (oldAnnotationList.length === 0) {
|
|
13952
13993
|
oldAnnotationList = annotationsList;
|
|
13953
13994
|
oldMap = new Map(
|
|
@@ -15404,6 +15445,11 @@
|
|
|
15404
15445
|
// ?
|
|
15405
15446
|
annotationsList.push(singleAnnotation);
|
|
15406
15447
|
});
|
|
15448
|
+
annotationsList = applyAnnotationRangeFilter(
|
|
15449
|
+
annotationsList,
|
|
15450
|
+
formatOptions,
|
|
15451
|
+
(d) => barChart ? d.data.x : d.data.y
|
|
15452
|
+
);
|
|
15407
15453
|
if (oldAnnotationList.length === 0) {
|
|
15408
15454
|
oldAnnotationList = annotationsList;
|
|
15409
15455
|
oldMap = new Map(
|
|
@@ -20898,6 +20944,25 @@
|
|
|
20898
20944
|
) });
|
|
20899
20945
|
};
|
|
20900
20946
|
const fileName$a = "ChartsWithoutAxisFunctions.ts";
|
|
20947
|
+
function applyPlotAreaRangeFilter(labelsList, formatOptions, getMeasure) {
|
|
20948
|
+
if (!formatOptions?.plotArea?.plotAreaRangeFilter?.enabled) return labelsList;
|
|
20949
|
+
const { condition, minVal, maxVal } = formatOptions.plotArea.plotAreaRangeFilter;
|
|
20950
|
+
return labelsList.filter((item) => {
|
|
20951
|
+
const measure = getMeasure(item);
|
|
20952
|
+
switch (condition) {
|
|
20953
|
+
case "lt":
|
|
20954
|
+
return measure <= maxVal;
|
|
20955
|
+
case "gt":
|
|
20956
|
+
return measure >= minVal;
|
|
20957
|
+
case "in":
|
|
20958
|
+
return measure >= minVal && measure <= maxVal;
|
|
20959
|
+
case "not-in":
|
|
20960
|
+
return measure < minVal || measure > maxVal;
|
|
20961
|
+
default:
|
|
20962
|
+
return true;
|
|
20963
|
+
}
|
|
20964
|
+
});
|
|
20965
|
+
}
|
|
20901
20966
|
function marginCalculationForBubbleScatter(width, height, maxMeasure, formatOptions, maxDimension, maxLegendDimensions) {
|
|
20902
20967
|
try {
|
|
20903
20968
|
formatOptions.xAxisLabel.xAxisDateFormat = formatOptions.xAxisLabel.xAxisDateFormat == "DD-MM-YYYY" ? "," : formatOptions.xAxisLabel.xAxisDateFormat;
|
|
@@ -21480,6 +21545,11 @@
|
|
|
21480
21545
|
let AnnotationsList = chartData.filter((d) => d.x1 - d.x0 > 1e-4).map(createAnnotation);
|
|
21481
21546
|
const visibleFilter = (d) => (d.data.y?.value ?? 0) !== 0;
|
|
21482
21547
|
AnnotationsList = AnnotationsList.filter(visibleFilter);
|
|
21548
|
+
AnnotationsList = applyAnnotationRangeFilter(
|
|
21549
|
+
AnnotationsList,
|
|
21550
|
+
formatOptions,
|
|
21551
|
+
(d) => d.data.y.value
|
|
21552
|
+
);
|
|
21483
21553
|
let oldMap = new Map(
|
|
21484
21554
|
oldAnnotationList.map((d) => [
|
|
21485
21555
|
d.data?.x?.legend,
|
|
@@ -28863,8 +28933,10 @@
|
|
|
28863
28933
|
if (chartFormatOptions.plotArea.dataLabels) {
|
|
28864
28934
|
const isSingleDataLabel = pieChartData && pieChartData.length === 1;
|
|
28865
28935
|
chartAreaTagG.append("g").attr("class", "parentGroup").attr("transform", `${getPiePosition()}`).attr("pointer-events", "none").attr("text-anchor", "middle").selectAll("text").data(
|
|
28866
|
-
|
|
28867
|
-
(d) => d.data.properties.dataLabelPosition == "1"
|
|
28936
|
+
applyAnnotationRangeFilter(
|
|
28937
|
+
pieChartData.filter((d) => d.data.properties.dataLabelPosition == "1"),
|
|
28938
|
+
chartFormatOptions,
|
|
28939
|
+
(d) => d.data.data[0].value
|
|
28868
28940
|
)
|
|
28869
28941
|
).enter().append("text").attr(
|
|
28870
28942
|
"hoverId",
|
|
@@ -28900,8 +28972,10 @@
|
|
|
28900
28972
|
return "";
|
|
28901
28973
|
});
|
|
28902
28974
|
chartAreaTagG.append("g").attr("class", "parentGroup").attr("transform", `${getPiePosition()}`).attr("pointer-events", "none").attr("text-anchor", "middle").selectAll("text").data(
|
|
28903
|
-
|
|
28904
|
-
(d) => d.data.properties.dataLabelPosition == "1"
|
|
28975
|
+
applyAnnotationRangeFilter(
|
|
28976
|
+
pieChartData.filter((d) => d.data.properties.dataLabelPosition == "1"),
|
|
28977
|
+
chartFormatOptions,
|
|
28978
|
+
(d) => d.data.data[0].value
|
|
28905
28979
|
)
|
|
28906
28980
|
).enter().append("text").attr(
|
|
28907
28981
|
"hoverId",
|
|
@@ -28968,8 +29042,10 @@
|
|
|
28968
29042
|
let outerRadius = arc$1().startAngle((d) => d.x0).endAngle((d) => d.x1).innerRadius((d) => d.depth > 1 ? d.y1 - 1 + radius / 7 : 0).outerRadius((d) => d.depth > 1 ? d.y1 - 1 + radius / 7 : 0);
|
|
28969
29043
|
let innerRadius = arc$1().startAngle((d) => d.x0).endAngle((d) => d.x1).innerRadius((d) => d.depth > 2 ? d.y0 : 0).outerRadius((d) => d.y1 + radius / 1.5);
|
|
28970
29044
|
chartAreaTagG.selectAll("polyline").data(
|
|
28971
|
-
|
|
28972
|
-
(d) => d.data.properties.dataLabelPosition == "2"
|
|
29045
|
+
applyAnnotationRangeFilter(
|
|
29046
|
+
pieChartData.filter((d) => d.data.properties.dataLabelPosition == "2"),
|
|
29047
|
+
chartFormatOptions,
|
|
29048
|
+
(d) => d.data.data[0].value
|
|
28973
29049
|
)
|
|
28974
29050
|
).join("polyline").attr("transform", getPiePosition()).style(
|
|
28975
29051
|
"stroke",
|
|
@@ -28990,8 +29066,10 @@
|
|
|
28990
29066
|
return [posA, posB, [xC, yC]].map((point2) => point2.join(",")).join(" ");
|
|
28991
29067
|
});
|
|
28992
29068
|
chartAreaTagG.append("g").attr("transform", getPiePosition()).selectAll("foreignObject").data(
|
|
28993
|
-
|
|
28994
|
-
(d) => d.data.properties.dataLabelPosition == "2"
|
|
29069
|
+
applyAnnotationRangeFilter(
|
|
29070
|
+
pieChartData.filter((d) => d.data.properties.dataLabelPosition == "2"),
|
|
29071
|
+
chartFormatOptions,
|
|
29072
|
+
(d) => d.data.data[0].value
|
|
28995
29073
|
)
|
|
28996
29074
|
).join("foreignObject").attr("width", 80).attr("height", 60).attr("x", (d) => {
|
|
28997
29075
|
let midangle = d.x0 + (d.x1 - d.x0) / 2;
|
|
@@ -29298,8 +29376,10 @@
|
|
|
29298
29376
|
if (chartFormatOptions.plotArea.dataLabels) {
|
|
29299
29377
|
const isSingleDataLabel = pieChartData && pieChartData.length === 1;
|
|
29300
29378
|
chartAreaTagG.append("g").attr("class", "parentGroup").attr("transform", `${getPiePosition()}`).attr("pointer-events", "none").attr("text-anchor", "middle").selectAll("text").data(
|
|
29301
|
-
|
|
29302
|
-
(d) => d.data.properties.dataLabelPosition == "1"
|
|
29379
|
+
applyAnnotationRangeFilter(
|
|
29380
|
+
pieChartData.filter((d) => d.data.properties.dataLabelPosition == "1"),
|
|
29381
|
+
chartFormatOptions,
|
|
29382
|
+
(d) => d.data.data[0].value
|
|
29303
29383
|
)
|
|
29304
29384
|
).enter().append("text").attr(
|
|
29305
29385
|
"hoverId",
|
|
@@ -29335,8 +29415,10 @@
|
|
|
29335
29415
|
return "";
|
|
29336
29416
|
});
|
|
29337
29417
|
chartAreaTagG.append("g").attr("class", "parentGroup").attr("transform", `${getPiePosition()}`).attr("pointer-events", "none").attr("text-anchor", "middle").selectAll("text").data(
|
|
29338
|
-
|
|
29339
|
-
(d) => d.data.properties.dataLabelPosition == "1"
|
|
29418
|
+
applyAnnotationRangeFilter(
|
|
29419
|
+
pieChartData.filter((d) => d.data.properties.dataLabelPosition == "1"),
|
|
29420
|
+
chartFormatOptions,
|
|
29421
|
+
(d) => d.data.data[0].value
|
|
29340
29422
|
)
|
|
29341
29423
|
).enter().append("text").attr(
|
|
29342
29424
|
"hoverId",
|
|
@@ -29409,8 +29491,10 @@
|
|
|
29409
29491
|
let outerRadius = arc$1().startAngle((d) => d.x0).endAngle((d) => d.x1).innerRadius((d) => d.depth > 1 ? d.y1 - 1 + radius / 7 : 0).outerRadius((d) => d.depth > 1 ? d.y1 - 1 + radius / 7 : 0);
|
|
29410
29492
|
let innerRadius2 = arc$1().startAngle((d) => d.x0).endAngle((d) => d.x1).innerRadius((d) => d.depth > 2 ? d.y0 : 0).outerRadius((d) => d.y1 + radius / 1.5);
|
|
29411
29493
|
chartAreaTagG.selectAll("polyline").data(
|
|
29412
|
-
|
|
29413
|
-
(d) => d.data.properties.dataLabelPosition == "2"
|
|
29494
|
+
applyAnnotationRangeFilter(
|
|
29495
|
+
pieChartData.filter((d) => d.data.properties.dataLabelPosition == "2"),
|
|
29496
|
+
chartFormatOptions,
|
|
29497
|
+
(d) => d.data.data[0].value
|
|
29414
29498
|
)
|
|
29415
29499
|
).join("polyline").attr("transform", getPiePosition()).style(
|
|
29416
29500
|
"stroke",
|
|
@@ -29431,8 +29515,10 @@
|
|
|
29431
29515
|
return [posA, posB, [xC, yC]].map((point2) => point2.join(",")).join(" ");
|
|
29432
29516
|
});
|
|
29433
29517
|
chartAreaTagG.append("g").attr("transform", getPiePosition()).selectAll("foreignObject").data(
|
|
29434
|
-
|
|
29435
|
-
(d) => d.data.properties.dataLabelPosition == "2"
|
|
29518
|
+
applyAnnotationRangeFilter(
|
|
29519
|
+
pieChartData.filter((d) => d.data.properties.dataLabelPosition == "2"),
|
|
29520
|
+
chartFormatOptions,
|
|
29521
|
+
(d) => d.data.data[0].value
|
|
29436
29522
|
)
|
|
29437
29523
|
).join("foreignObject").attr("width", 80).attr("height", 60).attr("x", (d) => {
|
|
29438
29524
|
let midangle = d.x0 + (d.x1 - d.x0) / 2;
|
|
@@ -29731,7 +29817,23 @@
|
|
|
29731
29817
|
}
|
|
29732
29818
|
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);
|
|
29733
29819
|
if (chartFormatOptions.plotArea.dataLabels) {
|
|
29734
|
-
|
|
29820
|
+
const rf = chartFormatOptions.annotation.annotationRangeFilter;
|
|
29821
|
+
leaf.filter((d) => {
|
|
29822
|
+
if (!rf?.enabled) return true;
|
|
29823
|
+
const val = d.data.data[0].value;
|
|
29824
|
+
switch (rf.condition) {
|
|
29825
|
+
case "lt":
|
|
29826
|
+
return val < rf.maxVal;
|
|
29827
|
+
case "gt":
|
|
29828
|
+
return val > rf.minVal;
|
|
29829
|
+
case "in":
|
|
29830
|
+
return val >= rf.minVal && val <= rf.maxVal;
|
|
29831
|
+
case "not-in":
|
|
29832
|
+
return val < rf.minVal || val > rf.maxVal;
|
|
29833
|
+
default:
|
|
29834
|
+
return true;
|
|
29835
|
+
}
|
|
29836
|
+
}).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(
|
|
29735
29837
|
"font-style",
|
|
29736
29838
|
(d) => d.data.properties.fontStyle.includes(fontStyleOptions.italic) ? fontStyleOptions.italic : ""
|
|
29737
29839
|
).style(
|
|
@@ -30040,7 +30142,7 @@
|
|
|
30040
30142
|
const drawParentPieDataLabels = () => {
|
|
30041
30143
|
try {
|
|
30042
30144
|
if (chartFormatOptions.plotArea.dataLabels) {
|
|
30043
|
-
chartAreaTagG.append("g").attr("class", "parentLabels parentGroup").attr("transform", `${getParentPiePosition()}`).attr("pointer-events", "none").attr("text-anchor", "middle").selectAll("text").data(pieOfPieData).enter().append("text").attr("hoverId", (d) => d.data.legend.replace(/ /g, "-")).attr("font-size", (d) => d.data.properties?.labelFontSize ?? 11).attr(
|
|
30145
|
+
chartAreaTagG.append("g").attr("class", "parentLabels parentGroup").attr("transform", `${getParentPiePosition()}`).attr("pointer-events", "none").attr("text-anchor", "middle").selectAll("text").data(applyAnnotationRangeFilter(pieOfPieData, chartFormatOptions, (d) => d.data.data[0].value)).enter().append("text").attr("hoverId", (d) => d.data.legend.replace(/ /g, "-")).attr("font-size", (d) => d.data.properties?.labelFontSize ?? 11).attr(
|
|
30044
30146
|
"fill",
|
|
30045
30147
|
(d) => d.data.properties?.labelFontColor ?? commonColors.black
|
|
30046
30148
|
).attr(
|
|
@@ -30064,7 +30166,7 @@
|
|
|
30064
30166
|
}
|
|
30065
30167
|
return "";
|
|
30066
30168
|
});
|
|
30067
|
-
chartAreaTagG.append("g").attr("class", "parentLabels parentGroup").attr("transform", `${getParentPiePosition()}`).attr("pointer-events", "none").attr("text-anchor", "middle").selectAll("text").data(pieOfPieData).enter().append("text").attr("hoverId", (d) => d.data.legend.replace(/ /g, "-")).attr("font-size", (d) => d.data.properties?.valueFontSize ?? 11).attr(
|
|
30169
|
+
chartAreaTagG.append("g").attr("class", "parentLabels parentGroup").attr("transform", `${getParentPiePosition()}`).attr("pointer-events", "none").attr("text-anchor", "middle").selectAll("text").data(applyAnnotationRangeFilter(pieOfPieData, chartFormatOptions, (d) => d.data.data[0].value)).enter().append("text").attr("hoverId", (d) => d.data.legend.replace(/ /g, "-")).attr("font-size", (d) => d.data.properties?.valueFontSize ?? 11).attr(
|
|
30068
30170
|
"fill",
|
|
30069
30171
|
(d) => d.data.properties?.valueFontColor ?? commonColors.black
|
|
30070
30172
|
).attr(
|
|
@@ -30110,7 +30212,7 @@
|
|
|
30110
30212
|
const drawChildPieDataLabels = (childData) => {
|
|
30111
30213
|
try {
|
|
30112
30214
|
if (chartFormatOptions.plotArea.dataLabels) {
|
|
30113
|
-
chartAreaTagG.append("g").attr("class", "childLabels parentGroup").attr("transform", `${getChildPiePosition()}`).attr("pointer-events", "none").attr("text-anchor", "middle").selectAll("text").data(childData).enter().append("text").attr("hoverId", (d) => d.data.legend.replace(/ /g, "-")).attr("font-size", (d) => d.data.properties?.labelFontSize ?? 11).attr(
|
|
30215
|
+
chartAreaTagG.append("g").attr("class", "childLabels parentGroup").attr("transform", `${getChildPiePosition()}`).attr("pointer-events", "none").attr("text-anchor", "middle").selectAll("text").data(applyAnnotationRangeFilter(childData, chartFormatOptions, (d) => d.data.data[0].value)).enter().append("text").attr("hoverId", (d) => d.data.legend.replace(/ /g, "-")).attr("font-size", (d) => d.data.properties?.labelFontSize ?? 11).attr(
|
|
30114
30216
|
"fill",
|
|
30115
30217
|
(d) => d.data.properties?.labelFontColor ?? commonColors.black
|
|
30116
30218
|
).attr(
|
|
@@ -30134,7 +30236,7 @@
|
|
|
30134
30236
|
}
|
|
30135
30237
|
return "";
|
|
30136
30238
|
});
|
|
30137
|
-
chartAreaTagG.append("g").attr("class", "childLabels parentGroup").attr("transform", `${getChildPiePosition()}`).attr("pointer-events", "none").attr("text-anchor", "middle").selectAll("text").data(childData).enter().append("text").attr("hoverId", (d) => d.data.legend.replace(/ /g, "-")).attr("font-size", (d) => d.data.properties?.valueFontSize ?? 11).attr(
|
|
30239
|
+
chartAreaTagG.append("g").attr("class", "childLabels parentGroup").attr("transform", `${getChildPiePosition()}`).attr("pointer-events", "none").attr("text-anchor", "middle").selectAll("text").data(applyAnnotationRangeFilter(childData, chartFormatOptions, (d) => d.data.data[0].value)).enter().append("text").attr("hoverId", (d) => d.data.legend.replace(/ /g, "-")).attr("font-size", (d) => d.data.properties?.valueFontSize ?? 11).attr(
|
|
30138
30240
|
"fill",
|
|
30139
30241
|
(d) => d.data.properties?.valueFontColor ?? commonColors.black
|
|
30140
30242
|
).attr(
|
|
@@ -30383,7 +30485,11 @@
|
|
|
30383
30485
|
if (chartFormatOptions.annotation.annotationVisibility) {
|
|
30384
30486
|
let makeAnnotations = annotation();
|
|
30385
30487
|
let ConnectorType = chartFormatOptions.annotation.connectorType ? chartFormatOptions.annotation.connectorType.toLowerCase() : "None";
|
|
30386
|
-
let finalAnnotationList =
|
|
30488
|
+
let finalAnnotationList = applyAnnotationRangeFilter(
|
|
30489
|
+
annotationsList,
|
|
30490
|
+
chartFormatOptions,
|
|
30491
|
+
(item) => item.data.measure
|
|
30492
|
+
);
|
|
30387
30493
|
const connectorStyleKey = chartFormatOptions.annotation.connectorStyle?.toLowerCase();
|
|
30388
30494
|
makeAnnotations.editMode(chartFormatOptions.annotation.annotationDraggable).accessors({
|
|
30389
30495
|
x: function() {
|
|
@@ -30805,7 +30911,15 @@
|
|
|
30805
30911
|
});
|
|
30806
30912
|
chartAreaTagG.append("text").attr("transform", getTransformString()).attr("dy", "0.35em").attr("text-anchor", "middle").attr(
|
|
30807
30913
|
"visibility",
|
|
30808
|
-
|
|
30914
|
+
() => {
|
|
30915
|
+
if (!chartFormatOptions.plotArea.dataLabels) return "hidden";
|
|
30916
|
+
const passed = applyPlotAreaRangeFilter(
|
|
30917
|
+
[{ value: progressValue }],
|
|
30918
|
+
chartFormatOptions,
|
|
30919
|
+
(d) => d?.value ?? 0
|
|
30920
|
+
);
|
|
30921
|
+
return passed.length > 0 ? "visible" : "hidden";
|
|
30922
|
+
}
|
|
30809
30923
|
).attr(
|
|
30810
30924
|
"fill",
|
|
30811
30925
|
chartFormatOptions.plotArea.dataLabelValueColor !== commonColors.white ? chartFormatOptions.plotArea.dataLabelValueColor : chartFormatOptions.toolTip.toolTipDisplayUnits
|
|
@@ -31465,17 +31579,8 @@
|
|
|
31465
31579
|
try {
|
|
31466
31580
|
let arcTween = function(d, i) {
|
|
31467
31581
|
try {
|
|
31468
|
-
|
|
31469
|
-
|
|
31470
|
-
{ endAngle: scale2(Math.abs(d.data[0].value)) }
|
|
31471
|
-
);
|
|
31472
|
-
return (t) => arc2(
|
|
31473
|
-
{
|
|
31474
|
-
...d,
|
|
31475
|
-
endAngle: interpolate2(t)
|
|
31476
|
-
},
|
|
31477
|
-
i
|
|
31478
|
-
);
|
|
31582
|
+
const interpolate2 = interpolate$4(0, scale2(Math.abs(d.data[0].value)));
|
|
31583
|
+
return (t) => animArc({ ...d, endAngle: interpolate2(t) }, i);
|
|
31479
31584
|
} catch (error) {
|
|
31480
31585
|
logError("RadialBarChart.tsx", "arcTween", error);
|
|
31481
31586
|
}
|
|
@@ -31538,7 +31643,7 @@
|
|
|
31538
31643
|
);
|
|
31539
31644
|
const numArcs = keys.length;
|
|
31540
31645
|
const arcWidth = (chartRadius - arcMinRadius - numArcs * arcPadding) / numArcs;
|
|
31541
|
-
let
|
|
31646
|
+
let animArc = arc$1().innerRadius((_d, i) => getInnerRadius(i)).outerRadius((_d, i) => getOuterRadius(i)).startAngle(0).endAngle((d) => d.endAngle);
|
|
31542
31647
|
let dummyArc = arc$1().innerRadius((d, i) => getInnerRadius(i)).outerRadius((d, i) => getOuterRadius(i)).startAngle(0).endAngle(degToRad(360));
|
|
31543
31648
|
let radialAxis = svg2.append("g").attr("class", "r axis").selectAll("g").data(ChartData).enter().append("g");
|
|
31544
31649
|
if (chartFormatOptions.plotArea.axialGrid) {
|
|
@@ -31588,7 +31693,7 @@
|
|
|
31588
31693
|
"visibility",
|
|
31589
31694
|
chartFormatOptions.plotArea.axialAxis ? "visible" : "hidden"
|
|
31590
31695
|
);
|
|
31591
|
-
let arcs = svg2.attr("class", "data").selectAll("path").data(ChartData).enter().append("path").attr("class", "parentGroup").attr("hoverId", (d) => d.data[0].legend.replaceAll(" ", "-")).
|
|
31696
|
+
let arcs = svg2.attr("class", "data").selectAll("path").data(ChartData).enter().append("path").attr("class", "parentGroup").attr("hoverId", (d) => d.data[0].legend.replaceAll(" ", "-")).attr("fill", (d) => d.properties.color).attr("d", (d, i) => animArc({ ...d, endAngle: 0 }, i)).on("mousemove", (event2, d) => {
|
|
31592
31697
|
showTooltipOnMouseMove(
|
|
31593
31698
|
[
|
|
31594
31699
|
{
|
|
@@ -31612,9 +31717,17 @@
|
|
|
31612
31717
|
}).on("mouseout", () => {
|
|
31613
31718
|
hideTooltipOnMouseOut();
|
|
31614
31719
|
});
|
|
31615
|
-
|
|
31720
|
+
if (chartFormatOptions.animation.animationEnabled) {
|
|
31721
|
+
arcs.transition().duration(chartFormatOptions.animation.animationDuration).ease(effectsMap[chartFormatOptions.animation.animationEffect]).attrTween("d", arcTween);
|
|
31722
|
+
} else {
|
|
31723
|
+
arcs.attr("d", (d, i) => animArc({ ...d, endAngle: scale2(Math.abs(d.data[0].value)) }, i));
|
|
31724
|
+
}
|
|
31616
31725
|
if (chartFormatOptions.plotArea.dataLabels) {
|
|
31617
|
-
const labelsData =
|
|
31726
|
+
const labelsData = applyPlotAreaRangeFilter(
|
|
31727
|
+
getModifiedDataForLabels(ChartData),
|
|
31728
|
+
chartFormatOptions,
|
|
31729
|
+
(d) => d?.data?.[0]?.value ?? 0
|
|
31730
|
+
);
|
|
31618
31731
|
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(
|
|
31619
31732
|
(d) => ` ${d.properties.alias}
|
|
31620
31733
|
${chartFormatOptions.plotArea.dataLabelValue ? getNumberWithFormatFunction(
|
|
@@ -31659,7 +31772,7 @@
|
|
|
31659
31772
|
hideTooltipOnMouseOut();
|
|
31660
31773
|
});
|
|
31661
31774
|
arcs.each((d, i) => {
|
|
31662
|
-
svg2.append("path").attr("id", `arc-path-${i}-` + chartId).attr("d", dummyArc(d, i)).
|
|
31775
|
+
svg2.append("path").attr("id", `arc-path-${i}-` + chartId).attr("d", dummyArc(d, i)).attr("fill", "none").attr("stroke", "none");
|
|
31663
31776
|
});
|
|
31664
31777
|
}
|
|
31665
31778
|
} catch (error) {
|
|
@@ -73514,7 +73627,7 @@ ${formattedValue}` : formattedValue;
|
|
|
73514
73627
|
formatOptions,
|
|
73515
73628
|
clientWidth,
|
|
73516
73629
|
clientHeight,
|
|
73517
|
-
colorBank
|
|
73630
|
+
colorBank
|
|
73518
73631
|
}) => {
|
|
73519
73632
|
const chartData = require$$0$1.useMemo(
|
|
73520
73633
|
() => transformToChartJSData(data, "pie", formatOptions, colorBank),
|