pace-chart-lib 1.0.70 → 1.0.71
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/ChartsWithAxisTypes.types.d.ts +4 -0
- package/dist/Components/Charts/ChartsWithoutAxis/ChartsWithoutAxisTypes.types.d.ts +5 -0
- package/dist/Components/Charts/Core/Common.types.d.ts +5 -0
- package/dist/Components/Charts/Core/CommonFunctions.d.ts +3 -2
- package/dist/Components/Charts/Core/VfxInteraction.d.ts +25 -0
- package/dist/pace-chart-lib.es.js +390 -73
- package/dist/pace-chart-lib.umd.js +390 -73
- package/package.json +1 -1
|
@@ -16240,6 +16240,22 @@ const chartProperties = {
|
|
|
16240
16240
|
tooltip: "",
|
|
16241
16241
|
tooltipMeasure: ""
|
|
16242
16242
|
};
|
|
16243
|
+
var VfxDataAttr = /* @__PURE__ */ ((VfxDataAttr2) => {
|
|
16244
|
+
VfxDataAttr2["SeriesId"] = "data-series-id";
|
|
16245
|
+
VfxDataAttr2["DimValue"] = "data-dim-value";
|
|
16246
|
+
return VfxDataAttr2;
|
|
16247
|
+
})(VfxDataAttr || {});
|
|
16248
|
+
const VFX_TOOLTIP_FONT_SIZE = "11px";
|
|
16249
|
+
const VFX_TOOLTIP_LINE_HEIGHT = "1.6";
|
|
16250
|
+
function makeVfxClickHandler(vfxPickModeActiveRef, onElementClickRef, buildPayload) {
|
|
16251
|
+
return (_event, datum2) => {
|
|
16252
|
+
if (!vfxPickModeActiveRef.current || !onElementClickRef.current) return;
|
|
16253
|
+
onElementClickRef.current(buildPayload(_event, datum2));
|
|
16254
|
+
};
|
|
16255
|
+
}
|
|
16256
|
+
function resolveCustomTooltipHTML(tooltipFormatter, dimValue, seriesProperties) {
|
|
16257
|
+
return tooltipFormatter?.(dimValue, seriesProperties) ?? void 0;
|
|
16258
|
+
}
|
|
16243
16259
|
const fileName$b = "CommonFunctions.ts";
|
|
16244
16260
|
[
|
|
16245
16261
|
chartTypes.ColumnChart,
|
|
@@ -16371,7 +16387,7 @@ function calculateMaxLegendWidth(list, formatOptions) {
|
|
|
16371
16387
|
logError$2(fileName$b, "calculateMaxLegendWidth", error);
|
|
16372
16388
|
}
|
|
16373
16389
|
}
|
|
16374
|
-
function lineMarkers(lines, chartData, type, xScale, yScale, yScaleRight, tooltipHandle, formatOptions, chartJSON, secondaryCustomYaxisMaxValue, secondaryCustomYaxisMinValue, customYaxisMinValue, customYaxisMaxValue, isNormalizedChart) {
|
|
16390
|
+
function lineMarkers(lines, chartData, type, xScale, yScale, yScaleRight, tooltipHandle, formatOptions, chartJSON, secondaryCustomYaxisMaxValue, secondaryCustomYaxisMinValue, customYaxisMinValue, customYaxisMaxValue, isNormalizedChart, tooltipFormatter) {
|
|
16375
16391
|
try {
|
|
16376
16392
|
let hideZeroValues = formatOptions.plotArea.hideZeroValues;
|
|
16377
16393
|
formatOptions.plotArea.plotAreaHideLineAndMarkers === void 0 ? formatOptions.plotArea.plotAreaHideLineAndMarkers = true : null;
|
|
@@ -16408,6 +16424,10 @@ function lineMarkers(lines, chartData, type, xScale, yScale, yScaleRight, toolti
|
|
|
16408
16424
|
const dataPoint = d;
|
|
16409
16425
|
const legendEntry = d;
|
|
16410
16426
|
const parentG = select$2(this.parentNode);
|
|
16427
|
+
const _dimVal = String(chartJSON.formattedDimensionListMap.get(
|
|
16428
|
+
Array.isArray(dataPoint.dimension) ? dataPoint.dimension[0] : dataPoint.dimension
|
|
16429
|
+
) ?? "");
|
|
16430
|
+
const _customHTML = tooltipFormatter?.(_dimVal, d) ?? void 0;
|
|
16411
16431
|
showTooltipOnMouseMove(
|
|
16412
16432
|
[
|
|
16413
16433
|
{
|
|
@@ -16436,7 +16456,8 @@ function lineMarkers(lines, chartData, type, xScale, yScale, yScaleRight, toolti
|
|
|
16436
16456
|
],
|
|
16437
16457
|
formatOptions,
|
|
16438
16458
|
event2,
|
|
16439
|
-
d
|
|
16459
|
+
d,
|
|
16460
|
+
_customHTML
|
|
16440
16461
|
);
|
|
16441
16462
|
parentG.selectAll(".halo").remove();
|
|
16442
16463
|
parentG.insert("circle", ":first-child").attr("class", "halo").attr("cx", xScale(dataPoint.dimension)).attr("cy", () => {
|
|
@@ -16727,7 +16748,7 @@ function getAutoNumberWithFormat(value2) {
|
|
|
16727
16748
|
if (abs2 >= 1e3) return (value2 / 1e3).toFixed(2) + "K";
|
|
16728
16749
|
return value2.toFixed(2);
|
|
16729
16750
|
}
|
|
16730
|
-
function showTooltipOnMouseMove(elements, chartFormatOptions, event2, prop) {
|
|
16751
|
+
function showTooltipOnMouseMove(elements, chartFormatOptions, event2, prop, customHTML) {
|
|
16731
16752
|
try {
|
|
16732
16753
|
const markerColor = prop?.color ?? prop?.markerColor ?? "blue";
|
|
16733
16754
|
const markerShape = prop?.markerShape?.toLowerCase() ?? "circle";
|
|
@@ -16827,12 +16848,9 @@ function showTooltipOnMouseMove(elements, chartFormatOptions, event2, prop) {
|
|
|
16827
16848
|
`;
|
|
16828
16849
|
return p;
|
|
16829
16850
|
}, ``);
|
|
16830
|
-
tooltip.html(
|
|
16831
|
-
|
|
16832
|
-
|
|
16833
|
-
${tooltipElements}
|
|
16834
|
-
</div>
|
|
16835
|
-
`);
|
|
16851
|
+
tooltip.html(
|
|
16852
|
+
customHTML ? `<div class="tooltipInner" style="display:flex; flex-direction:column; font-size:${VFX_TOOLTIP_FONT_SIZE}; color:${textColor}; line-height:${VFX_TOOLTIP_LINE_HEIGHT};">${customHTML}</div>` : `<div class="arrow-placeholder"></div><div class="tooltipInner" style="display:flex; flex-direction:column;">${tooltipElements}</div>`
|
|
16853
|
+
);
|
|
16836
16854
|
const tooltipNode = tooltip.node();
|
|
16837
16855
|
const tooltipWidth = tooltipNode.offsetWidth;
|
|
16838
16856
|
const tooltipHeight = tooltipNode.offsetHeight;
|
|
@@ -17494,13 +17512,22 @@ const ColumnChart = ({
|
|
|
17494
17512
|
data,
|
|
17495
17513
|
isReportEditable,
|
|
17496
17514
|
onDataLabelCoordinatesChange,
|
|
17497
|
-
addLocalFilterFromLib
|
|
17515
|
+
addLocalFilterFromLib,
|
|
17516
|
+
tooltipFormatter,
|
|
17517
|
+
onElementClick,
|
|
17518
|
+
vfxPickModeActive
|
|
17498
17519
|
}) => {
|
|
17499
17520
|
const chartId = crypto.randomUUID();
|
|
17500
17521
|
let columnWidth = 0;
|
|
17501
17522
|
let scrollbarVisible = false;
|
|
17502
17523
|
const chartType = chartTypes.ColumnChart;
|
|
17503
17524
|
const svgRef = useRef();
|
|
17525
|
+
const tooltipFormatterRef = useRef(tooltipFormatter);
|
|
17526
|
+
tooltipFormatterRef.current = tooltipFormatter;
|
|
17527
|
+
const onElementClickRef = useRef(onElementClick);
|
|
17528
|
+
onElementClickRef.current = onElementClick;
|
|
17529
|
+
const vfxPickModeActiveRef = useRef(vfxPickModeActive);
|
|
17530
|
+
vfxPickModeActiveRef.current = vfxPickModeActive;
|
|
17504
17531
|
const seriesData = generalizedChartData(
|
|
17505
17532
|
data.ChartData,
|
|
17506
17533
|
data.DimensionList
|
|
@@ -17922,7 +17949,7 @@ const ColumnChart = ({
|
|
|
17922
17949
|
).style("clip-path", "inset(0px) fill-box").style("shape-rendering", "crispEdges").attr(
|
|
17923
17950
|
"visibility",
|
|
17924
17951
|
(d) => d.value === 0 && formatOptions.xAxisLabel.hideZeroValues ? "hidden" : "visible"
|
|
17925
|
-
);
|
|
17952
|
+
).attr(VfxDataAttr.SeriesId, () => data2.properties.legendUniqueId).attr(VfxDataAttr.DimValue, (d) => Array.isArray(d.dimension) ? String(d.dimension[0]) : String(d.dimension));
|
|
17926
17953
|
const finalBars = formatOptions.animation.animationEnabled ? bars.transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]) : bars;
|
|
17927
17954
|
finalBars.attr("y", (d) => {
|
|
17928
17955
|
const yScale = data2.properties.axis === axisTypes.primary ? yScaleLeft : yScaleRight;
|
|
@@ -17933,13 +17960,17 @@ const ColumnChart = ({
|
|
|
17933
17960
|
});
|
|
17934
17961
|
columnGroupsEnter.merge(columnGroups).on("mousemove", (event2, d) => {
|
|
17935
17962
|
(data2.properties.alias || data2.properties.name || "Legend").replace(/ /g, "-");
|
|
17963
|
+
const _dimVal = String(
|
|
17964
|
+
chartJSON.formattedDimensionListMap.get(
|
|
17965
|
+
Array.isArray(d.dimension) ? d.dimension[0] : d.dimension
|
|
17966
|
+
) ?? ""
|
|
17967
|
+
);
|
|
17968
|
+
const _customHTML = resolveCustomTooltipHTML(tooltipFormatterRef.current, _dimVal, data2.properties);
|
|
17936
17969
|
showTooltipOnMouseMove(
|
|
17937
17970
|
[
|
|
17938
17971
|
{
|
|
17939
17972
|
key: formatOptions.xAxisTitle.xAxisTitleHTML !== "" ? new DOMParser().parseFromString(formatOptions.xAxisTitle.xAxisTitleHTML, "text/html").body.textContent?.trim() : formatOptions.xAxisTitle.xAxisTitleText.includes("~$~") ? formatOptions.xAxisTitle.xAxisTitleText.split("~$~")[1] : formatOptions.xAxisTitle.xAxisTitleText,
|
|
17940
|
-
value:
|
|
17941
|
-
Array.isArray(d.dimension) ? d.dimension[0] : d.dimension
|
|
17942
|
-
)
|
|
17973
|
+
value: _dimVal
|
|
17943
17974
|
},
|
|
17944
17975
|
{
|
|
17945
17976
|
key: formatOptions.yAxisTitle.yAxisTitleHTML !== "" ? new DOMParser().parseFromString(formatOptions.yAxisTitle.yAxisTitleHTML, "text/html").body.textContent?.trim() : d.properties?.currentMeasure ? d.properties.currentMeasure : formatOptions.yAxisTitle.yAxisTitleText || d.value,
|
|
@@ -17961,12 +17992,19 @@ const ColumnChart = ({
|
|
|
17961
17992
|
],
|
|
17962
17993
|
formatOptions,
|
|
17963
17994
|
event2,
|
|
17964
|
-
data2.properties
|
|
17995
|
+
data2.properties,
|
|
17996
|
+
_customHTML
|
|
17965
17997
|
);
|
|
17966
17998
|
}).on("mouseout", (event2, d) => {
|
|
17967
17999
|
(data2.properties.alias || data2.properties.name || "Legend").replace(/ /g, "-");
|
|
17968
18000
|
hideTooltipOnMouseOut();
|
|
17969
18001
|
});
|
|
18002
|
+
columnGroupsEnter.merge(columnGroups).on("click", makeVfxClickHandler(vfxPickModeActiveRef, onElementClickRef, (_event, d) => ({
|
|
18003
|
+
seriesId: data2.properties.legendUniqueId,
|
|
18004
|
+
dimValue: Array.isArray(d.dimension) ? String(d.dimension[0]) : String(d.dimension),
|
|
18005
|
+
legendUniqueId: data2.properties.legendUniqueId,
|
|
18006
|
+
seriesDisplayName: data2.properties.alias || data2.properties.name || ""
|
|
18007
|
+
})));
|
|
17970
18008
|
columnGroups.exit().remove();
|
|
17971
18009
|
});
|
|
17972
18010
|
gTag.selectAll(".parentGroup").raise();
|
|
@@ -18070,7 +18108,9 @@ const CustomColumnChart = ({
|
|
|
18070
18108
|
data,
|
|
18071
18109
|
isReportEditable,
|
|
18072
18110
|
onDataLabelCoordinatesChange,
|
|
18073
|
-
addLocalFilterFromLib
|
|
18111
|
+
addLocalFilterFromLib,
|
|
18112
|
+
onElementClick,
|
|
18113
|
+
vfxPickModeActive
|
|
18074
18114
|
}) => {
|
|
18075
18115
|
const chartId = crypto.randomUUID();
|
|
18076
18116
|
let columnWidth = 0;
|
|
@@ -18078,6 +18118,10 @@ const CustomColumnChart = ({
|
|
|
18078
18118
|
let stackChartData = [];
|
|
18079
18119
|
const chartType = chartTypes.CustomColumnChart;
|
|
18080
18120
|
const svgRef = useRef();
|
|
18121
|
+
const onElementClickRef = useRef(onElementClick);
|
|
18122
|
+
onElementClickRef.current = onElementClick;
|
|
18123
|
+
const vfxPickModeActiveRef = useRef(vfxPickModeActive);
|
|
18124
|
+
vfxPickModeActiveRef.current = vfxPickModeActive;
|
|
18081
18125
|
const seriesData = generalizedChartData(
|
|
18082
18126
|
data.ChartData,
|
|
18083
18127
|
data.DimensionList
|
|
@@ -18652,7 +18696,7 @@ const CustomColumnChart = ({
|
|
|
18652
18696
|
).style("clip-path", "inset(0px) fill-box").style("shape-rendering", "crispEdges").attr(
|
|
18653
18697
|
"visibility",
|
|
18654
18698
|
(d) => d.value === 0 && formatOptions.xAxisLabel.hideZeroValues ? "hidden" : "visible"
|
|
18655
|
-
).on("mousemove", (event2, d) => {
|
|
18699
|
+
).attr(VfxDataAttr.SeriesId, () => data2.properties.legendUniqueId).attr(VfxDataAttr.DimValue, (d) => Array.isArray(d.dimension) ? String(d.dimension[0]) : String(d.dimension)).on("mousemove", (event2, d) => {
|
|
18656
18700
|
showTooltipOnMouseMove(
|
|
18657
18701
|
[
|
|
18658
18702
|
{
|
|
@@ -18683,7 +18727,12 @@ const CustomColumnChart = ({
|
|
|
18683
18727
|
event2,
|
|
18684
18728
|
seriesData.filter((e) => e.legend === d.legend)[0].properties
|
|
18685
18729
|
);
|
|
18686
|
-
}).on("mouseout", hideTooltipOnMouseOut)
|
|
18730
|
+
}).on("mouseout", hideTooltipOnMouseOut).on("click", makeVfxClickHandler(vfxPickModeActiveRef, onElementClickRef, (_event, d) => ({
|
|
18731
|
+
seriesId: data2.properties.legendUniqueId,
|
|
18732
|
+
dimValue: Array.isArray(d.dimension) ? String(d.dimension[0]) : String(d.dimension),
|
|
18733
|
+
legendUniqueId: data2.properties.legendUniqueId,
|
|
18734
|
+
seriesDisplayName: data2.properties.alias || data2.properties.name || ""
|
|
18735
|
+
})));
|
|
18687
18736
|
const finalBars = formatOptions.animation.animationEnabled ? bars.transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]) : bars;
|
|
18688
18737
|
finalBars.attr("y", (d) => {
|
|
18689
18738
|
const yScale = data2.properties.axis === axisTypes.primary ? yScaleLeft : yScaleRight;
|
|
@@ -18988,7 +19037,12 @@ const CustomColumnChart = ({
|
|
|
18988
19037
|
event2,
|
|
18989
19038
|
seriesData.filter((e) => e.legend === d.key)[0].properties
|
|
18990
19039
|
);
|
|
18991
|
-
}).on("mouseout", hideTooltipOnMouseOut)
|
|
19040
|
+
}).on("mouseout", hideTooltipOnMouseOut).attr(VfxDataAttr.SeriesId, (d) => d.key ?? "").attr(VfxDataAttr.DimValue, (d) => Array.isArray(d.data.dimension) ? String(d.data.dimension[0]) : String(d.data.dimension)).on("click", makeVfxClickHandler(vfxPickModeActiveRef, onElementClickRef, (_event, d) => ({
|
|
19041
|
+
seriesId: d.key ?? "",
|
|
19042
|
+
dimValue: Array.isArray(d.data.dimension) ? String(d.data.dimension[0]) : String(d.data.dimension),
|
|
19043
|
+
legendUniqueId: d.key ?? "",
|
|
19044
|
+
seriesDisplayName: d.alias || d.key || ""
|
|
19045
|
+
})));
|
|
18992
19046
|
const finalStackRects = formatOptions.animation.animationEnabled ? rectsEnter.transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]) : rectsEnter;
|
|
18993
19047
|
finalStackRects.attr(
|
|
18994
19048
|
"y",
|
|
@@ -19207,12 +19261,18 @@ const LayeredColumnChart = ({
|
|
|
19207
19261
|
data,
|
|
19208
19262
|
isReportEditable,
|
|
19209
19263
|
onDataLabelCoordinatesChange,
|
|
19210
|
-
addLocalFilterFromLib
|
|
19264
|
+
addLocalFilterFromLib,
|
|
19265
|
+
onElementClick,
|
|
19266
|
+
vfxPickModeActive
|
|
19211
19267
|
}) => {
|
|
19212
19268
|
const chartId = crypto.randomUUID();
|
|
19213
19269
|
let columnWidth = 0;
|
|
19214
19270
|
const chartType = chartTypes.LayeredColumnChart;
|
|
19215
19271
|
const svgRef = useRef();
|
|
19272
|
+
const onElementClickRef = useRef(onElementClick);
|
|
19273
|
+
onElementClickRef.current = onElementClick;
|
|
19274
|
+
const vfxPickModeActiveRef = useRef(vfxPickModeActive);
|
|
19275
|
+
vfxPickModeActiveRef.current = vfxPickModeActive;
|
|
19216
19276
|
const seriesData = generalizedChartData(
|
|
19217
19277
|
data.ChartData,
|
|
19218
19278
|
data.DimensionList
|
|
@@ -19602,7 +19662,7 @@ const LayeredColumnChart = ({
|
|
|
19602
19662
|
).style("clip-path", "inset(0px) fill-box").style("shape-rendering", "crispEdges").attr("opacity", 0.7).attr(
|
|
19603
19663
|
"visibility",
|
|
19604
19664
|
(d) => d.value === 0 && formatOptions.xAxisLabel.hideZeroValues ? "hidden" : "visible"
|
|
19605
|
-
);
|
|
19665
|
+
).attr(VfxDataAttr.SeriesId, () => data2.properties.legendUniqueId).attr(VfxDataAttr.DimValue, (d) => Array.isArray(d.dimension) ? String(d.dimension[0]) : String(d.dimension));
|
|
19606
19666
|
const finalBars = formatOptions.animation.animationEnabled ? bars.transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]) : bars;
|
|
19607
19667
|
finalBars.attr("y", (d) => {
|
|
19608
19668
|
const yScale = data2.properties.axis === axisTypes.primary ? yScaleLeft : yScaleRight;
|
|
@@ -19658,6 +19718,12 @@ const LayeredColumnChart = ({
|
|
|
19658
19718
|
selectAll('[hoverId="' + legend + '"]').classed("highlight", false).classed("unhighlight", false);
|
|
19659
19719
|
hideTooltipOnMouseOut();
|
|
19660
19720
|
});
|
|
19721
|
+
columnGroupsEnter.merge(columnGroups).on("click", makeVfxClickHandler(vfxPickModeActiveRef, onElementClickRef, (_event, d) => ({
|
|
19722
|
+
seriesId: data2.properties.legendUniqueId,
|
|
19723
|
+
dimValue: Array.isArray(d.dimension) ? String(d.dimension[0]) : String(d.dimension),
|
|
19724
|
+
legendUniqueId: data2.properties.legendUniqueId,
|
|
19725
|
+
seriesDisplayName: data2.properties.alias || data2.properties.name || ""
|
|
19726
|
+
})));
|
|
19661
19727
|
columnGroups.exit().remove();
|
|
19662
19728
|
});
|
|
19663
19729
|
gTag.selectAll(".parentGroup").raise();
|
|
@@ -19765,13 +19831,20 @@ const StackColumnChart = ({
|
|
|
19765
19831
|
data,
|
|
19766
19832
|
isReportEditable,
|
|
19767
19833
|
onDataLabelCoordinatesChange,
|
|
19768
|
-
addLocalFilterFromLib
|
|
19834
|
+
addLocalFilterFromLib,
|
|
19835
|
+
tooltipFormatter,
|
|
19836
|
+
onElementClick,
|
|
19837
|
+
vfxPickModeActive
|
|
19769
19838
|
}) => {
|
|
19770
19839
|
const chartId = crypto.randomUUID();
|
|
19771
19840
|
let columnWidth = 0;
|
|
19772
19841
|
let scrollbarVisible = false;
|
|
19773
19842
|
const chartType = chartTypes.StackColumnChart;
|
|
19774
19843
|
const svgRef = useRef();
|
|
19844
|
+
const onElementClickRef = useRef(onElementClick);
|
|
19845
|
+
onElementClickRef.current = onElementClick;
|
|
19846
|
+
const vfxPickModeActiveRef = useRef(vfxPickModeActive);
|
|
19847
|
+
vfxPickModeActiveRef.current = vfxPickModeActive;
|
|
19775
19848
|
const dimensionList = data.DimensionList;
|
|
19776
19849
|
const seriesData = (generalizedChartData(data.ChartData, data.DimensionList) || []).reverse();
|
|
19777
19850
|
const barChart = false;
|
|
@@ -20129,7 +20202,9 @@ const StackColumnChart = ({
|
|
|
20129
20202
|
}).style("clip-path", "inset(0px) fill-box").style("shape-rendering", "crispEdges").attr("visibility", (d, i, nodes) => {
|
|
20130
20203
|
const { props } = getPropsForRect(nodes, i);
|
|
20131
20204
|
return d.data[d.key] == 0 && props?.hideZeroValues ? "hidden" : "visible";
|
|
20132
|
-
}).on("mousemove", (event2, d) => {
|
|
20205
|
+
}).attr(VfxDataAttr.SeriesId, (d) => d.key ?? "").attr(VfxDataAttr.DimValue, (d) => Array.isArray(d.data.dimension) ? String(d.data.dimension[0]) : String(d.data.dimension)).on("mousemove", (event2, d) => {
|
|
20206
|
+
const _dimVal = String(chartJSON.formattedDimensionListMap.get(d.data.dimension) ?? "");
|
|
20207
|
+
const _customHTML = resolveCustomTooltipHTML(tooltipFormatter, _dimVal, d.properties);
|
|
20133
20208
|
showTooltipOnMouseMove(
|
|
20134
20209
|
[
|
|
20135
20210
|
{
|
|
@@ -20152,11 +20227,17 @@ const StackColumnChart = ({
|
|
|
20152
20227
|
],
|
|
20153
20228
|
formatOptions,
|
|
20154
20229
|
event2,
|
|
20155
|
-
d.properties
|
|
20230
|
+
d.properties,
|
|
20231
|
+
_customHTML
|
|
20156
20232
|
);
|
|
20157
20233
|
}).on("mouseout", (event2, d) => {
|
|
20158
20234
|
hideTooltipOnMouseOut();
|
|
20159
|
-
})
|
|
20235
|
+
}).on("click", makeVfxClickHandler(vfxPickModeActiveRef, onElementClickRef, (_event, d) => ({
|
|
20236
|
+
seriesId: d.key ?? "",
|
|
20237
|
+
dimValue: Array.isArray(d.data.dimension) ? String(d.data.dimension[0]) : String(d.data.dimension),
|
|
20238
|
+
legendUniqueId: d.key ?? "",
|
|
20239
|
+
seriesDisplayName: d.properties?.alias || d.key || ""
|
|
20240
|
+
})));
|
|
20160
20241
|
const finalRects = formatOptions.animation.animationEnabled ? baseRects.transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]) : baseRects;
|
|
20161
20242
|
finalRects.attr("y", (d) => d[1] >= d[0] ? yScaleLeft(d[1]) : yScaleLeft(d[0])).attr("height", (d) => Math.abs(yScaleLeft(d[0]) - yScaleLeft(d[1])));
|
|
20162
20243
|
columnGroups.exit().remove();
|
|
@@ -20505,12 +20586,18 @@ const NormalizedStackColumnChart = ({
|
|
|
20505
20586
|
data,
|
|
20506
20587
|
isReportEditable,
|
|
20507
20588
|
onDataLabelCoordinatesChange,
|
|
20508
|
-
addLocalFilterFromLib
|
|
20589
|
+
addLocalFilterFromLib,
|
|
20590
|
+
onElementClick,
|
|
20591
|
+
vfxPickModeActive
|
|
20509
20592
|
}) => {
|
|
20510
20593
|
const chartId = crypto.randomUUID();
|
|
20511
20594
|
let columnWidth = 0;
|
|
20512
20595
|
const chartType = chartTypes.NormalizedStackColumnChart;
|
|
20513
20596
|
const svgRef = useRef();
|
|
20597
|
+
const onElementClickRef = useRef(onElementClick);
|
|
20598
|
+
onElementClickRef.current = onElementClick;
|
|
20599
|
+
const vfxPickModeActiveRef = useRef(vfxPickModeActive);
|
|
20600
|
+
vfxPickModeActiveRef.current = vfxPickModeActive;
|
|
20514
20601
|
const seriesData = generalizedChartData(
|
|
20515
20602
|
data.ChartData,
|
|
20516
20603
|
data.DimensionList
|
|
@@ -20896,7 +20983,7 @@ const NormalizedStackColumnChart = ({
|
|
|
20896
20983
|
}).style("clip-path", "inset(0px) fill-box").style("shape-rendering", "crispEdges").attr("visibility", (d, i, nodes) => {
|
|
20897
20984
|
const { props } = getPropsForRect(nodes, i);
|
|
20898
20985
|
return d.data[d.key] === 0 && props?.hideZeroValues ? "hidden" : "visible";
|
|
20899
|
-
});
|
|
20986
|
+
}).attr(VfxDataAttr.SeriesId, (d) => d.key ?? "").attr(VfxDataAttr.DimValue, (d) => Array.isArray(d.data.dimension) ? String(d.data.dimension[0]) : String(d.data.dimension));
|
|
20900
20987
|
const shouldAnimate = formatOptions.animation.animationEnabled;
|
|
20901
20988
|
const applyTransition = (sel) => shouldAnimate ? sel.transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]) : sel;
|
|
20902
20989
|
applyTransition(rectsEnter).attr("y", (d) => d[1] >= d[0] ? yScaleLeft(d[1]) : yScaleLeft(d[0])).attr("height", (d) => Math.abs(yScaleLeft(d[0]) - yScaleLeft(d[1])));
|
|
@@ -20927,7 +21014,12 @@ const NormalizedStackColumnChart = ({
|
|
|
20927
21014
|
);
|
|
20928
21015
|
}).on("mouseout", (event2, d) => {
|
|
20929
21016
|
hideTooltipOnMouseOut();
|
|
20930
|
-
})
|
|
21017
|
+
}).on("click", makeVfxClickHandler(vfxPickModeActiveRef, onElementClickRef, (_event, d) => ({
|
|
21018
|
+
seriesId: d.key ?? "",
|
|
21019
|
+
dimValue: Array.isArray(d.data.dimension) ? String(d.data.dimension[0]) : String(d.data.dimension),
|
|
21020
|
+
legendUniqueId: d.key ?? "",
|
|
21021
|
+
seriesDisplayName: d.properties?.alias || d.key || ""
|
|
21022
|
+
})));
|
|
20931
21023
|
columnGroups.exit().remove();
|
|
20932
21024
|
gTag.selectAll(".parentGroup").raise();
|
|
20933
21025
|
};
|
|
@@ -22346,12 +22438,19 @@ const LineChart = ({
|
|
|
22346
22438
|
data,
|
|
22347
22439
|
isReportEditable,
|
|
22348
22440
|
onDataLabelCoordinatesChange,
|
|
22349
|
-
addLocalFilterFromLib
|
|
22441
|
+
addLocalFilterFromLib,
|
|
22442
|
+
tooltipFormatter,
|
|
22443
|
+
onElementClick,
|
|
22444
|
+
vfxPickModeActive
|
|
22350
22445
|
}) => {
|
|
22351
22446
|
const chartId = crypto.randomUUID();
|
|
22352
22447
|
const barWidth = 0;
|
|
22353
22448
|
const chartType = chartTypes.LineChart;
|
|
22354
22449
|
const svgRef = useRef();
|
|
22450
|
+
const onElementClickRef = useRef(onElementClick);
|
|
22451
|
+
onElementClickRef.current = onElementClick;
|
|
22452
|
+
const vfxPickModeActiveRef = useRef(vfxPickModeActive);
|
|
22453
|
+
vfxPickModeActiveRef.current = vfxPickModeActive;
|
|
22355
22454
|
const seriesData = generalizedChartData(
|
|
22356
22455
|
data.ChartData,
|
|
22357
22456
|
data.DimensionList
|
|
@@ -22787,7 +22886,12 @@ const LineChart = ({
|
|
|
22787
22886
|
).attr(
|
|
22788
22887
|
"hoverId",
|
|
22789
22888
|
(d.properties.alias || d.properties.name || "Legend").replace(/\s+/g, "-")
|
|
22790
|
-
).attr("clip-path", `url(#${chartId}-clip)`).attr("d", (d2) => lineGenerator(d2.data))
|
|
22889
|
+
).attr("clip-path", `url(#${chartId}-clip)`).attr("d", (d2) => lineGenerator(d2.data)).attr(VfxDataAttr.SeriesId, (d2) => d2.properties.legendUniqueId).attr(VfxDataAttr.DimValue, (d2) => d2.properties.alias || d2.properties.name || "").on("click", makeVfxClickHandler(vfxPickModeActiveRef, onElementClickRef, (_event, d2) => ({
|
|
22890
|
+
seriesId: d2.properties.legendUniqueId,
|
|
22891
|
+
dimValue: d2.properties.alias || d2.properties.name || "",
|
|
22892
|
+
legendUniqueId: d2.properties.legendUniqueId,
|
|
22893
|
+
seriesDisplayName: d2.properties.alias || d2.properties.name || ""
|
|
22894
|
+
})));
|
|
22791
22895
|
if (shouldAnimate) {
|
|
22792
22896
|
pathSel.each(function() {
|
|
22793
22897
|
const path2 = select$2(this);
|
|
@@ -22811,7 +22915,9 @@ const LineChart = ({
|
|
|
22811
22915
|
secondaryCustomYaxisMaxValue,
|
|
22812
22916
|
secondaryCustomYaxisMinValue,
|
|
22813
22917
|
customYaxisMinValue,
|
|
22814
|
-
customYaxisMaxValue
|
|
22918
|
+
customYaxisMaxValue,
|
|
22919
|
+
false,
|
|
22920
|
+
tooltipFormatter
|
|
22815
22921
|
);
|
|
22816
22922
|
gTag.selectAll(".parentGroup").raise();
|
|
22817
22923
|
};
|
|
@@ -22923,12 +23029,18 @@ const StackLineChart = ({
|
|
|
22923
23029
|
data,
|
|
22924
23030
|
isReportEditable,
|
|
22925
23031
|
onDataLabelCoordinatesChange,
|
|
22926
|
-
addLocalFilterFromLib
|
|
23032
|
+
addLocalFilterFromLib,
|
|
23033
|
+
onElementClick,
|
|
23034
|
+
vfxPickModeActive
|
|
22927
23035
|
}) => {
|
|
22928
23036
|
const chartId = crypto.randomUUID();
|
|
22929
23037
|
const barWidth = 0;
|
|
22930
23038
|
const chartType = chartTypes.StackLineChart;
|
|
22931
23039
|
const svgRef = useRef();
|
|
23040
|
+
const onElementClickRef = useRef(onElementClick);
|
|
23041
|
+
onElementClickRef.current = onElementClick;
|
|
23042
|
+
const vfxPickModeActiveRef = useRef(vfxPickModeActive);
|
|
23043
|
+
vfxPickModeActiveRef.current = vfxPickModeActive;
|
|
22932
23044
|
const dimensionList = data.DimensionList;
|
|
22933
23045
|
const seriesData = (generalizedChartData(data.ChartData, data.DimensionList) || []).reverse();
|
|
22934
23046
|
const barChart = false;
|
|
@@ -23329,7 +23441,12 @@ const StackLineChart = ({
|
|
|
23329
23441
|
).attr(
|
|
23330
23442
|
"stroke-width",
|
|
23331
23443
|
seriesData[i].properties.lineStyle !== staticLineStyle.none ? seriesData[i].properties.lineWidth : 0
|
|
23332
|
-
).attr("fill", "none")
|
|
23444
|
+
).attr("fill", "none").attr(VfxDataAttr.SeriesId, seriesData[i].properties.legendUniqueId).attr(VfxDataAttr.DimValue, seriesData[i].properties.alias || seriesData[i].properties.name || "").on("click", makeVfxClickHandler(vfxPickModeActiveRef, onElementClickRef, () => ({
|
|
23445
|
+
seriesId: seriesData[i].properties.legendUniqueId,
|
|
23446
|
+
dimValue: seriesData[i].properties.alias || seriesData[i].properties.name || "",
|
|
23447
|
+
legendUniqueId: seriesData[i].properties.legendUniqueId,
|
|
23448
|
+
seriesDisplayName: seriesData[i].properties.alias || seriesData[i].properties.name || ""
|
|
23449
|
+
})));
|
|
23333
23450
|
const enableTransition = formatOptions.animation.animationEnabled;
|
|
23334
23451
|
const totalLength = pathSel.node().getTotalLength();
|
|
23335
23452
|
if (enableTransition) {
|
|
@@ -23512,12 +23629,18 @@ const NormalisedStackLineChart = ({
|
|
|
23512
23629
|
data,
|
|
23513
23630
|
isReportEditable,
|
|
23514
23631
|
onDataLabelCoordinatesChange,
|
|
23515
|
-
addLocalFilterFromLib
|
|
23632
|
+
addLocalFilterFromLib,
|
|
23633
|
+
onElementClick,
|
|
23634
|
+
vfxPickModeActive
|
|
23516
23635
|
}) => {
|
|
23517
23636
|
const chartId = crypto.randomUUID();
|
|
23518
23637
|
const barWidth = 0;
|
|
23519
23638
|
const chartType = chartTypes.NormalizedStackLineChart;
|
|
23520
23639
|
const svgRef = useRef();
|
|
23640
|
+
const onElementClickRef = useRef(onElementClick);
|
|
23641
|
+
onElementClickRef.current = onElementClick;
|
|
23642
|
+
const vfxPickModeActiveRef = useRef(vfxPickModeActive);
|
|
23643
|
+
vfxPickModeActiveRef.current = vfxPickModeActive;
|
|
23521
23644
|
const seriesData = generalizedChartData(data.ChartData, data.DimensionList)?.reverse() || [];
|
|
23522
23645
|
const dimensionList = data.DimensionList;
|
|
23523
23646
|
const barChart = false;
|
|
@@ -23862,7 +23985,12 @@ const NormalisedStackLineChart = ({
|
|
|
23862
23985
|
).attr(
|
|
23863
23986
|
"stroke-width",
|
|
23864
23987
|
seriesData[i].properties.lineStyle !== staticLineStyle.none ? seriesData[i].properties.lineWidth : 0
|
|
23865
|
-
).attr("fill", "none")
|
|
23988
|
+
).attr("fill", "none").attr(VfxDataAttr.SeriesId, seriesData[i].properties.legendUniqueId).attr(VfxDataAttr.DimValue, seriesData[i].properties.alias || seriesData[i].properties.name || "").on("click", makeVfxClickHandler(vfxPickModeActiveRef, onElementClickRef, () => ({
|
|
23989
|
+
seriesId: seriesData[i].properties.legendUniqueId,
|
|
23990
|
+
dimValue: seriesData[i].properties.alias || seriesData[i].properties.name || "",
|
|
23991
|
+
legendUniqueId: seriesData[i].properties.legendUniqueId,
|
|
23992
|
+
seriesDisplayName: seriesData[i].properties.alias || seriesData[i].properties.name || ""
|
|
23993
|
+
})));
|
|
23866
23994
|
const enableTransition = formatOptions.animation.animationEnabled;
|
|
23867
23995
|
const totalLength = pathSel.node().getTotalLength();
|
|
23868
23996
|
if (enableTransition) {
|
|
@@ -24044,12 +24172,19 @@ const HorizontalBarChart = ({
|
|
|
24044
24172
|
data,
|
|
24045
24173
|
isReportEditable,
|
|
24046
24174
|
onDataLabelCoordinatesChange,
|
|
24047
|
-
addLocalFilterFromLib
|
|
24175
|
+
addLocalFilterFromLib,
|
|
24176
|
+
tooltipFormatter,
|
|
24177
|
+
onElementClick,
|
|
24178
|
+
vfxPickModeActive
|
|
24048
24179
|
}) => {
|
|
24049
24180
|
const chartId = crypto.randomUUID();
|
|
24050
24181
|
let columnWidth = 0;
|
|
24051
24182
|
const chartType = chartTypes.HorizontalBarChart;
|
|
24052
24183
|
const svgRef = useRef();
|
|
24184
|
+
const onElementClickRef = useRef(onElementClick);
|
|
24185
|
+
onElementClickRef.current = onElementClick;
|
|
24186
|
+
const vfxPickModeActiveRef = useRef(vfxPickModeActive);
|
|
24187
|
+
vfxPickModeActiveRef.current = vfxPickModeActive;
|
|
24053
24188
|
const seriesData = generalizedChartData(
|
|
24054
24189
|
data.ChartData,
|
|
24055
24190
|
data.DimensionList
|
|
@@ -24461,7 +24596,7 @@ const HorizontalBarChart = ({
|
|
|
24461
24596
|
).style("clip-path", "inset(0px) fill-box").style("shape-rendering", "crispEdges").attr(
|
|
24462
24597
|
"visibility",
|
|
24463
24598
|
(d) => d.value === 0 && formatOptions.xAxisLabel.hideZeroValues ? "hidden" : "visible"
|
|
24464
|
-
);
|
|
24599
|
+
).attr(VfxDataAttr.SeriesId, () => data2.properties.legendUniqueId).attr(VfxDataAttr.DimValue, (d) => Array.isArray(d.dimension) ? String(d.dimension[0]) : String(d.dimension));
|
|
24465
24600
|
const finalBars = formatOptions.animation.animationEnabled ? bars.transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]) : bars;
|
|
24466
24601
|
finalBars.attr("x", (d) => {
|
|
24467
24602
|
const xScaleUsed = data2.properties.axis === axisTypes.primary ? xScaleBottom : xScaleTop;
|
|
@@ -24477,6 +24612,10 @@ const HorizontalBarChart = ({
|
|
|
24477
24612
|
});
|
|
24478
24613
|
columnGroupsEnter.merge(columnGroups).on("mousemove", (event2, d) => {
|
|
24479
24614
|
(data2.properties.alias || data2.properties.name || "Legend").replace(/ /g, "-");
|
|
24615
|
+
const _dimVal = String(chartJSON.formattedDimensionListMap.get(
|
|
24616
|
+
Array.isArray(d.dimension) ? d.dimension[0] : d.dimension
|
|
24617
|
+
) ?? "");
|
|
24618
|
+
const _customHTML = resolveCustomTooltipHTML(tooltipFormatter, _dimVal, data2.properties);
|
|
24480
24619
|
showTooltipOnMouseMove(
|
|
24481
24620
|
[
|
|
24482
24621
|
{
|
|
@@ -24505,12 +24644,18 @@ const HorizontalBarChart = ({
|
|
|
24505
24644
|
],
|
|
24506
24645
|
formatOptions,
|
|
24507
24646
|
event2,
|
|
24508
|
-
data2.properties
|
|
24647
|
+
data2.properties,
|
|
24648
|
+
_customHTML
|
|
24509
24649
|
);
|
|
24510
24650
|
}).on("mouseout", (event2, d) => {
|
|
24511
24651
|
(data2.properties.alias || data2.properties.name || "Legend").replace(/ /g, "-");
|
|
24512
24652
|
hideTooltipOnMouseOut();
|
|
24513
|
-
})
|
|
24653
|
+
}).on("click", makeVfxClickHandler(vfxPickModeActiveRef, onElementClickRef, (_event, d) => ({
|
|
24654
|
+
seriesId: data2.properties.legendUniqueId,
|
|
24655
|
+
dimValue: Array.isArray(d.dimension) ? String(d.dimension[0]) : String(d.dimension),
|
|
24656
|
+
legendUniqueId: data2.properties.legendUniqueId,
|
|
24657
|
+
seriesDisplayName: data2.properties.alias || data2.properties.name || ""
|
|
24658
|
+
})));
|
|
24514
24659
|
columnGroups.exit().remove();
|
|
24515
24660
|
});
|
|
24516
24661
|
gTag.selectAll(".parentGroup").raise();
|
|
@@ -24597,12 +24742,18 @@ const StackHorizontalChart = ({
|
|
|
24597
24742
|
data,
|
|
24598
24743
|
isReportEditable,
|
|
24599
24744
|
onDataLabelCoordinatesChange,
|
|
24600
|
-
addLocalFilterFromLib
|
|
24745
|
+
addLocalFilterFromLib,
|
|
24746
|
+
onElementClick,
|
|
24747
|
+
vfxPickModeActive
|
|
24601
24748
|
}) => {
|
|
24602
24749
|
const chartId = crypto.randomUUID();
|
|
24603
24750
|
let columnWidth = 0;
|
|
24604
24751
|
const chartType = chartTypes.StackHorizontalBarChart;
|
|
24605
24752
|
const svgRef = useRef();
|
|
24753
|
+
const onElementClickRef = useRef(onElementClick);
|
|
24754
|
+
onElementClickRef.current = onElementClick;
|
|
24755
|
+
const vfxPickModeActiveRef = useRef(vfxPickModeActive);
|
|
24756
|
+
vfxPickModeActiveRef.current = vfxPickModeActive;
|
|
24606
24757
|
const seriesData = generalizedChartData(
|
|
24607
24758
|
data.ChartData,
|
|
24608
24759
|
data.DimensionList
|
|
@@ -24957,7 +25108,7 @@ const StackHorizontalChart = ({
|
|
|
24957
25108
|
).style("clip-path", "inset(0px) fill-box").style("shape-rendering", "crispEdges").attr("x", (d) => Math.min(xScaleBottom(d[0]), xScaleBottom(d[1]))).attr("width", 0).attr("visibility", (d, i, nodes) => {
|
|
24958
25109
|
const props = getPropsForRect(nodes, i).props;
|
|
24959
25110
|
return d.data[d.key] === 0 && props?.hideZeroValues ? "hidden" : "visible";
|
|
24960
|
-
}).on("mousemove", (event2, d) => {
|
|
25111
|
+
}).attr(VfxDataAttr.SeriesId, (d) => d.key ?? "").attr(VfxDataAttr.DimValue, (d) => Array.isArray(d.data.dimension) ? String(d.data.dimension[0]) : String(d.data.dimension)).on("mousemove", (event2, d) => {
|
|
24961
25112
|
const dim = d.data.dimension;
|
|
24962
25113
|
showTooltipOnMouseMove(
|
|
24963
25114
|
[
|
|
@@ -24986,7 +25137,12 @@ const StackHorizontalChart = ({
|
|
|
24986
25137
|
}).on("mouseout", (event2, d) => {
|
|
24987
25138
|
d.data.dimension;
|
|
24988
25139
|
hideTooltipOnMouseOut();
|
|
24989
|
-
})
|
|
25140
|
+
}).on("click", makeVfxClickHandler(vfxPickModeActiveRef, onElementClickRef, (_event, d) => ({
|
|
25141
|
+
seriesId: d.key,
|
|
25142
|
+
dimValue: Array.isArray(d.data.dimension) ? String(d.data.dimension[0]) : String(d.data.dimension),
|
|
25143
|
+
legendUniqueId: d.key,
|
|
25144
|
+
seriesDisplayName: d.properties?.alias || d.properties?.name || ""
|
|
25145
|
+
})));
|
|
24990
25146
|
baseRects.attr("x", (d) => xScaleBottom(0));
|
|
24991
25147
|
const finalRects = formatOptions.animation.animationEnabled ? baseRects.transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]) : baseRects;
|
|
24992
25148
|
finalRects.attr("x", (d) => Math.min(xScaleBottom(d[0]), xScaleBottom(d[1]))).attr("width", (d) => Math.abs(xScaleBottom(d[1]) - xScaleBottom(d[0])));
|
|
@@ -25322,12 +25478,18 @@ const NormalizedStackHorizontalBarChart = ({
|
|
|
25322
25478
|
data,
|
|
25323
25479
|
isReportEditable,
|
|
25324
25480
|
onDataLabelCoordinatesChange,
|
|
25325
|
-
addLocalFilterFromLib
|
|
25481
|
+
addLocalFilterFromLib,
|
|
25482
|
+
onElementClick,
|
|
25483
|
+
vfxPickModeActive
|
|
25326
25484
|
}) => {
|
|
25327
25485
|
const chartId = crypto.randomUUID();
|
|
25328
25486
|
let columnWidth = 0;
|
|
25329
25487
|
const chartType = chartTypes.NormalizedStackHorizontalBarChart;
|
|
25330
25488
|
const svgRef = useRef();
|
|
25489
|
+
const onElementClickRef = useRef(onElementClick);
|
|
25490
|
+
onElementClickRef.current = onElementClick;
|
|
25491
|
+
const vfxPickModeActiveRef = useRef(vfxPickModeActive);
|
|
25492
|
+
vfxPickModeActiveRef.current = vfxPickModeActive;
|
|
25331
25493
|
const seriesData = generalizedChartData(
|
|
25332
25494
|
data.ChartData,
|
|
25333
25495
|
data.DimensionList
|
|
@@ -25662,7 +25824,7 @@ const NormalizedStackHorizontalBarChart = ({
|
|
|
25662
25824
|
).style("clip-path", "inset(0px) fill-box").style("shape-rendering", "crispEdges").attr("x", (d) => xScaleBottom(0)).attr("width", 0).attr("visibility", (d, i, nodes) => {
|
|
25663
25825
|
const props = getPropsForRect(nodes, i).props;
|
|
25664
25826
|
return d.data[d.key] === 0 && props?.hideZeroValues ? "hidden" : "visible";
|
|
25665
|
-
}).on("mousemove", (event2, d) => {
|
|
25827
|
+
}).attr(VfxDataAttr.SeriesId, (d) => d.key ?? "").attr(VfxDataAttr.DimValue, (d) => Array.isArray(d.data.dimension) ? String(d.data.dimension[0]) : String(d.data.dimension)).on("mousemove", (event2, d) => {
|
|
25666
25828
|
const dim = d.data.dimension;
|
|
25667
25829
|
showTooltipOnMouseMove(
|
|
25668
25830
|
[
|
|
@@ -25693,7 +25855,12 @@ const NormalizedStackHorizontalBarChart = ({
|
|
|
25693
25855
|
selectAll(".parentGroup").classed("highlight", false).classed("unhighlight", false);
|
|
25694
25856
|
selectAll('[hoverId="' + legend + '"]').classed("highlight", false).classed("unhighlight", false);
|
|
25695
25857
|
hideTooltipOnMouseOut();
|
|
25696
|
-
})
|
|
25858
|
+
}).on("click", makeVfxClickHandler(vfxPickModeActiveRef, onElementClickRef, (_event, d) => ({
|
|
25859
|
+
seriesId: d.key,
|
|
25860
|
+
dimValue: Array.isArray(d.data.dimension) ? String(d.data.dimension[0]) : String(d.data.dimension),
|
|
25861
|
+
legendUniqueId: d.key,
|
|
25862
|
+
seriesDisplayName: d.properties?.alias || d.properties?.name || ""
|
|
25863
|
+
})));
|
|
25697
25864
|
const finalRects = formatOptions.animation.animationEnabled ? baseRects.transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]) : baseRects;
|
|
25698
25865
|
finalRects.attr("x", (d) => Math.min(xScaleBottom(d[0]), xScaleBottom(d[1]))).attr("width", (d) => Math.abs(xScaleBottom(d[1]) - xScaleBottom(d[0])));
|
|
25699
25866
|
columnGroups.exit().remove();
|
|
@@ -25803,12 +25970,18 @@ const LayeredHorizontalBarChart = ({
|
|
|
25803
25970
|
data,
|
|
25804
25971
|
isReportEditable,
|
|
25805
25972
|
onDataLabelCoordinatesChange,
|
|
25806
|
-
addLocalFilterFromLib
|
|
25973
|
+
addLocalFilterFromLib,
|
|
25974
|
+
onElementClick,
|
|
25975
|
+
vfxPickModeActive
|
|
25807
25976
|
}) => {
|
|
25808
25977
|
const chartId = crypto.randomUUID();
|
|
25809
25978
|
let columnWidth = 0;
|
|
25810
25979
|
const chartType = chartTypes.LayeredHorizontalBarChart;
|
|
25811
25980
|
const svgRef = useRef();
|
|
25981
|
+
const onElementClickRef = useRef(onElementClick);
|
|
25982
|
+
onElementClickRef.current = onElementClick;
|
|
25983
|
+
const vfxPickModeActiveRef = useRef(vfxPickModeActive);
|
|
25984
|
+
vfxPickModeActiveRef.current = vfxPickModeActive;
|
|
25812
25985
|
const seriesData = generalizedChartData(
|
|
25813
25986
|
data.ChartData,
|
|
25814
25987
|
data.DimensionList
|
|
@@ -26157,7 +26330,7 @@ const LayeredHorizontalBarChart = ({
|
|
|
26157
26330
|
).style("clip-path", "inset(0px) fill-box").style("shape-rendering", "crispEdges").attr("opacity", 0.7).attr(
|
|
26158
26331
|
"visibility",
|
|
26159
26332
|
(d) => d.value === 0 && formatOptions.xAxisLabel.hideZeroValues ? "hidden" : "visible"
|
|
26160
|
-
);
|
|
26333
|
+
).attr(VfxDataAttr.SeriesId, () => data2.properties.legendUniqueId).attr(VfxDataAttr.DimValue, (d) => Array.isArray(d.dimension) ? String(d.dimension[0]) : String(d.dimension));
|
|
26161
26334
|
const finalBars = formatOptions.animation.animationEnabled ? bars.transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]) : bars;
|
|
26162
26335
|
finalBars.attr(
|
|
26163
26336
|
"x",
|
|
@@ -26200,7 +26373,12 @@ const LayeredHorizontalBarChart = ({
|
|
|
26200
26373
|
);
|
|
26201
26374
|
}).on("mouseout", () => {
|
|
26202
26375
|
hideTooltipOnMouseOut();
|
|
26203
|
-
})
|
|
26376
|
+
}).on("click", makeVfxClickHandler(vfxPickModeActiveRef, onElementClickRef, (_event, d) => ({
|
|
26377
|
+
seriesId: data2.properties.legendUniqueId,
|
|
26378
|
+
dimValue: Array.isArray(d.dimension) ? String(d.dimension[0]) : String(d.dimension),
|
|
26379
|
+
legendUniqueId: data2.properties.legendUniqueId,
|
|
26380
|
+
seriesDisplayName: data2.properties.alias || data2.properties.name || ""
|
|
26381
|
+
})));
|
|
26204
26382
|
columnGroups.exit().remove();
|
|
26205
26383
|
});
|
|
26206
26384
|
gTag.selectAll(".parentGroup").raise();
|
|
@@ -27020,12 +27198,19 @@ const AreaChart = ({
|
|
|
27020
27198
|
data,
|
|
27021
27199
|
isReportEditable,
|
|
27022
27200
|
onDataLabelCoordinatesChange,
|
|
27023
|
-
addLocalFilterFromLib
|
|
27201
|
+
addLocalFilterFromLib,
|
|
27202
|
+
tooltipFormatter,
|
|
27203
|
+
onElementClick,
|
|
27204
|
+
vfxPickModeActive
|
|
27024
27205
|
}) => {
|
|
27025
27206
|
const chartId = crypto.randomUUID();
|
|
27026
27207
|
const barWidth = 0;
|
|
27027
27208
|
const chartType = chartTypes.AreaChart;
|
|
27028
27209
|
const svgRef = useRef();
|
|
27210
|
+
const onElementClickRef = useRef(onElementClick);
|
|
27211
|
+
onElementClickRef.current = onElementClick;
|
|
27212
|
+
const vfxPickModeActiveRef = useRef(vfxPickModeActive);
|
|
27213
|
+
vfxPickModeActiveRef.current = vfxPickModeActive;
|
|
27029
27214
|
const seriesData = generalizedChartData(
|
|
27030
27215
|
data.ChartData,
|
|
27031
27216
|
data.DimensionList
|
|
@@ -27442,7 +27627,12 @@ const AreaChart = ({
|
|
|
27442
27627
|
/\s+/g,
|
|
27443
27628
|
"-"
|
|
27444
27629
|
)
|
|
27445
|
-
).attr("d", (d) => areaGeneratorStart(d.data)).
|
|
27630
|
+
).attr("d", (d) => areaGeneratorStart(d.data)).attr(VfxDataAttr.SeriesId, (d) => d.properties.legendUniqueId).attr(VfxDataAttr.DimValue, (d) => d.properties.alias || d.properties.name || "").on("click", makeVfxClickHandler(vfxPickModeActiveRef, onElementClickRef, (_event, d) => ({
|
|
27631
|
+
seriesId: d.properties.legendUniqueId,
|
|
27632
|
+
dimValue: d.properties.alias || d.properties.name || "",
|
|
27633
|
+
legendUniqueId: d.properties.legendUniqueId,
|
|
27634
|
+
seriesDisplayName: d.properties.alias || d.properties.name || ""
|
|
27635
|
+
}))).each(function(d) {
|
|
27446
27636
|
if (enableTransition) {
|
|
27447
27637
|
select$2(this).transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]).attr("d", areaGenerator(d.data));
|
|
27448
27638
|
} else {
|
|
@@ -27501,7 +27691,9 @@ const AreaChart = ({
|
|
|
27501
27691
|
secondaryCustomYaxisMaxValue,
|
|
27502
27692
|
secondaryCustomYaxisMinValue,
|
|
27503
27693
|
customYaxisMinValue,
|
|
27504
|
-
customYaxisMaxValue
|
|
27694
|
+
customYaxisMaxValue,
|
|
27695
|
+
false,
|
|
27696
|
+
tooltipFormatter
|
|
27505
27697
|
);
|
|
27506
27698
|
gTag.selectAll(".parentGroup").raise();
|
|
27507
27699
|
gTag.selectAll(".hoverLine").raise();
|
|
@@ -27618,12 +27810,18 @@ const StackAreaChart = ({
|
|
|
27618
27810
|
data,
|
|
27619
27811
|
isReportEditable,
|
|
27620
27812
|
onDataLabelCoordinatesChange,
|
|
27621
|
-
addLocalFilterFromLib
|
|
27813
|
+
addLocalFilterFromLib,
|
|
27814
|
+
onElementClick,
|
|
27815
|
+
vfxPickModeActive
|
|
27622
27816
|
}) => {
|
|
27623
27817
|
const chartId = crypto.randomUUID();
|
|
27624
27818
|
const barWidth = 0;
|
|
27625
27819
|
const chartType = chartTypes.StackAreaChart;
|
|
27626
27820
|
const svgRef = useRef();
|
|
27821
|
+
const onElementClickRef = useRef(onElementClick);
|
|
27822
|
+
onElementClickRef.current = onElementClick;
|
|
27823
|
+
const vfxPickModeActiveRef = useRef(vfxPickModeActive);
|
|
27824
|
+
vfxPickModeActiveRef.current = vfxPickModeActive;
|
|
27627
27825
|
const seriesData = generalizedChartData(data.ChartData, data.DimensionList)?.reverse() || [];
|
|
27628
27826
|
const dimensionList = data.DimensionList;
|
|
27629
27827
|
const barChart = false;
|
|
@@ -28000,7 +28198,16 @@ const StackAreaChart = ({
|
|
|
28000
28198
|
areaGroupsEnter.append("path").attr(
|
|
28001
28199
|
"hoverId",
|
|
28002
28200
|
(d) => (lineData[d.index].properties.alias || lineData[d.index].properties.name || "Legend").replace(/\s+/g, "-")
|
|
28003
|
-
).attr("class", "area parentGroup").attr("fill", (d) => d.color !== commonColors.white ? d.color : "none").style("fill-opacity", formatOptions.plotArea.fillOpacity).style("pointer-events", "none").attr("d", (d) => areaGeneratorStart(d)).
|
|
28201
|
+
).attr("class", "area parentGroup").attr("fill", (d) => d.color !== commonColors.white ? d.color : "none").style("fill-opacity", formatOptions.plotArea.fillOpacity).style("pointer-events", "none").attr("d", (d) => areaGeneratorStart(d)).attr(VfxDataAttr.SeriesId, (d) => seriesData[d.index]?.properties?.legendUniqueId ?? d.key).attr(VfxDataAttr.DimValue, (d) => seriesData[d.index]?.properties?.alias || seriesData[d.index]?.properties?.name || "").on("click", makeVfxClickHandler(vfxPickModeActiveRef, onElementClickRef, (_event, d) => {
|
|
28202
|
+
const sid = seriesData[d.index]?.properties?.legendUniqueId ?? d.key;
|
|
28203
|
+
const displayName = seriesData[d.index]?.properties?.alias || seriesData[d.index]?.properties?.name || "";
|
|
28204
|
+
return {
|
|
28205
|
+
seriesId: sid,
|
|
28206
|
+
dimValue: displayName,
|
|
28207
|
+
legendUniqueId: sid,
|
|
28208
|
+
seriesDisplayName: displayName
|
|
28209
|
+
};
|
|
28210
|
+
})).each(function(d) {
|
|
28004
28211
|
if (enableTransition) {
|
|
28005
28212
|
select$2(this).transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]).attr("d", areaGenerator(d));
|
|
28006
28213
|
} else {
|
|
@@ -28226,12 +28433,18 @@ const NormalizedStackAreaChart = ({
|
|
|
28226
28433
|
data,
|
|
28227
28434
|
isReportEditable,
|
|
28228
28435
|
onDataLabelCoordinatesChange,
|
|
28229
|
-
addLocalFilterFromLib
|
|
28436
|
+
addLocalFilterFromLib,
|
|
28437
|
+
onElementClick,
|
|
28438
|
+
vfxPickModeActive
|
|
28230
28439
|
}) => {
|
|
28231
28440
|
const chartId = crypto.randomUUID();
|
|
28232
28441
|
const barWidth = 0;
|
|
28233
28442
|
const chartType = chartTypes.NormalizedStackAreaChart;
|
|
28234
28443
|
const svgRef = useRef();
|
|
28444
|
+
const onElementClickRef = useRef(onElementClick);
|
|
28445
|
+
onElementClickRef.current = onElementClick;
|
|
28446
|
+
const vfxPickModeActiveRef = useRef(vfxPickModeActive);
|
|
28447
|
+
vfxPickModeActiveRef.current = vfxPickModeActive;
|
|
28235
28448
|
const seriesData = generalizedChartData(data.ChartData, data.DimensionList)?.reverse() || [];
|
|
28236
28449
|
const dimensionList = data.DimensionList;
|
|
28237
28450
|
const barChart = false;
|
|
@@ -28573,7 +28786,16 @@ const NormalizedStackAreaChart = ({
|
|
|
28573
28786
|
areaGroupsEnter.append("path").attr(
|
|
28574
28787
|
"hoverId",
|
|
28575
28788
|
(d) => (lineData[d.index]?.properties?.alias || lineData[d.index]?.properties?.name || "Legend").replace(/\s+/g, "-")
|
|
28576
|
-
).attr("class", "area parentGroup").attr("fill", (d) => d.color !== commonColors.white ? d.color : "none").style("fill-opacity", formatOptions.plotArea.fillOpacity).style("pointer-events", "none").attr("d", (d) => columnGeneratorStart(d)).
|
|
28789
|
+
).attr("class", "area parentGroup").attr("fill", (d) => d.color !== commonColors.white ? d.color : "none").style("fill-opacity", formatOptions.plotArea.fillOpacity).style("pointer-events", "none").attr("d", (d) => columnGeneratorStart(d)).attr(VfxDataAttr.SeriesId, (d) => seriesData[d.index]?.properties?.legendUniqueId ?? d.key).attr(VfxDataAttr.DimValue, (d) => seriesData[d.index]?.properties?.alias || seriesData[d.index]?.properties?.name || "").on("click", makeVfxClickHandler(vfxPickModeActiveRef, onElementClickRef, (_event, d) => {
|
|
28790
|
+
const sid = seriesData[d.index]?.properties?.legendUniqueId ?? d.key;
|
|
28791
|
+
const displayName = seriesData[d.index]?.properties?.alias || seriesData[d.index]?.properties?.name || "";
|
|
28792
|
+
return {
|
|
28793
|
+
seriesId: sid,
|
|
28794
|
+
dimValue: displayName,
|
|
28795
|
+
legendUniqueId: sid,
|
|
28796
|
+
seriesDisplayName: displayName
|
|
28797
|
+
};
|
|
28798
|
+
})).each(function(d) {
|
|
28577
28799
|
const path2 = select$2(this);
|
|
28578
28800
|
if (enableTransition) {
|
|
28579
28801
|
path2.transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]).attr("d", columnGenerator(d));
|
|
@@ -28892,8 +29114,12 @@ const drawTotalValue = (chartFormatOptions, totalValue, chartTitleHeight, chartA
|
|
|
28892
29114
|
}
|
|
28893
29115
|
};
|
|
28894
29116
|
const fileName$8 = "PieChart.tsx";
|
|
28895
|
-
const PieChart = ({ data, formatOptions, chartId, isReportEditable, onDataLabelCoordinatesChange, addLocalFilterFromLib }) => {
|
|
29117
|
+
const PieChart = ({ data, formatOptions, chartId, isReportEditable, onDataLabelCoordinatesChange, addLocalFilterFromLib, onElementClick, vfxPickModeActive }) => {
|
|
28896
29118
|
const svgRef = useRef();
|
|
29119
|
+
const onElementClickRef = useRef(onElementClick);
|
|
29120
|
+
onElementClickRef.current = onElementClick;
|
|
29121
|
+
const vfxPickModeActiveRef = useRef(vfxPickModeActive);
|
|
29122
|
+
vfxPickModeActiveRef.current = vfxPickModeActive;
|
|
28897
29123
|
const seriesData = generalizedChartData(data.ChartData);
|
|
28898
29124
|
let chartFormatOptions;
|
|
28899
29125
|
let height;
|
|
@@ -29026,7 +29252,12 @@ const PieChart = ({ data, formatOptions, chartId, isReportEditable, onDataLabelC
|
|
|
29026
29252
|
).attr(
|
|
29027
29253
|
"fill",
|
|
29028
29254
|
(d) => d.data.properties.color !== commonColors.white ? d.data.properties.color : "none"
|
|
29029
|
-
).
|
|
29255
|
+
).attr(VfxDataAttr.SeriesId, (d) => d.data.properties.legendUniqueId ?? d.data.properties.name ?? "").attr(VfxDataAttr.DimValue, (d) => d.data.properties.alias || d.data.legend || "").on("click", makeVfxClickHandler(vfxPickModeActiveRef, onElementClickRef, (_event, d) => ({
|
|
29256
|
+
seriesId: d.data.properties.legendUniqueId ?? d.data.properties.name ?? "",
|
|
29257
|
+
dimValue: d.data.properties.alias || d.data.legend || "",
|
|
29258
|
+
legendUniqueId: d.data.properties.legendUniqueId ?? d.data.properties.name ?? "",
|
|
29259
|
+
seriesDisplayName: d.data.properties.alias || d.data.properties.name || ""
|
|
29260
|
+
}))).on("mouseover.arc", function(d) {
|
|
29030
29261
|
select$2(this).transition().duration(100).attr("d", arcOver);
|
|
29031
29262
|
}).on("mousemove. ", (d) => {
|
|
29032
29263
|
showTooltipOnMouseMove(
|
|
@@ -29328,9 +29559,15 @@ const DonutChart = ({
|
|
|
29328
29559
|
chartId,
|
|
29329
29560
|
isReportEditable,
|
|
29330
29561
|
onDataLabelCoordinatesChange,
|
|
29331
|
-
addLocalFilterFromLib
|
|
29562
|
+
addLocalFilterFromLib,
|
|
29563
|
+
onElementClick,
|
|
29564
|
+
vfxPickModeActive
|
|
29332
29565
|
}) => {
|
|
29333
29566
|
const svgRef = useRef();
|
|
29567
|
+
const onElementClickRef = useRef(onElementClick);
|
|
29568
|
+
onElementClickRef.current = onElementClick;
|
|
29569
|
+
const vfxPickModeActiveRef = useRef(vfxPickModeActive);
|
|
29570
|
+
vfxPickModeActiveRef.current = vfxPickModeActive;
|
|
29334
29571
|
const seriesData = generalizedChartData(data.ChartData);
|
|
29335
29572
|
let chartFormatOptions;
|
|
29336
29573
|
let width;
|
|
@@ -29463,7 +29700,12 @@ const DonutChart = ({
|
|
|
29463
29700
|
).attr(
|
|
29464
29701
|
"fill",
|
|
29465
29702
|
(d) => d.data.properties.color !== commonColors.white ? d.data.properties.color : "none"
|
|
29466
|
-
).
|
|
29703
|
+
).attr(VfxDataAttr.SeriesId, (d) => d.data.properties.legendUniqueId ?? d.data.properties.name ?? "").attr(VfxDataAttr.DimValue, (d) => d.data.properties.alias || d.data.legend || "").on("click", makeVfxClickHandler(vfxPickModeActiveRef, onElementClickRef, (_event, d) => ({
|
|
29704
|
+
seriesId: d.data.properties.legendUniqueId ?? d.data.properties.name ?? "",
|
|
29705
|
+
dimValue: d.data.properties.alias || d.data.legend || "",
|
|
29706
|
+
legendUniqueId: d.data.properties.legendUniqueId ?? d.data.properties.name ?? "",
|
|
29707
|
+
seriesDisplayName: d.data.properties.alias || d.data.properties.name || ""
|
|
29708
|
+
}))).each(function(d) {
|
|
29467
29709
|
const thisPath = d;
|
|
29468
29710
|
thisPath._current = { startAngle: 0, endAngle: 0 };
|
|
29469
29711
|
}).on("mouseover.arc", function() {
|
|
@@ -29826,8 +30068,12 @@ const DonutChart = ({
|
|
|
29826
30068
|
) });
|
|
29827
30069
|
};
|
|
29828
30070
|
const fileName$6 = "TreemapChart.tsx";
|
|
29829
|
-
const Treemap = ({ data, formatOptions, chartId }) => {
|
|
30071
|
+
const Treemap = ({ data, formatOptions, chartId, onElementClick, vfxPickModeActive }) => {
|
|
29830
30072
|
const svgRef = useRef();
|
|
30073
|
+
const onElementClickRef = useRef(onElementClick);
|
|
30074
|
+
onElementClickRef.current = onElementClick;
|
|
30075
|
+
const vfxPickModeActiveRef = useRef(vfxPickModeActive);
|
|
30076
|
+
vfxPickModeActiveRef.current = vfxPickModeActive;
|
|
29831
30077
|
let chartFormatOptions;
|
|
29832
30078
|
let width;
|
|
29833
30079
|
let height;
|
|
@@ -29994,7 +30240,16 @@ const Treemap = ({ data, formatOptions, chartId }) => {
|
|
|
29994
30240
|
void 0,
|
|
29995
30241
|
getMarkerColorForTooltip(d)
|
|
29996
30242
|
);
|
|
29997
|
-
}).on("mouseout", () => hideTooltipOnMouseOut())
|
|
30243
|
+
}).on("mouseout", () => hideTooltipOnMouseOut()).attr(VfxDataAttr.SeriesId, (d) => String(d.data.properties?.legendUniqueId ?? d.data.legend ?? "")).attr(VfxDataAttr.DimValue, (d) => String(d.data.data[0].legend ?? "")).on("click", makeVfxClickHandler(vfxPickModeActiveRef, onElementClickRef, (_event, d) => {
|
|
30244
|
+
const seriesId = String(d.data.properties?.legendUniqueId ?? d.data.legend ?? "");
|
|
30245
|
+
const dimValue = String(d.data.data[0].legend ?? "");
|
|
30246
|
+
return {
|
|
30247
|
+
seriesId,
|
|
30248
|
+
dimValue,
|
|
30249
|
+
legendUniqueId: seriesId,
|
|
30250
|
+
seriesDisplayName: String(d.data.properties?.alias || d.data.properties?.name || dimValue)
|
|
30251
|
+
};
|
|
30252
|
+
}));
|
|
29998
30253
|
if (shouldAnimate) {
|
|
29999
30254
|
rects.transition().duration(chartFormatOptions.animation.animationDuration).ease(effectsMap[chartFormatOptions.animation.animationEffect]).attr("fill-opacity", 0.7);
|
|
30000
30255
|
}
|
|
@@ -36477,12 +36732,18 @@ function Sankey() {
|
|
|
36477
36732
|
const SankeyChart = ({
|
|
36478
36733
|
formatOptions,
|
|
36479
36734
|
data,
|
|
36480
|
-
chartId
|
|
36735
|
+
chartId,
|
|
36736
|
+
onElementClick,
|
|
36737
|
+
vfxPickModeActive
|
|
36481
36738
|
}) => {
|
|
36482
36739
|
let sankeyLinks = JSON.parse(JSON.stringify(data?.sankeyLinks));
|
|
36483
36740
|
let sankeyNodes = JSON.parse(JSON.stringify(data?.sankeyNodes));
|
|
36484
36741
|
if (!data) return null;
|
|
36485
36742
|
const svgRef = useRef();
|
|
36743
|
+
const onElementClickRef = useRef(onElementClick);
|
|
36744
|
+
onElementClickRef.current = onElementClick;
|
|
36745
|
+
const vfxPickModeActiveRef = useRef(vfxPickModeActive);
|
|
36746
|
+
vfxPickModeActiveRef.current = vfxPickModeActive;
|
|
36486
36747
|
let chartFormatOptions;
|
|
36487
36748
|
let width;
|
|
36488
36749
|
let height;
|
|
@@ -36769,7 +37030,15 @@ const SankeyChart = ({
|
|
|
36769
37030
|
} catch (error) {
|
|
36770
37031
|
logError$2("SankeyChart.tsx", "Nodes.onMouseOut", error);
|
|
36771
37032
|
}
|
|
36772
|
-
})
|
|
37033
|
+
}).attr(VfxDataAttr.SeriesId, (d) => String(d.name ?? "")).attr(VfxDataAttr.DimValue, (d) => String(d.name ?? "")).on("click", makeVfxClickHandler(vfxPickModeActiveRef, onElementClickRef, (_event, d) => {
|
|
37034
|
+
const nodeName = String(d.name ?? "");
|
|
37035
|
+
return {
|
|
37036
|
+
seriesId: nodeName,
|
|
37037
|
+
dimValue: nodeName,
|
|
37038
|
+
legendUniqueId: nodeName,
|
|
37039
|
+
seriesDisplayName: nodeName.includes("~$~") ? nodeName.split("~$~")[1] : nodeName
|
|
37040
|
+
};
|
|
37041
|
+
}));
|
|
36773
37042
|
const link2 = chartAreaTagG.append("g").attr("fill", "none").selectAll("g").data(links).enter().append("g").style("mix-blend-mode", "multiply");
|
|
36774
37043
|
link2.append("path").attr("class", "sankey-links").attr("stroke-opacity", linksFillOpacity).attr("id", (d) => "Link" + d.index).attr("d", sankeyLinkCustom(curviness)).attr(
|
|
36775
37044
|
"stroke",
|
|
@@ -54977,8 +55246,15 @@ const BubbleChart = ({
|
|
|
54977
55246
|
data,
|
|
54978
55247
|
formatOptions,
|
|
54979
55248
|
chartId,
|
|
54980
|
-
addLocalFilterFromLib
|
|
55249
|
+
addLocalFilterFromLib,
|
|
55250
|
+
onElementClick,
|
|
55251
|
+
vfxPickModeActive
|
|
54981
55252
|
}) => {
|
|
55253
|
+
const onElementClickRef = useRef(onElementClick);
|
|
55254
|
+
onElementClickRef.current = onElementClick;
|
|
55255
|
+
const vfxPickModeActiveRef = useRef(vfxPickModeActive);
|
|
55256
|
+
vfxPickModeActiveRef.current = vfxPickModeActive;
|
|
55257
|
+
const legendIndexMap = new Map((data.ChartData ?? []).map((s2, i) => [s2.legend, i]));
|
|
54982
55258
|
let legendEntries = data.LegendList;
|
|
54983
55259
|
const svgRef = useRef();
|
|
54984
55260
|
let chartFormatOptions;
|
|
@@ -55151,10 +55427,15 @@ const BubbleChart = ({
|
|
|
55151
55427
|
);
|
|
55152
55428
|
}).attr("transform", function(d) {
|
|
55153
55429
|
return `translate(${xScale(d.dimension)}, ${yScale(d.measure)})`;
|
|
55154
|
-
}).attr("opacity", shouldAnimate ? 0 : chartFormatOptions.plotArea.fillOpacity).style(
|
|
55430
|
+
}).attr(VfxDataAttr.SeriesId, (d) => `${legendIndexMap.get(d.legendName)}_${d.legendName}`).attr(VfxDataAttr.DimValue, (d) => String(d.dimension)).attr("opacity", shouldAnimate ? 0 : chartFormatOptions.plotArea.fillOpacity).style(
|
|
55155
55431
|
"visibility",
|
|
55156
55432
|
(d, i) => d.dimension[0] === 0 || d.measure === 0 && chartFormatOptions.plotArea.hideZeroValues || d.dimension < customXaxisMinValue || d.dimension > customXaxisMaxValue || d.measure < customYaxisMinValue || d.measure > customYaxisMaxValue ? "hidden" : "visible"
|
|
55157
|
-
).on("
|
|
55433
|
+
).on("click", makeVfxClickHandler(vfxPickModeActiveRef, onElementClickRef, (_event, d) => ({
|
|
55434
|
+
seriesId: `${legendIndexMap.get(d.legendName)}_${d.legendName}`,
|
|
55435
|
+
dimValue: String(d.dimension),
|
|
55436
|
+
legendUniqueId: `${legendIndexMap.get(d.legendName)}_${d.legendName}`,
|
|
55437
|
+
seriesDisplayName: d.legendName
|
|
55438
|
+
}))).on("mousemove", (event2, d) => {
|
|
55158
55439
|
showTooltipOnMouseMove(
|
|
55159
55440
|
[
|
|
55160
55441
|
{
|
|
@@ -55437,10 +55718,17 @@ const fileName = "ScatterChart.tsx";
|
|
|
55437
55718
|
const ScatterChart = ({
|
|
55438
55719
|
data,
|
|
55439
55720
|
formatOptions,
|
|
55440
|
-
chartId
|
|
55721
|
+
chartId,
|
|
55722
|
+
onElementClick,
|
|
55723
|
+
vfxPickModeActive
|
|
55441
55724
|
}) => {
|
|
55725
|
+
const onElementClickRef = useRef(onElementClick);
|
|
55726
|
+
onElementClickRef.current = onElementClick;
|
|
55727
|
+
const vfxPickModeActiveRef = useRef(vfxPickModeActive);
|
|
55728
|
+
vfxPickModeActiveRef.current = vfxPickModeActive;
|
|
55442
55729
|
const colorsList = data.ColorElements ?? [];
|
|
55443
55730
|
const shapesList = data.ShapeElements ?? [];
|
|
55731
|
+
const colorIndexMap = new Map(colorsList.map((c2, i) => [c2.name, i]));
|
|
55444
55732
|
let modifiedData = [];
|
|
55445
55733
|
const svgRef = useRef();
|
|
55446
55734
|
let chartFormatOptions;
|
|
@@ -55606,10 +55894,15 @@ const ScatterChart = ({
|
|
|
55606
55894
|
);
|
|
55607
55895
|
}).attr("transform", function(d) {
|
|
55608
55896
|
return `translate(${xScale(d.dimension)}, ${yScale(d.measure)})`;
|
|
55609
|
-
}).attr("opacity", shouldAnimate ? 0 : chartFormatOptions.plotArea.fillOpacity).style(
|
|
55897
|
+
}).attr(VfxDataAttr.SeriesId, (d) => `${colorIndexMap.get(d.colorName)}_${d.colorName}`).attr(VfxDataAttr.DimValue, (d) => String(d.dimension)).attr("opacity", shouldAnimate ? 0 : chartFormatOptions.plotArea.fillOpacity).style(
|
|
55610
55898
|
"visibility",
|
|
55611
55899
|
(d, i) => d.dimension[0] === 0 || d.measure === 0 && chartFormatOptions.plotArea.hideZeroValues || d.dimension < customXaxisMinValue || d.dimension > customXaxisMaxValue || d.measure < customYaxisMinValue || d.measure > customYaxisMaxValue ? "hidden" : "visible"
|
|
55612
|
-
).on("
|
|
55900
|
+
).on("click", makeVfxClickHandler(vfxPickModeActiveRef, onElementClickRef, (_event, d) => ({
|
|
55901
|
+
seriesId: `${colorIndexMap.get(d.colorName)}_${d.colorName}`,
|
|
55902
|
+
dimValue: String(d.dimension),
|
|
55903
|
+
legendUniqueId: `${colorIndexMap.get(d.colorName)}_${d.colorName}`,
|
|
55904
|
+
seriesDisplayName: d.colorName
|
|
55905
|
+
}))).on("mousemove", (event2, d) => {
|
|
55613
55906
|
showTooltipOnMouseMove(
|
|
55614
55907
|
[
|
|
55615
55908
|
...[
|
|
@@ -56077,13 +56370,19 @@ const WaterfallChart = ({
|
|
|
56077
56370
|
isDateType,
|
|
56078
56371
|
formatOptions,
|
|
56079
56372
|
data,
|
|
56080
|
-
isAdvancedAnalyticsWaterFall = false
|
|
56373
|
+
isAdvancedAnalyticsWaterFall = false,
|
|
56374
|
+
onElementClick,
|
|
56375
|
+
vfxPickModeActive
|
|
56081
56376
|
}) => {
|
|
56082
56377
|
const chartId = crypto.randomUUID?.();
|
|
56083
56378
|
let columnWidth = 0;
|
|
56084
56379
|
let colorScale;
|
|
56085
56380
|
const chartType = chartTypes.WaterfallChart;
|
|
56086
56381
|
const svgRef = useRef();
|
|
56382
|
+
const onElementClickRef = useRef(onElementClick);
|
|
56383
|
+
onElementClickRef.current = onElementClick;
|
|
56384
|
+
const vfxPickModeActiveRef = useRef(vfxPickModeActive);
|
|
56385
|
+
vfxPickModeActiveRef.current = vfxPickModeActive;
|
|
56087
56386
|
const isAdvancedWaterfall = isAdvancedAnalyticsWaterFall ?? false;
|
|
56088
56387
|
const seriesData = isAdvancedWaterfall ? [] : generalizedChartData(data.ChartData, data.DimensionList);
|
|
56089
56388
|
const dimensionList = data.DimensionList;
|
|
@@ -56529,7 +56828,14 @@ const WaterfallChart = ({
|
|
|
56529
56828
|
);
|
|
56530
56829
|
}).on("mouseout", () => {
|
|
56531
56830
|
hideTooltipOnMouseOut();
|
|
56532
|
-
})
|
|
56831
|
+
}).attr(VfxDataAttr.SeriesId, (d) => String(d.key ?? d.Key ?? "")).attr(
|
|
56832
|
+
VfxDataAttr.DimValue,
|
|
56833
|
+
(d) => !isAdvancedWaterfall ? String(d.data.dimension || d.data.legend || "") : String(d.data.xKey || "")
|
|
56834
|
+
).on("click", makeVfxClickHandler(vfxPickModeActiveRef, onElementClickRef, (_event, d) => {
|
|
56835
|
+
const seriesId = String(d.key ?? d.Key ?? "");
|
|
56836
|
+
const dimValue = !isAdvancedWaterfall ? String(d.data.dimension || d.data.legend || "") : String(d.data.xKey || "");
|
|
56837
|
+
return { seriesId, dimValue, legendUniqueId: seriesId, seriesDisplayName: seriesId };
|
|
56838
|
+
}));
|
|
56533
56839
|
const finalRects = shouldAnimate ? rectsEnter.transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]) : rectsEnter;
|
|
56534
56840
|
finalRects.attr("y", (d) => d[1] ? yScaleLeft(d[1]) : 0).attr("height", (d) => d[1] ? yScaleLeft(d[0]) - yScaleLeft(d[1]) : 0);
|
|
56535
56841
|
rects.exit().remove();
|
|
@@ -56756,13 +57062,19 @@ const TornadoChart = ({
|
|
|
56756
57062
|
formatOptions,
|
|
56757
57063
|
data,
|
|
56758
57064
|
isReportEditable,
|
|
56759
|
-
onDataLabelCoordinatesChange
|
|
57065
|
+
onDataLabelCoordinatesChange,
|
|
57066
|
+
onElementClick,
|
|
57067
|
+
vfxPickModeActive
|
|
56760
57068
|
}) => {
|
|
56761
57069
|
const chartId = crypto.randomUUID();
|
|
56762
57070
|
let columnWidth = 0;
|
|
56763
57071
|
const chartType = chartTypes.TornadoChart;
|
|
56764
57072
|
const isAdvanceAnalyticsChart = data.IsadvanceanalyticsChart ?? data.IsCalCSensitivity;
|
|
56765
57073
|
const svgRef = useRef();
|
|
57074
|
+
const onElementClickRef = useRef(onElementClick);
|
|
57075
|
+
onElementClickRef.current = onElementClick;
|
|
57076
|
+
const vfxPickModeActiveRef = useRef(vfxPickModeActive);
|
|
57077
|
+
vfxPickModeActiveRef.current = vfxPickModeActive;
|
|
56766
57078
|
let seriesData = generalizedChartData(
|
|
56767
57079
|
data.ChartData,
|
|
56768
57080
|
data.DimensionList,
|
|
@@ -57216,7 +57528,12 @@ const TornadoChart = ({
|
|
|
57216
57528
|
event2,
|
|
57217
57529
|
!data.IsCalCSensitivity ? d.properties : d.properties.legend === "Calculated Low(-ve)" ? { markerColor: formatOptions.plotArea.plotAreaCalculatedLow } : { markerColor: formatOptions.plotArea.plotAreaCalculatedHigh }
|
|
57218
57530
|
);
|
|
57219
|
-
}).on("mouseout", hideTooltipOnMouseOut)
|
|
57531
|
+
}).on("mouseout", hideTooltipOnMouseOut).attr(VfxDataAttr.SeriesId, (d) => String(d.properties?.legendUniqueId ?? "")).attr(VfxDataAttr.DimValue, (d) => String(d.legend ?? d.legendText ?? "")).on("click", makeVfxClickHandler(vfxPickModeActiveRef, onElementClickRef, (_event, d) => ({
|
|
57532
|
+
seriesId: String(d.properties?.legendUniqueId ?? ""),
|
|
57533
|
+
dimValue: String(d.legend ?? d.legendText ?? ""),
|
|
57534
|
+
legendUniqueId: String(d.properties?.legendUniqueId ?? ""),
|
|
57535
|
+
seriesDisplayName: String(d.properties?.alias || d.properties?.name || d.legendText || "")
|
|
57536
|
+
})));
|
|
57220
57537
|
const finalBars = shouldAnimate ? bars.transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]) : bars;
|
|
57221
57538
|
finalBars.attr("x", (d) => d.value >= 0 ? xScale(0) : xScale(d.value)).attr("width", (d) => Math.abs(xScale(d.value) - xScale(0)));
|
|
57222
57539
|
};
|