@fluentui/react-charting 5.25.2 → 5.25.4
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/CHANGELOG.json +105 -1
- package/CHANGELOG.md +30 -2
- package/dist/react-charting.js +1 -1
- package/dist/react-charting.min.js +1 -1
- package/lib/components/AreaChart/AreaChart.base.js +0 -5
- package/lib/components/AreaChart/AreaChart.base.js.map +1 -1
- package/lib/components/ChartTable/ChartTable.base.js +0 -1
- package/lib/components/ChartTable/ChartTable.base.js.map +1 -1
- package/lib/components/CommonComponents/CartesianChart.base.js +1 -3
- package/lib/components/CommonComponents/CartesianChart.base.js.map +1 -1
- package/lib/components/CommonComponents/CartesianChart.types.js.map +1 -1
- package/lib/components/DeclarativeChart/DeclarativeChart.js +1 -3
- package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +24 -23
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib/components/DonutChart/Arc/Arc.js +0 -1
- package/lib/components/DonutChart/Arc/Arc.js.map +1 -1
- package/lib/components/DonutChart/DonutChart.base.js +1 -5
- package/lib/components/DonutChart/DonutChart.base.js.map +1 -1
- package/lib/components/DonutChart/Pie/Pie.js +0 -2
- package/lib/components/DonutChart/Pie/Pie.js.map +1 -1
- package/lib/components/FunnelChart/FunnelChart.base.js +0 -1
- package/lib/components/FunnelChart/FunnelChart.base.js.map +1 -1
- package/lib/components/GanttChart/GanttChart.base.js +1 -1
- package/lib/components/GanttChart/GanttChart.base.js.map +1 -1
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +8 -9
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
- package/lib/components/HeatMapChart/HeatMapChart.base.js +0 -4
- package/lib/components/HeatMapChart/HeatMapChart.base.js.map +1 -1
- package/lib/components/HorizontalBarChart/HorizontalBarChart.base.js +1 -7
- package/lib/components/HorizontalBarChart/HorizontalBarChart.base.js.map +1 -1
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js +0 -6
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js.map +1 -1
- package/lib/components/Legends/Legends.base.js +0 -4
- package/lib/components/Legends/Legends.base.js.map +1 -1
- package/lib/components/LineChart/LineChart.base.js +0 -10
- package/lib/components/LineChart/LineChart.base.js.map +1 -1
- package/lib/components/PieChart/Arc/Arc.js +0 -2
- package/lib/components/PieChart/Arc/Arc.js.map +1 -1
- package/lib/components/PieChart/Pie/Pie.js +0 -2
- package/lib/components/PieChart/Pie/Pie.js.map +1 -1
- package/lib/components/PieChart/PieChart.base.js +0 -1
- package/lib/components/PieChart/PieChart.base.js.map +1 -1
- package/lib/components/SankeyChart/SankeyChart.base.js +2 -2
- package/lib/components/SankeyChart/SankeyChart.base.js.map +1 -1
- package/lib/components/ScatterChart/ScatterChart.base.js +38 -36
- package/lib/components/ScatterChart/ScatterChart.base.js.map +1 -1
- package/lib/components/ScatterChart/ScatterChart.types.js.map +1 -1
- package/lib/components/StackedBarChart/MultiStackedBarChart.base.js +1 -6
- package/lib/components/StackedBarChart/MultiStackedBarChart.base.js.map +1 -1
- package/lib/components/StackedBarChart/StackedBarChart.base.js +1 -5
- package/lib/components/StackedBarChart/StackedBarChart.base.js.map +1 -1
- package/lib/components/TreeChart/TreeChart.base.js +2 -17
- package/lib/components/TreeChart/TreeChart.base.js.map +1 -1
- package/lib/components/VerticalBarChart/VerticalBarChart.base.js +0 -11
- package/lib/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +7 -6
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -1
- package/lib/utilities/image-export-utils.js +4 -2
- package/lib/utilities/image-export-utils.js.map +1 -1
- package/lib/utilities/utilities.js +0 -2
- package/lib/utilities/utilities.js.map +1 -1
- package/lib-amd/components/AreaChart/AreaChart.base.js +0 -5
- package/lib-amd/components/AreaChart/AreaChart.base.js.map +1 -1
- package/lib-amd/components/ChartTable/ChartTable.base.js +0 -1
- package/lib-amd/components/ChartTable/ChartTable.base.js.map +1 -1
- package/lib-amd/components/CommonComponents/CartesianChart.base.js +1 -3
- package/lib-amd/components/CommonComponents/CartesianChart.base.js.map +1 -1
- package/lib-amd/components/CommonComponents/CartesianChart.types.js.map +1 -1
- package/lib-amd/components/DeclarativeChart/DeclarativeChart.js +1 -3
- package/lib-amd/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
- package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js +24 -23
- package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib-amd/components/DonutChart/Arc/Arc.js +0 -1
- package/lib-amd/components/DonutChart/Arc/Arc.js.map +1 -1
- package/lib-amd/components/DonutChart/DonutChart.base.js +1 -5
- package/lib-amd/components/DonutChart/DonutChart.base.js.map +1 -1
- package/lib-amd/components/DonutChart/Pie/Pie.js +0 -2
- package/lib-amd/components/DonutChart/Pie/Pie.js.map +1 -1
- package/lib-amd/components/FunnelChart/FunnelChart.base.js +0 -1
- package/lib-amd/components/FunnelChart/FunnelChart.base.js.map +1 -1
- package/lib-amd/components/GanttChart/GanttChart.base.js +1 -1
- package/lib-amd/components/GanttChart/GanttChart.base.js.map +1 -1
- package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +8 -10
- package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
- package/lib-amd/components/HeatMapChart/HeatMapChart.base.js +0 -4
- package/lib-amd/components/HeatMapChart/HeatMapChart.base.js.map +1 -1
- package/lib-amd/components/HorizontalBarChart/HorizontalBarChart.base.js +1 -7
- package/lib-amd/components/HorizontalBarChart/HorizontalBarChart.base.js.map +1 -1
- package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js +0 -6
- package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js.map +1 -1
- package/lib-amd/components/Legends/Legends.base.js +0 -4
- package/lib-amd/components/Legends/Legends.base.js.map +1 -1
- package/lib-amd/components/LineChart/LineChart.base.js +0 -10
- package/lib-amd/components/LineChart/LineChart.base.js.map +1 -1
- package/lib-amd/components/PieChart/Arc/Arc.js +0 -2
- package/lib-amd/components/PieChart/Arc/Arc.js.map +1 -1
- package/lib-amd/components/PieChart/Pie/Pie.js +0 -2
- package/lib-amd/components/PieChart/Pie/Pie.js.map +1 -1
- package/lib-amd/components/PieChart/PieChart.base.js +0 -1
- package/lib-amd/components/PieChart/PieChart.base.js.map +1 -1
- package/lib-amd/components/SankeyChart/SankeyChart.base.js +2 -2
- package/lib-amd/components/SankeyChart/SankeyChart.base.js.map +1 -1
- package/lib-amd/components/ScatterChart/ScatterChart.base.js +37 -35
- package/lib-amd/components/ScatterChart/ScatterChart.base.js.map +1 -1
- package/lib-amd/components/ScatterChart/ScatterChart.types.js.map +1 -1
- package/lib-amd/components/StackedBarChart/MultiStackedBarChart.base.js +1 -6
- package/lib-amd/components/StackedBarChart/MultiStackedBarChart.base.js.map +1 -1
- package/lib-amd/components/StackedBarChart/StackedBarChart.base.js +1 -5
- package/lib-amd/components/StackedBarChart/StackedBarChart.base.js.map +1 -1
- package/lib-amd/components/TreeChart/TreeChart.base.js +2 -17
- package/lib-amd/components/TreeChart/TreeChart.base.js.map +1 -1
- package/lib-amd/components/VerticalBarChart/VerticalBarChart.base.js +0 -11
- package/lib-amd/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
- package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +6 -5
- package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -1
- package/lib-amd/utilities/image-export-utils.js +4 -2
- package/lib-amd/utilities/image-export-utils.js.map +1 -1
- package/lib-amd/utilities/utilities.js +0 -2
- package/lib-amd/utilities/utilities.js.map +1 -1
- package/lib-commonjs/components/AreaChart/AreaChart.base.js +0 -5
- package/lib-commonjs/components/AreaChart/AreaChart.base.js.map +1 -1
- package/lib-commonjs/components/ChartTable/ChartTable.base.js +0 -1
- package/lib-commonjs/components/ChartTable/ChartTable.base.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/CartesianChart.base.js +1 -3
- package/lib-commonjs/components/CommonComponents/CartesianChart.base.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/CartesianChart.types.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js +1 -3
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +24 -23
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib-commonjs/components/DonutChart/Arc/Arc.js +0 -1
- package/lib-commonjs/components/DonutChart/Arc/Arc.js.map +1 -1
- package/lib-commonjs/components/DonutChart/DonutChart.base.js +1 -5
- package/lib-commonjs/components/DonutChart/DonutChart.base.js.map +1 -1
- package/lib-commonjs/components/DonutChart/Pie/Pie.js +0 -2
- package/lib-commonjs/components/DonutChart/Pie/Pie.js.map +1 -1
- package/lib-commonjs/components/FunnelChart/FunnelChart.base.js +0 -1
- package/lib-commonjs/components/FunnelChart/FunnelChart.base.js.map +1 -1
- package/lib-commonjs/components/GanttChart/GanttChart.base.js +1 -1
- package/lib-commonjs/components/GanttChart/GanttChart.base.js.map +1 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +8 -9
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.base.js +0 -4
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.base.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.base.js +1 -7
- package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.base.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js +0 -6
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js.map +1 -1
- package/lib-commonjs/components/Legends/Legends.base.js +0 -4
- package/lib-commonjs/components/Legends/Legends.base.js.map +1 -1
- package/lib-commonjs/components/LineChart/LineChart.base.js +0 -10
- package/lib-commonjs/components/LineChart/LineChart.base.js.map +1 -1
- package/lib-commonjs/components/PieChart/Arc/Arc.js +0 -2
- package/lib-commonjs/components/PieChart/Arc/Arc.js.map +1 -1
- package/lib-commonjs/components/PieChart/Pie/Pie.js +0 -2
- package/lib-commonjs/components/PieChart/Pie/Pie.js.map +1 -1
- package/lib-commonjs/components/PieChart/PieChart.base.js +0 -1
- package/lib-commonjs/components/PieChart/PieChart.base.js.map +1 -1
- package/lib-commonjs/components/SankeyChart/SankeyChart.base.js +2 -2
- package/lib-commonjs/components/SankeyChart/SankeyChart.base.js.map +1 -1
- package/lib-commonjs/components/ScatterChart/ScatterChart.base.js +37 -35
- package/lib-commonjs/components/ScatterChart/ScatterChart.base.js.map +1 -1
- package/lib-commonjs/components/ScatterChart/ScatterChart.types.js.map +1 -1
- package/lib-commonjs/components/StackedBarChart/MultiStackedBarChart.base.js +1 -6
- package/lib-commonjs/components/StackedBarChart/MultiStackedBarChart.base.js.map +1 -1
- package/lib-commonjs/components/StackedBarChart/StackedBarChart.base.js +1 -5
- package/lib-commonjs/components/StackedBarChart/StackedBarChart.base.js.map +1 -1
- package/lib-commonjs/components/TreeChart/TreeChart.base.js +2 -17
- package/lib-commonjs/components/TreeChart/TreeChart.base.js.map +1 -1
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.base.js +0 -11
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +6 -5
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -1
- package/lib-commonjs/utilities/image-export-utils.js +4 -2
- package/lib-commonjs/utilities/image-export-utils.js.map +1 -1
- package/lib-commonjs/utilities/utilities.js +0 -2
- package/lib-commonjs/utilities/utilities.js.map +1 -1
- package/package.json +5 -5
- package/src/components/CommonComponents/CartesianChart.types.ts +1 -1
- package/src/components/ScatterChart/ScatterChart.types.ts +0 -1
|
@@ -2,7 +2,7 @@ import { __assign, __spreadArray } from "tslib";
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { select as d3Select } from 'd3-selection';
|
|
4
4
|
import { Legends } from '../Legends/index';
|
|
5
|
-
import { max as d3Max } from 'd3-array';
|
|
5
|
+
import { max as d3Max, min as d3Min } from 'd3-array';
|
|
6
6
|
import { areArraysEqual, createNumericYAxis, createStringYAxis, domainRangeOfXStringAxis, findNumericMinMaxOfY, getDomainPaddingForMarkers, isScatterPolarSeries, isTextMode, YAxisType, isPlottable, getRangeForScatterMarkerSize, domainRangeOfDateForAreaLineScatterVerticalBarCharts, domainRangeOfNumericForAreaLineScatterCharts, findCalloutPoints, } from '../../utilities/index';
|
|
7
7
|
import { CartesianChart, } from '../../index';
|
|
8
8
|
import { calloutData, ChartTypes, XAxisTypes, tooltipOfAxislabels, getTypeOfAxis, getNextColor, getColorFromToken, sortAxisCategories, } from '../../utilities/index';
|
|
@@ -33,7 +33,6 @@ export var ScatterChartBase = React.forwardRef(function (props, forwardedRef) {
|
|
|
33
33
|
var _uniqueCallOutID = React.useRef(null);
|
|
34
34
|
var _refArray = React.useMemo(function () { return []; }, []);
|
|
35
35
|
var margins = React.useRef(null);
|
|
36
|
-
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
37
36
|
var renderSeries = React.useRef([]);
|
|
38
37
|
var _xAxisLabels = [];
|
|
39
38
|
var _xAxisCalloutAccessibilityData = {};
|
|
@@ -121,7 +120,6 @@ export var ScatterChartBase = React.forwardRef(function (props, forwardedRef) {
|
|
|
121
120
|
setSelectedLegendPoints([]);
|
|
122
121
|
setIsSelectedLegend(false);
|
|
123
122
|
}
|
|
124
|
-
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
125
123
|
function _createLegends(data) {
|
|
126
124
|
var legendProps = props.legendProps;
|
|
127
125
|
var isLegendMultiSelectEnabled = !!(legendProps && !!legendProps.canSelectMultipleLegends);
|
|
@@ -305,11 +303,8 @@ export var ScatterChartBase = React.forwardRef(function (props, forwardedRef) {
|
|
|
305
303
|
var yValue = point.yAxisCalloutData || point.y;
|
|
306
304
|
return ((_b = point.callOutAccessibilityData) === null || _b === void 0 ? void 0 : _b.ariaLabel) || "".concat(xValue, ". ").concat(legend, ", ").concat(yValue, ".");
|
|
307
305
|
}, [_points, props.culture, props.useUTC]);
|
|
308
|
-
var _createPlot = React.useCallback(
|
|
309
|
-
|
|
310
|
-
function (xElement, containerHeight) {
|
|
311
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9;
|
|
312
|
-
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
306
|
+
var _createPlot = React.useCallback(function (xElement, containerHeight) {
|
|
307
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11;
|
|
313
308
|
var series = [];
|
|
314
309
|
if (isSelectedLegend) {
|
|
315
310
|
_points.current = selectedLegendPoints;
|
|
@@ -320,12 +315,18 @@ export var ScatterChartBase = React.forwardRef(function (props, forwardedRef) {
|
|
|
320
315
|
if (_xAxisType === XAxisTypes.StringAxis) {
|
|
321
316
|
_xBandwidth.current = ((_a = _xAxisScale.current) === null || _a === void 0 ? void 0 : _a.bandwidth()) / 2;
|
|
322
317
|
}
|
|
323
|
-
var
|
|
318
|
+
var minMarkerSize = (_b = d3Min(_points.current, function (point) {
|
|
319
|
+
return d3Min(point.data, function (item) {
|
|
320
|
+
return item.markerSize;
|
|
321
|
+
});
|
|
322
|
+
})) !== null && _b !== void 0 ? _b : 0;
|
|
323
|
+
var maxMarkerSize = (_c = d3Max(_points.current, function (point) {
|
|
324
324
|
return d3Max(point.data, function (item) {
|
|
325
325
|
return item.markerSize;
|
|
326
326
|
});
|
|
327
|
-
});
|
|
328
|
-
var
|
|
327
|
+
})) !== null && _c !== void 0 ? _c : 0;
|
|
328
|
+
var isContinuousXY = _xAxisType !== XAxisTypes.StringAxis && _yAxisType !== YAxisType.StringAxis;
|
|
329
|
+
var extraMaxPixels = isContinuousXY
|
|
329
330
|
? getRangeForScatterMarkerSize({
|
|
330
331
|
data: _points.current,
|
|
331
332
|
xScale: _xAxisScale.current,
|
|
@@ -335,49 +336,52 @@ export var ScatterChartBase = React.forwardRef(function (props, forwardedRef) {
|
|
|
335
336
|
})
|
|
336
337
|
: 0;
|
|
337
338
|
var _loop_1 = function (i) {
|
|
338
|
-
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
339
339
|
var pointsForSeries = [];
|
|
340
|
-
var legendVal = (
|
|
341
|
-
var seriesColor = (
|
|
342
|
-
var verticaLineHeight = containerHeight - ((
|
|
340
|
+
var legendVal = (_f = (_e = _points.current) === null || _e === void 0 ? void 0 : _e[i]) === null || _f === void 0 ? void 0 : _f.legend;
|
|
341
|
+
var seriesColor = (_h = (_g = _points.current) === null || _g === void 0 ? void 0 : _g[i]) === null || _h === void 0 ? void 0 : _h.color;
|
|
342
|
+
var verticaLineHeight = containerHeight - ((_k = (_j = margins.current) === null || _j === void 0 ? void 0 : _j.bottom) !== null && _k !== void 0 ? _k : 0) + 6;
|
|
343
343
|
var _loop_2 = function (j) {
|
|
344
|
-
var
|
|
345
|
-
var xPoint = (
|
|
344
|
+
var _12 = (_q = (_p = _points.current) === null || _p === void 0 ? void 0 : _p[i]) === null || _q === void 0 ? void 0 : _q.data[j], x = _12.x, y = _12.y, xAxisCalloutData = _12.xAxisCalloutData, xAxisCalloutAccessibilityData = _12.xAxisCalloutAccessibilityData;
|
|
345
|
+
var xPoint = (_r = _xAxisScale.current) === null || _r === void 0 ? void 0 : _r.call(_xAxisScale, x);
|
|
346
346
|
// Use string y axis scale if needed
|
|
347
347
|
var yPoint = _yAxisType === YAxisType.StringAxis
|
|
348
|
-
? ((
|
|
349
|
-
: (
|
|
348
|
+
? ((_s = _yAxisScale.current) === null || _s === void 0 ? void 0 : _s.call(_yAxisScale, y)) + (((_t = _yAxisScale.current) === null || _t === void 0 ? void 0 : _t.bandwidth) ? _yAxisScale.current.bandwidth() / 2 : 0)
|
|
349
|
+
: (_u = _yAxisScale.current) === null || _u === void 0 ? void 0 : _u.call(_yAxisScale, y);
|
|
350
350
|
if (!isPlottable(xPoint, yPoint)) {
|
|
351
351
|
return "continue";
|
|
352
352
|
}
|
|
353
353
|
var seriesId = "".concat(_seriesId, "_").concat(i, "_").concat(j);
|
|
354
354
|
var circleId = "".concat(_circleId, "_").concat(i, "_").concat(j);
|
|
355
|
-
var pointMarkerSize = ((
|
|
355
|
+
var pointMarkerSize = ((_w = (_v = _points.current) === null || _v === void 0 ? void 0 : _v[i]) === null || _w === void 0 ? void 0 : _w.data[j]).markerSize;
|
|
356
356
|
var minPixel = 4;
|
|
357
357
|
var maxPixel = 16;
|
|
358
|
-
var circleRadius =
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
358
|
+
var circleRadius = activePoint === circleId ? 6 : 4;
|
|
359
|
+
if (pointMarkerSize) {
|
|
360
|
+
if (isContinuousXY && maxMarkerSize !== 0) {
|
|
361
|
+
circleRadius = (pointMarkerSize * extraMaxPixels) / maxMarkerSize;
|
|
362
|
+
}
|
|
363
|
+
else if (!isContinuousXY && maxMarkerSize !== minMarkerSize) {
|
|
364
|
+
circleRadius =
|
|
365
|
+
minPixel +
|
|
366
|
+
((pointMarkerSize - minMarkerSize) / (maxMarkerSize - minMarkerSize)) * (maxPixel - minPixel);
|
|
367
|
+
}
|
|
368
|
+
}
|
|
365
369
|
var isLegendSelected = _legendHighlighted(legendVal) || _noLegendHighlighted() || isSelectedLegend;
|
|
366
|
-
var currentPointHidden = ((
|
|
367
|
-
var text = (
|
|
370
|
+
var currentPointHidden = ((_y = (_x = _points.current) === null || _x === void 0 ? void 0 : _x[i]) === null || _y === void 0 ? void 0 : _y.hideNonActiveDots) && activePoint !== circleId;
|
|
371
|
+
var text = (_0 = (_z = _points.current) === null || _z === void 0 ? void 0 : _z[i].data[j]) === null || _0 === void 0 ? void 0 : _0.text;
|
|
368
372
|
if (!_isTextMode.current) {
|
|
369
373
|
pointsForSeries.push(React.createElement(React.Fragment, null,
|
|
370
374
|
React.createElement("circle", __assign({ id: circleId, key: circleId, r: Math.max(circleRadius, 4), cx: xPoint + _xBandwidth.current, cy: yPoint, "data-is-focusable": isLegendSelected, onMouseOver: function (event) {
|
|
371
375
|
return _handleHover(x, y, verticaLineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData, event);
|
|
372
376
|
}, onMouseMove: function (event) {
|
|
373
377
|
return _handleHover(x, y, verticaLineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData, event);
|
|
374
|
-
}, onMouseOut: _handleMouseOut, onFocus: function () { return _handleFocus(seriesId, x, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData); }, onBlur: _handleMouseOut }, _getClickHandler((
|
|
378
|
+
}, onMouseOut: _handleMouseOut, onFocus: function () { return _handleFocus(seriesId, x, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData); }, onBlur: _handleMouseOut }, _getClickHandler((_3 = (_2 = (_1 = _points.current) === null || _1 === void 0 ? void 0 : _1[i]) === null || _2 === void 0 ? void 0 : _2.data[j]) === null || _3 === void 0 ? void 0 : _3.onDataPointClick), { opacity: isLegendSelected && !currentPointHidden ? 1 : 0.1, fill: _getPointFill(seriesColor, circleId), stroke: seriesColor, role: "img", "aria-label": _getAriaLabel(i, j), tabIndex: ((_5 = (_4 = _points.current) === null || _4 === void 0 ? void 0 : _4[i]) === null || _5 === void 0 ? void 0 : _5.legend) !== '' ? 0 : undefined }))));
|
|
375
379
|
}
|
|
376
380
|
if (_isTextMode && text) {
|
|
377
381
|
pointsForSeries.push(React.createElement("text", { key: "".concat(circleId, "-label"), x: xPoint + _xBandwidth.current, y: yPoint + Math.max(circleRadius + 12, 16), className: classNames.markerLabel }, text));
|
|
378
382
|
}
|
|
379
383
|
};
|
|
380
|
-
for (var j = 0; j < ((
|
|
384
|
+
for (var j = 0; j < ((_o = (_m = (_l = _points.current) === null || _l === void 0 ? void 0 : _l[i]) === null || _m === void 0 ? void 0 : _m.data) === null || _o === void 0 ? void 0 : _o.length); j++) {
|
|
381
385
|
_loop_2(j);
|
|
382
386
|
}
|
|
383
387
|
if (_isScatterPolarRef.current) {
|
|
@@ -385,12 +389,12 @@ export var ScatterChartBase = React.forwardRef(function (props, forwardedRef) {
|
|
|
385
389
|
xAxisScale: _xAxisScale.current,
|
|
386
390
|
yAxisScale: _yAxisScale.current,
|
|
387
391
|
className: classNames.markerLabel || '',
|
|
388
|
-
lineOptions: (
|
|
392
|
+
lineOptions: (_7 = (_6 = _points.current) === null || _6 === void 0 ? void 0 : _6[i]) === null || _7 === void 0 ? void 0 : _7.lineOptions,
|
|
389
393
|
}));
|
|
390
394
|
}
|
|
391
|
-
series.push(React.createElement("g", { key: "series_".concat(i), role: "region", "aria-label": "".concat(legendVal, ", series ").concat(i + 1, " of ").concat((
|
|
395
|
+
series.push(React.createElement("g", { key: "series_".concat(i), role: "region", "aria-label": "".concat(legendVal, ", series ").concat(i + 1, " of ").concat((_8 = _points.current) === null || _8 === void 0 ? void 0 : _8.length, " with ").concat((_11 = (_10 = (_9 = _points.current) === null || _9 === void 0 ? void 0 : _9[i]) === null || _10 === void 0 ? void 0 : _10.data) === null || _11 === void 0 ? void 0 : _11.length, " data points.") }, pointsForSeries));
|
|
392
396
|
};
|
|
393
|
-
for (var i = ((
|
|
397
|
+
for (var i = ((_d = _points.current) === null || _d === void 0 ? void 0 : _d.length) - 1; i >= 0; i--) {
|
|
394
398
|
_loop_1(i);
|
|
395
399
|
}
|
|
396
400
|
// Removing un wanted tooltip div from DOM, when prop not provided.
|
|
@@ -470,7 +474,6 @@ export var ScatterChartBase = React.forwardRef(function (props, forwardedRef) {
|
|
|
470
474
|
setCalloutVisible(false);
|
|
471
475
|
}
|
|
472
476
|
var _getNumericMinMaxOfY = React.useCallback(function (points, yAxisType) {
|
|
473
|
-
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
474
477
|
var _a = findNumericMinMaxOfY(points, yAxisType, undefined, props.yScaleType), startValue = _a.startValue, endValue = _a.endValue;
|
|
475
478
|
var yPadding = getDomainPaddingForMarkers(startValue, endValue, props.yScaleType);
|
|
476
479
|
return {
|
|
@@ -507,7 +510,6 @@ export var ScatterChartBase = React.forwardRef(function (props, forwardedRef) {
|
|
|
507
510
|
var _yAxisLabels = _getOrderedYAxisLabels();
|
|
508
511
|
return !_isChartEmpty() ? (React.createElement(CartesianChart, __assign({}, props, { ref: cartesianChartRef, chartTitle: props.data.chartTitle, isCalloutForStack: true, points: points, chartType: ChartTypes.ScatterChart, calloutProps: calloutProps, tickParams: tickParams, legendBars: legendBars, getmargins: _getMargins, getMinMaxOfYAxis: _getNumericMinMaxOfY, getDomainNRangeValues: getDomainNRangeValuesScatterChart, createYAxis: createNumericYAxis, createStringYAxis: createStringYAxis, getGraphData: _initializeScatterChartData, xAxisType: _xAxisType, yAxisType: _yAxisType }, (_yAxisType === YAxisType.StringAxis ? { stringDatasetForYAxisDomain: _yAxisLabels } : {}), { onChartMouseLeave: _handleChartMouseLeave, enableFirstRenderOptimization: _firstRenderOptimization, datasetForXAxisDomain: _xAxisLabels, componentRef: cartesianChartRef }, (_isScatterPolarRef.current ? { yMaxValue: 1, yMinValue: -1 } : {}), {
|
|
509
512
|
/* eslint-disable react/jsx-no-bind */
|
|
510
|
-
// eslint-disable-next-line react/no-children-prop
|
|
511
513
|
children: function (childProps) {
|
|
512
514
|
_xAxisScale.current = childProps.xScale;
|
|
513
515
|
_yAxisScale.current = childProps.yScalePrimary;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScatterChart.base.js","sourceRoot":"../src/","sources":["components/ScatterChart/ScatterChart.base.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAE,MAAM,IAAI,QAAQ,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAA6B,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAE,GAAG,IAAI,KAAK,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,iBAAiB,EACjB,wBAAwB,EACxB,oBAAoB,EACpB,0BAA0B,EAC1B,oBAAoB,EACpB,UAAU,EACV,SAAS,EACT,WAAW,EACX,4BAA4B,EAC5B,oDAAoD,EACpD,4CAA4C,EAC5C,iBAAiB,GAClB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAEL,cAAc,GAMf,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,WAAW,EACX,UAAU,EACV,UAAU,EACV,mBAAmB,EACnB,aAAa,EACb,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAGrF,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EAAE,gCAAgC,EAAE,MAAM,oCAAoC,CAAC;AAMtF,IAAM,aAAa,GAAG,kBAAkB,EAAgD,CAAC;AAEzF,8FAA8F;AAC9F;;;GA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CAAC,EAAE,2BAA2B,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,IAC9F,iBAAiB,EAAE,sBAAsB,EACzC,6BAA6B,EAAE,wBAAwB,EACvD,qBAAqB,EAAE,YAAY,EACnC,YAAY,EAAE,iBAAiB,IAC3B,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACvE,sCAAsC;QACtC,kDAAkD;QAClD,QAAQ,EAAE,UAAC,UAAuB;YAChC,WAAW,CAAC,OAAO,GAAG,UAAU,CAAC,MAAO,CAAC;YACzC,WAAW,CAAC,OAAO,GAAG,UAAU,CAAC,aAAc,CAAC;YAChD,OAAO,CACL;gBACE;oBACE,8BACE,EAAE,EAAE,CAAC,EACL,EAAE,EAAE,CAAC,EACL,EAAE,EAAE,CAAC,EACL,EAAE,EAAE,UAAU,CAAC,eAAe,EAC9B,MAAM,EAAE,SAAS,EACjB,EAAE,EAAE,aAAa,EACjB,UAAU,EAAE,QAAQ,EACpB,eAAe,EAAE,KAAK,GACtB;oBACF,+BAAI,YAAY,CAAC,OAAO,CAAK,CAC3B,CACH,CACJ,CAAC;QACJ,CAAC,IACD,CACH,CAAC,CAAC,CAAC,CACF,6BAAK,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,gBAAc,8BAA8B,GAAI,CAC/G,CAAC;AACJ,CAAC,CAAC,CAAC;AACH,gBAAgB,CAAC,WAAW,GAAG,cAAc,CAAC","sourcesContent":["import * as React from 'react';\nimport { IChildProps, IScatterChartStyleProps, IScatterChartStyles, IScatterChartProps } from './ScatterChart.types';\nimport { Axis as D3Axis } from 'd3-axis';\nimport { select as d3Select } from 'd3-selection';\nimport { ILegend, ILegendContainer, Legends } from '../Legends/index';\nimport { max as d3Max } from 'd3-array';\nimport {\n areArraysEqual,\n createNumericYAxis,\n createStringYAxis,\n domainRangeOfXStringAxis,\n findNumericMinMaxOfY,\n getDomainPaddingForMarkers,\n isScatterPolarSeries,\n isTextMode,\n YAxisType,\n isPlottable,\n getRangeForScatterMarkerSize,\n domainRangeOfDateForAreaLineScatterVerticalBarCharts,\n domainRangeOfNumericForAreaLineScatterCharts,\n findCalloutPoints,\n} from '../../utilities/index';\nimport {\n IAccessibilityProps,\n CartesianChart,\n ICustomizedCalloutData,\n IMargins,\n IRefArrayData,\n IChart,\n IYValueHover,\n} from '../../index';\nimport {\n calloutData,\n ChartTypes,\n XAxisTypes,\n tooltipOfAxislabels,\n getTypeOfAxis,\n getNextColor,\n getColorFromToken,\n sortAxisCategories,\n} from '../../utilities/index';\nimport { classNamesFunction, DirectionalHint, getId, getRTL } from '@fluentui/react';\nimport { IImageExportOptions, IScatterChartDataPoint, IScatterChartPoints } from '../../types/index';\nimport { ILineChartPoints } from '../../types/IDataPoint';\nimport { exportChartsAsImage } from '../../utilities/image-export-utils';\nimport { formatDateToLocaleString } from '@fluentui/chart-utilities';\nimport { renderScatterPolarCategoryLabels } from '../../utilities/scatterpolar-utils';\nimport type { JSXElement } from '@fluentui/utilities';\n\ntype NumericAxis = D3Axis<number | { valueOf(): number }>;\n\ntype ScatterChartDataWithIndex = IScatterChartPoints & { index: number };\nconst getClassNames = classNamesFunction<IScatterChartStyleProps, IScatterChartStyles>();\n\n// Create a ScatterChart variant which uses these default styles and this styled subcomponent.\n/**\n * ScatterChart component\n * {@docCategory ScatterChart}\n */\nexport const ScatterChartBase: React.FunctionComponent<IScatterChartProps> = React.forwardRef<\n HTMLDivElement,\n IScatterChartProps\n>((props, forwardedRef) => {\n const _circleId = React.useMemo(() => getId('circle'), []);\n const _seriesId: string = React.useMemo(() => getId('seriesID'), []);\n const _verticalLine: string = React.useMemo(() => getId('verticalLine'), []);\n const _tooltipId: string = React.useMemo(() => getId('ScatterChartTooltipId_'), []);\n const _firstRenderOptimization = true;\n const _emptyChartId: string = React.useMemo(() => getId('_ScatterChart_empty'), []);\n const _points = React.useRef<ScatterChartDataWithIndex[]>(\n _injectIndexPropertyInScatterChartData(props.data.scatterChartData),\n );\n let _calloutPoints = React.useMemo(() => calloutData(_points.current) || {}, [_points]);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const _xAxisScale: any = React.useRef<any>('');\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const _yAxisScale: any = React.useRef<any>('');\n const _uniqueCallOutID = React.useRef<string | null>(null);\n const _refArray = React.useMemo(() => [], []);\n const margins = React.useRef<IMargins | null>(null);\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n const renderSeries = React.useRef<JSXElement[]>([]);\n let _xAxisLabels: string[] = [];\n const _xAxisCalloutAccessibilityData: IAccessibilityProps = {};\n const _xBandwidth = React.useRef<number>(0);\n const cartesianChartRef = React.useRef<IChart>(null);\n const legendsRef = React.useRef<ILegendContainer>(null);\n\n const [hoverXValue, setHoverXValue] = React.useState<string | number>('');\n const [activeLegend, setActiveLegend] = React.useState<string>('');\n const [YValueHover, setYValueHover] = React.useState<IYValueHover[]>([]);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const [selectedLegendPoints, setSelectedLegendPoints] = React.useState<any[]>([]);\n const [isSelectedLegend, setIsSelectedLegend] = React.useState<boolean>(false);\n const [activePoint, setActivePoint] = React.useState<string>('');\n const [stackCalloutProps, setStackCalloutProps] = React.useState<ICustomizedCalloutData>();\n const [isCalloutVisible, setCalloutVisible] = React.useState(false);\n const [selectedLegends, setSelectedLegends] = React.useState<string[]>(props.legendProps?.selectedLegends || []);\n const [refSelected, setRefSelected] = React.useState<string>('');\n const prevSelectedLegendsRef = React.useRef<string[] | undefined>(undefined);\n const _isScatterPolarRef = React.useRef(false);\n const _isTextMode = React.useRef(false);\n\n const classNames = getClassNames(props.styles!, {\n theme: props.theme!,\n });\n\n React.useEffect(() => {\n if (\n prevSelectedLegendsRef.current &&\n !areArraysEqual(prevSelectedLegendsRef.current, props.legendProps?.selectedLegends)\n ) {\n setSelectedLegends(props.legendProps?.selectedLegends || []);\n }\n prevSelectedLegendsRef.current = props.legendProps?.selectedLegends;\n }, [props.legendProps?.selectedLegends]);\n\n React.useImperativeHandle(\n props.componentRef,\n () => ({\n chartContainer: cartesianChartRef.current?.chartContainer ?? null,\n toImage: (opts?: IImageExportOptions): Promise<string> => {\n return exportChartsAsImage(\n [{ container: cartesianChartRef.current?.chartContainer }],\n props.hideLegend ? undefined : legendsRef.current?.toSVG,\n getRTL(),\n opts,\n );\n },\n }),\n [props.hideLegend],\n );\n\n const _xAxisType: XAxisTypes =\n props.data.scatterChartData! &&\n props.data.scatterChartData!.length > 0 &&\n props.data.scatterChartData![0].data &&\n props.data.scatterChartData![0].data.length > 0\n ? (getTypeOfAxis(props.data.scatterChartData![0].data[0].x, true) as XAxisTypes)\n : XAxisTypes.StringAxis;\n\n // Detect y axis type (numeric or string)\n const _yAxisType: YAxisType =\n props.data.scatterChartData &&\n props.data.scatterChartData.length > 0 &&\n props.data.scatterChartData[0].data &&\n props.data.scatterChartData[0].data.length > 0\n ? typeof props.data.scatterChartData[0].data[0].y === 'string'\n ? YAxisType.StringAxis\n : YAxisType.NumericAxis\n : YAxisType.NumericAxis;\n\n const pointsRef = React.useRef<ScatterChartDataWithIndex[] | []>([]);\n React.useEffect(() => {\n /** note that height and width are not used to resize or set as dimesions of the chart,\n * fitParentContainer is responisble for setting the height and width or resizing of the svg/chart\n */\n\n if (\n _points.current !== _injectIndexPropertyInScatterChartData(props.data.scatterChartData) ||\n props.data !== _points.current\n ) {\n pointsRef.current = _injectIndexPropertyInScatterChartData(props.data.scatterChartData);\n }\n }, [props.height, props.width, props.data, _points]);\n\n function _injectIndexPropertyInScatterChartData(\n scatterChartData?: IScatterChartPoints[],\n ): ScatterChartDataWithIndex[] | [] {\n return scatterChartData\n ? scatterChartData.map((item: IScatterChartPoints, index: number) => {\n let color: string;\n if (typeof item.color === 'undefined') {\n color = getNextColor(index, 0);\n } else {\n color = getColorFromToken(item.color);\n }\n return {\n ...item,\n index: -1,\n color,\n };\n })\n : [];\n }\n\n const _getMargins = React.useCallback((_margins: IMargins) => {\n margins.current = _margins;\n }, []);\n\n function _onHoverCardHide() {\n setSelectedLegendPoints([]);\n setIsSelectedLegend(false);\n }\n\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n function _createLegends(data: ScatterChartDataWithIndex[]): JSXElement {\n const { legendProps } = props;\n const isLegendMultiSelectEnabled = !!(legendProps && !!legendProps.canSelectMultipleLegends);\n const mapLegendToPoints: Record<string, ScatterChartDataWithIndex[]> = {};\n data.forEach((point: ScatterChartDataWithIndex) => {\n if (point.legend) {\n if (!mapLegendToPoints[point.legend]) {\n mapLegendToPoints[point.legend] = [];\n }\n mapLegendToPoints[point.legend].push(point);\n }\n });\n const legendDataItems: ILegend[] = Object.entries(mapLegendToPoints).map(([legendTitle, points]) => {\n const representativePoint = points[0];\n // mapping data to the format Legends component needs\n const legend: ILegend = {\n title: legendTitle,\n color: representativePoint.color!,\n onMouseOutAction: () => {\n setActiveLegend('');\n },\n hoverAction: () => {\n _handleChartMouseLeave();\n setActiveLegend(legendTitle);\n },\n ...(representativePoint.legendShape && {\n shape: representativePoint.legendShape,\n }),\n };\n return legend;\n });\n\n return (\n <Legends\n ref={legendsRef}\n legends={[...legendDataItems]}\n enabledWrapLines={props.enabledLegendsWrapLines}\n overflowProps={props.legendsOverflowProps}\n focusZonePropsInHoverCard={props.focusZonePropsForLegendsInHoverCard}\n overflowText={props.legendsOverflowText}\n {...(isLegendMultiSelectEnabled && { onLegendHoverCardLeave: _onHoverCardHide })}\n onChange={_onLegendSelectionChange}\n {...props.legendProps}\n />\n );\n }\n\n function _getOrderedYAxisLabels() {\n const shouldOrderYAxisLabelsByCategoryOrder =\n _yAxisType === YAxisType.StringAxis && props.yAxisCategoryOrder !== 'default';\n if (!shouldOrderYAxisLabelsByCategoryOrder) {\n // Collect all unique string y values from all data points in all series, in reverse order\n const yLabelsSet = new Set<string>();\n for (let i = _points.current.length - 1; i >= 0; i--) {\n const point = _points.current[i];\n if (point.data && Array.isArray(point.data)) {\n for (const d of point.data) {\n if (typeof d.y === 'string') {\n yLabelsSet.add(d.y);\n }\n }\n }\n }\n return Array.from(yLabelsSet);\n }\n\n return sortAxisCategories(_mapCategoryToValues(), props.yAxisCategoryOrder);\n }\n\n function _mapCategoryToValues() {\n const categoryToValues: Record<string, number[]> = {};\n _points.current.forEach(point => {\n if (point.data && Array.isArray(point.data)) {\n point.data.forEach(d => {\n if (typeof d.y === 'string') {\n if (!categoryToValues[d.y]) {\n categoryToValues[d.y] = [];\n }\n if (typeof d.x === 'number') {\n categoryToValues[d.y].push(d.x);\n }\n }\n });\n }\n });\n return categoryToValues;\n }\n\n function _onLegendSelectionChange(\n legendsSelected: string[],\n event: React.MouseEvent<HTMLButtonElement>,\n currentLegend?: ILegend,\n ): void {\n if (props.legendProps?.canSelectMultipleLegends) {\n setSelectedLegends(legendsSelected);\n } else {\n setSelectedLegends(legendsSelected.slice(-1));\n }\n\n if (props.legendProps?.onChange) {\n props.legendProps.onChange(legendsSelected, event, currentLegend);\n }\n }\n\n const _getPointFill = React.useCallback(\n (lineColor: string, pointId: string) => {\n const { theme } = props;\n if (activePoint === pointId) {\n return theme!.semanticColors.bodyBackground;\n } else {\n return lineColor;\n }\n },\n [activePoint, props],\n );\n\n const getDomainNRangeValuesScatterChart = React.useCallback(\n (\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n points: any,\n domainMargins: IMargins,\n width: number,\n _chartType: ChartTypes,\n isRTL: boolean,\n xAxisType: XAxisTypes,\n _barWidth: number,\n tickValues: number[] | Date[] | string[] | undefined,\n ) => {\n if (xAxisType === XAxisTypes.NumericAxis) {\n return domainRangeOfNumericForAreaLineScatterCharts(\n points,\n domainMargins,\n width,\n isRTL,\n props.xScaleType,\n true,\n );\n } else if (xAxisType === XAxisTypes.DateAxis) {\n return domainRangeOfDateForAreaLineScatterVerticalBarCharts(\n points,\n domainMargins,\n width,\n isRTL,\n tickValues! as Date[],\n _chartType,\n );\n }\n // String Axis type\n return domainRangeOfXStringAxis(domainMargins, width, isRTL);\n },\n [props.xScaleType],\n );\n\n const _handleFocus = React.useCallback(\n (\n seriesId: string,\n x: number | Date | string,\n xAxisCalloutData: string | undefined,\n circleId: string,\n xAxisCalloutAccessibilityData?: IAccessibilityProps,\n ) => {\n _uniqueCallOutID.current = circleId;\n const formattedData = x instanceof Date ? formatDateToLocaleString(x, props.culture, props.useUTC) : x;\n const found = findCalloutPoints(_calloutPoints, x);\n // if no points need to be called out then don't show vertical line and callout card\n if (found) {\n d3Select(`#${_verticalLine}`)\n .attr('transform', () => `translate(${_xAxisScale.current?.(x) + _xBandwidth.current}, 0)`)\n .attr('visibility', 'visibility');\n _refArray.forEach((obj: IRefArrayData) => {\n if (obj.index === seriesId) {\n setCalloutVisible(true);\n xAxisCalloutData ? setHoverXValue(xAxisCalloutData) : setHoverXValue('' + formattedData);\n setRefSelected(`#${circleId}`);\n setYValueHover(found!.values);\n setActivePoint(circleId);\n }\n });\n } else {\n setActivePoint(circleId);\n }\n },\n [_verticalLine, _xAxisScale, _xBandwidth, _calloutPoints, _refArray, props.culture, props.useUTC],\n );\n\n const _handleHover = React.useCallback(\n (\n x: number | Date | string,\n y: number,\n lineHeight: number,\n xAxisCalloutData: string | undefined,\n circleId: string,\n xAxisCalloutAccessibilityData: IAccessibilityProps | undefined,\n mouseEvent: React.MouseEvent<SVGElement>,\n ) => {\n mouseEvent?.persist();\n const formattedData = x instanceof Date ? formatDateToLocaleString(x, props.culture, props.useUTC) : x;\n const found = findCalloutPoints(_calloutPoints, x) as ICustomizedCalloutData | undefined;\n // if no points need to be called out then don't show vertical line and callout card\n if (found) {\n d3Select(`#${_verticalLine}`)\n .attr(\n 'transform',\n () => `translate(${_xAxisScale.current?.(x) + _xBandwidth.current}, ${_yAxisScale.current?.(y)})`,\n )\n .attr('visibility', 'visibility')\n .attr('y2', `${lineHeight - _yAxisScale.current?.(y)}`);\n\n if (_uniqueCallOutID.current !== circleId) {\n _uniqueCallOutID.current = circleId;\n setCalloutVisible(true);\n xAxisCalloutData ? setHoverXValue(xAxisCalloutData) : setHoverXValue('' + formattedData);\n setRefSelected(`#${circleId}`);\n setYValueHover(found.values);\n setStackCalloutProps(found!);\n setActivePoint(circleId);\n }\n } else {\n setActivePoint(circleId);\n }\n },\n [_verticalLine, _xAxisScale, _xBandwidth, _calloutPoints, props.culture, props.useUTC],\n );\n\n const _handleMouseOut = React.useCallback(() => {\n d3Select(`#${_verticalLine}`).attr('visibility', 'hidden');\n }, [_verticalLine]);\n\n const _handleChartMouseLeave = React.useCallback(() => {\n _uniqueCallOutID.current = null;\n setActivePoint('');\n if (isCalloutVisible) {\n setCalloutVisible(false);\n }\n }, [_uniqueCallOutID, isCalloutVisible, setActivePoint, setCalloutVisible]);\n\n const _getHighlightedLegend = React.useCallback((): string[] => {\n return selectedLegends.length > 0 ? selectedLegends : activeLegend ? [activeLegend] : [];\n }, [selectedLegends, activeLegend]);\n\n /**\n * This function checks if none of the legends is selected or hovered.*/\n const _noLegendHighlighted = React.useCallback((): boolean => {\n return _getHighlightedLegend().length === 0;\n }, [_getHighlightedLegend]);\n\n /**\n * This function checks if the given legend is highlighted or not.\n * A legend can be highlighted in 2 ways:\n * 1. selection: if the user clicks on it\n * 2. hovering: if there is no selected legend and the user hovers over it*/\n\n const _legendHighlighted = React.useCallback(\n (legend: string): boolean => {\n return _getHighlightedLegend().includes(legend);\n },\n [_getHighlightedLegend],\n );\n\n const _getAriaLabel = React.useCallback(\n (seriesIndex: number, pointIndex: number): string => {\n const series = _points.current?.[seriesIndex];\n const point = series.data[pointIndex];\n const formattedDate =\n point.x instanceof Date ? formatDateToLocaleString(point.x, props.culture, props.useUTC) : point.x;\n const xValue = point.xAxisCalloutData || formattedDate;\n const legend = series.legend;\n const yValue = point.yAxisCalloutData || point.y;\n return point.callOutAccessibilityData?.ariaLabel || `${xValue}. ${legend}, ${yValue}.`;\n },\n [_points, props.culture, props.useUTC],\n );\n\n const _createPlot = React.useCallback(\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n (xElement: SVGElement, containerHeight: number): JSXElement[] => {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n const series: JSXElement[] = [];\n if (isSelectedLegend) {\n _points.current = selectedLegendPoints;\n } else {\n _points.current = _injectIndexPropertyInScatterChartData(props.data.scatterChartData);\n }\n\n if (_xAxisType === XAxisTypes.StringAxis) {\n _xBandwidth.current = _xAxisScale.current?.bandwidth() / 2;\n }\n\n const maxMarkerSize = d3Max(_points.current, (point: IScatterChartPoints) => {\n return d3Max(point.data as IScatterChartDataPoint[], (item: IScatterChartDataPoint) => {\n return item.markerSize as number;\n });\n })!;\n const extraMaxPixels =\n _xAxisType !== XAxisTypes.StringAxis && _yAxisType !== YAxisType.StringAxis\n ? getRangeForScatterMarkerSize({\n data: _points.current,\n xScale: _xAxisScale.current,\n yScalePrimary: _yAxisScale.current,\n xScaleType: props.xScaleType,\n yScaleType: props.yScaleType,\n })\n : 0;\n\n for (let i = _points.current?.length - 1; i >= 0; i--) {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n const pointsForSeries: JSXElement[] = [];\n\n const legendVal: string = _points.current?.[i]?.legend;\n const seriesColor: string = _points.current?.[i]?.color!;\n const verticaLineHeight = containerHeight - (margins.current?.bottom ?? 0) + 6;\n\n for (let j = 0; j < _points.current?.[i]?.data?.length; j++) {\n const { x, y, xAxisCalloutData, xAxisCalloutAccessibilityData } = _points.current?.[i]?.data[j];\n const xPoint = _xAxisScale.current?.(x);\n // Use string y axis scale if needed\n const yPoint =\n _yAxisType === YAxisType.StringAxis\n ? _yAxisScale.current?.(y) + (_yAxisScale.current?.bandwidth ? _yAxisScale.current.bandwidth() / 2 : 0)\n : _yAxisScale.current?.(y);\n if (!isPlottable(xPoint, yPoint)) {\n continue;\n }\n\n const seriesId = `${_seriesId}_${i}_${j}`;\n const circleId = `${_circleId}_${i}_${j}`;\n const pointMarkerSize = (_points.current?.[i]?.data[j] as IScatterChartDataPoint).markerSize;\n const minPixel = 4;\n const maxPixel = 16;\n const circleRadius =\n pointMarkerSize && maxMarkerSize !== 0\n ? _xAxisType !== XAxisTypes.StringAxis\n ? (pointMarkerSize * extraMaxPixels) / maxMarkerSize\n : minPixel + ((pointMarkerSize - minPixel) / (maxMarkerSize - minPixel)) * (maxPixel - minPixel)\n : activePoint === circleId\n ? 6\n : 4;\n\n const isLegendSelected: boolean = _legendHighlighted(legendVal) || _noLegendHighlighted() || isSelectedLegend;\n\n const currentPointHidden = _points.current?.[i]?.hideNonActiveDots && activePoint !== circleId;\n const text = _points.current?.[i].data[j]?.text;\n if (!_isTextMode.current) {\n pointsForSeries.push(\n <>\n <circle\n id={circleId}\n key={circleId}\n r={Math.max(circleRadius, 4)}\n cx={xPoint + _xBandwidth.current}\n cy={yPoint}\n data-is-focusable={isLegendSelected}\n onMouseOver={(event: React.MouseEvent<SVGElement>) =>\n _handleHover(\n x,\n y,\n verticaLineHeight,\n xAxisCalloutData,\n circleId,\n xAxisCalloutAccessibilityData,\n event,\n )\n }\n onMouseMove={(event: React.MouseEvent<SVGElement>) =>\n _handleHover(\n x,\n y,\n verticaLineHeight,\n xAxisCalloutData,\n circleId,\n xAxisCalloutAccessibilityData,\n event,\n )\n }\n onMouseOut={_handleMouseOut}\n onFocus={() => _handleFocus(seriesId, x, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData)}\n onBlur={_handleMouseOut}\n {..._getClickHandler(_points.current?.[i]?.data[j]?.onDataPointClick)}\n opacity={isLegendSelected && !currentPointHidden ? 1 : 0.1}\n fill={_getPointFill(seriesColor, circleId)}\n stroke={seriesColor}\n role=\"img\"\n aria-label={_getAriaLabel(i, j)}\n tabIndex={_points.current?.[i]?.legend !== '' ? 0 : undefined}\n />\n </>,\n );\n }\n if (_isTextMode && text) {\n pointsForSeries.push(\n <text\n key={`${circleId}-label`}\n x={xPoint + _xBandwidth.current}\n y={yPoint + Math.max(circleRadius + 12, 16)}\n className={classNames.markerLabel}\n >\n {text}\n </text>,\n );\n }\n }\n\n if (_isScatterPolarRef.current) {\n pointsForSeries.push(\n ...renderScatterPolarCategoryLabels({\n xAxisScale: _xAxisScale.current,\n yAxisScale: _yAxisScale.current,\n className: classNames.markerLabel || '',\n lineOptions: (_points.current?.[i] as Partial<ILineChartPoints>)?.lineOptions,\n }),\n );\n }\n\n series.push(\n <g\n key={`series_${i}`}\n role=\"region\"\n aria-label={`${legendVal}, series ${i + 1} of ${_points.current?.length} with ${\n _points.current?.[i]?.data?.length\n } data points.`}\n >\n {pointsForSeries}\n </g>,\n );\n }\n\n // Removing un wanted tooltip div from DOM, when prop not provided.\n if (!props.showXAxisLablesTooltip) {\n try {\n document.getElementById(_tooltipId) && document.getElementById(_tooltipId)!.remove();\n // eslint-disable-next-line no-empty\n } catch (e) {}\n }\n // Used to display tooltip at x axis labels.\n if (!props.wrapXAxisLables && props.showXAxisLablesTooltip) {\n const xAxisElement = d3Select(xElement).call(_xAxisScale.current);\n try {\n document.getElementById(_tooltipId) && document.getElementById(_tooltipId)!.remove();\n // eslint-disable-next-line no-empty\n } catch (e) {}\n const tooltipProps = {\n tooltipCls: classNames.tooltip!,\n id: _tooltipId,\n xAxis: xAxisElement,\n };\n xAxisElement && tooltipOfAxislabels(tooltipProps);\n }\n return series;\n },\n [\n _xAxisScale,\n _yAxisScale,\n props.data.scatterChartData,\n props.showXAxisLablesTooltip,\n props.wrapXAxisLables,\n _circleId,\n _getAriaLabel,\n _getPointFill,\n _handleFocus,\n _handleHover,\n _handleMouseOut,\n _legendHighlighted,\n _noLegendHighlighted,\n _seriesId,\n _tooltipId,\n _xAxisType,\n _yAxisType,\n activePoint,\n isSelectedLegend,\n selectedLegendPoints,\n classNames,\n props.xScaleType,\n props.yScaleType,\n ],\n );\n\n const _initializeScatterChartData = React.useCallback(\n (\n xScale: NumericAxis,\n yScale: NumericAxis,\n containerHeight: number,\n containerWidth: number,\n xElement: SVGElement | null,\n ) => {\n _xAxisScale.current = xScale;\n _yAxisScale.current = yScale;\n _isScatterPolarRef.current = isScatterPolarSeries(_points.current);\n _isTextMode.current = isTextMode(_points.current);\n renderSeries.current = _createPlot(xElement!, containerHeight!);\n },\n [renderSeries, _xAxisScale, _yAxisScale, _createPlot],\n );\n\n /**\n * Screen readers announce an element as clickable if the onClick attribute is set.\n * This function sets the attribute only when a click event handler is provided.*/\n\n function _getClickHandler(func?: () => void): { onClick?: () => void } {\n if (func) {\n return {\n onClick: func,\n };\n }\n\n return {};\n }\n\n function _isChartEmpty(): boolean {\n return !(\n props.data &&\n props.data.scatterChartData &&\n props.data.scatterChartData.length > 0 &&\n props.data.scatterChartData.filter((item: IScatterChartPoints) => item.data.length).length > 0\n );\n }\n\n function _closeCallout() {\n setCalloutVisible(false);\n }\n\n const _getNumericMinMaxOfY = React.useCallback(\n (points: IScatterChartPoints[], yAxisType?: YAxisType): { startValue: number; endValue: number } => {\n // eslint-disable-next-line @typescript-eslint/no-shadow\n const { startValue, endValue } = findNumericMinMaxOfY(points, yAxisType, undefined, props.yScaleType);\n const yPadding = getDomainPaddingForMarkers(startValue, endValue, props.yScaleType);\n\n return {\n startValue: startValue - yPadding.start,\n endValue: endValue + yPadding.end,\n };\n },\n [props.yScaleType],\n );\n\n const { legendProps, tickValues, tickFormat } = props;\n _points.current = _injectIndexPropertyInScatterChartData(props.data.scatterChartData);\n\n let points = _points.current as IScatterChartPoints[];\n if (legendProps && !!legendProps.canSelectMultipleLegends) {\n points = selectedLegendPoints.length >= 1 ? selectedLegendPoints : _points.current;\n _calloutPoints = calloutData(points);\n }\n\n let legendBars = null;\n // reduce computation cost by only creating legendBars\n // if when hideLegend is false.\n // NOTE: they are rendered only when hideLegend is false in CartesianChart.\n if (!props.hideLegend && !_isTextMode.current) {\n legendBars = _createLegends(_points.current!); // ToDo: Memoize legends to improve performance.\n }\n const calloutProps = {\n isCalloutVisible,\n directionalHint: DirectionalHint.topAutoEdge,\n YValueHover,\n hoverXValue,\n id: `toolTip${_uniqueCallOutID.current}`,\n target: refSelected,\n isBeakVisible: false,\n gapSpace: 15,\n onDismiss: _closeCallout,\n preventDismissOnEvent: () => true,\n hidden: !(!props.hideTooltip && isCalloutVisible),\n descriptionMessage:\n props.getCalloutDescriptionMessage && stackCalloutProps\n ? props.getCalloutDescriptionMessage(stackCalloutProps)\n : undefined,\n 'data-is-focusable': true,\n xAxisCalloutAccessibilityData: _xAxisCalloutAccessibilityData,\n ...props.calloutProps,\n };\n const tickParams = {\n tickValues,\n tickFormat,\n };\n\n const xAxisLabels: string[] = _points.current\n .map((point: ScatterChartDataWithIndex) => point.data.map((dp: IScatterChartDataPoint) => dp.x as string))\n .flat();\n\n _xAxisLabels = Array.from(new Set(xAxisLabels));\n\n // Compute unique y axis labels for string y axis\n const _yAxisLabels: string[] = _getOrderedYAxisLabels();\n\n return !_isChartEmpty() ? (\n <CartesianChart\n {...props}\n ref={cartesianChartRef}\n chartTitle={props.data.chartTitle}\n isCalloutForStack\n points={points}\n chartType={ChartTypes.ScatterChart}\n calloutProps={calloutProps}\n tickParams={tickParams}\n legendBars={legendBars}\n getmargins={_getMargins}\n getMinMaxOfYAxis={_getNumericMinMaxOfY}\n getDomainNRangeValues={getDomainNRangeValuesScatterChart}\n createYAxis={createNumericYAxis}\n createStringYAxis={createStringYAxis}\n getGraphData={_initializeScatterChartData}\n xAxisType={_xAxisType}\n yAxisType={_yAxisType}\n // Pass stringDatasetForYAxisDomain only if y axis is string\n {...(_yAxisType === YAxisType.StringAxis ? { stringDatasetForYAxisDomain: _yAxisLabels } : {})}\n onChartMouseLeave={_handleChartMouseLeave}\n enableFirstRenderOptimization={_firstRenderOptimization}\n datasetForXAxisDomain={_xAxisLabels}\n componentRef={cartesianChartRef}\n {...(_isScatterPolarRef.current ? { yMaxValue: 1, yMinValue: -1 } : {})}\n /* eslint-disable react/jsx-no-bind */\n // eslint-disable-next-line react/no-children-prop\n children={(childProps: IChildProps) => {\n _xAxisScale.current = childProps.xScale!;\n _yAxisScale.current = childProps.yScalePrimary!;\n return (\n <>\n <g>\n <line\n x1={0}\n y1={0}\n x2={0}\n y2={childProps.containerHeight}\n stroke={'#323130'}\n id={_verticalLine}\n visibility={'hidden'}\n strokeDasharray={'5,5'}\n />\n <g>{renderSeries.current}</g>\n </g>\n </>\n );\n }}\n />\n ) : (\n <div id={_emptyChartId} role={'alert'} style={{ opacity: '0' }} aria-label={'Graph has no data to display'} />\n );\n});\nScatterChartBase.displayName = 'ScatterChart';\n"]}
|
|
1
|
+
{"version":3,"file":"ScatterChart.base.js","sourceRoot":"../src/","sources":["components/ScatterChart/ScatterChart.base.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAE,MAAM,IAAI,QAAQ,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAA6B,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAE,GAAG,IAAI,KAAK,EAAE,GAAG,IAAI,KAAK,EAAE,MAAM,UAAU,CAAC;AACtD,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,iBAAiB,EACjB,wBAAwB,EACxB,oBAAoB,EACpB,0BAA0B,EAC1B,oBAAoB,EACpB,UAAU,EACV,SAAS,EACT,WAAW,EACX,4BAA4B,EAC5B,oDAAoD,EACpD,4CAA4C,EAC5C,iBAAiB,GAClB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAEL,cAAc,GAMf,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,WAAW,EACX,UAAU,EACV,UAAU,EACV,mBAAmB,EACnB,aAAa,EACb,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAGrF,OAAO,EAAE,mBAAmB,EAAE,MAAM,oC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AAC,OAAO,CAAK,CAC3B,CACH,CACJ,CAAC;QACJ,CAAC,IACD,CACH,CAAC,CAAC,CAAC,CACF,6BAAK,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,gBAAc,8BAA8B,GAAI,CAC/G,CAAC;AACJ,CAAC,CAAC,CAAC;AACH,gBAAgB,CAAC,WAAW,GAAG,cAAc,CAAC","sourcesContent":["import * as React from 'react';\nimport { IChildProps, IScatterChartStyleProps, IScatterChartStyles, IScatterChartProps } from './ScatterChart.types';\nimport { Axis as D3Axis } from 'd3-axis';\nimport { select as d3Select } from 'd3-selection';\nimport { ILegend, ILegendContainer, Legends } from '../Legends/index';\nimport { max as d3Max, min as d3Min } from 'd3-array';\nimport {\n areArraysEqual,\n createNumericYAxis,\n createStringYAxis,\n domainRangeOfXStringAxis,\n findNumericMinMaxOfY,\n getDomainPaddingForMarkers,\n isScatterPolarSeries,\n isTextMode,\n YAxisType,\n isPlottable,\n getRangeForScatterMarkerSize,\n domainRangeOfDateForAreaLineScatterVerticalBarCharts,\n domainRangeOfNumericForAreaLineScatterCharts,\n findCalloutPoints,\n} from '../../utilities/index';\nimport {\n IAccessibilityProps,\n CartesianChart,\n ICustomizedCalloutData,\n IMargins,\n IRefArrayData,\n IChart,\n IYValueHover,\n} from '../../index';\nimport {\n calloutData,\n ChartTypes,\n XAxisTypes,\n tooltipOfAxislabels,\n getTypeOfAxis,\n getNextColor,\n getColorFromToken,\n sortAxisCategories,\n} from '../../utilities/index';\nimport { classNamesFunction, DirectionalHint, getId, getRTL } from '@fluentui/react';\nimport { IImageExportOptions, IScatterChartDataPoint, IScatterChartPoints } from '../../types/index';\nimport { ILineChartPoints } from '../../types/IDataPoint';\nimport { exportChartsAsImage } from '../../utilities/image-export-utils';\nimport { formatDateToLocaleString } from '@fluentui/chart-utilities';\nimport { renderScatterPolarCategoryLabels } from '../../utilities/scatterpolar-utils';\nimport type { JSXElement } from '@fluentui/utilities';\n\ntype NumericAxis = D3Axis<number | { valueOf(): number }>;\n\ntype ScatterChartDataWithIndex = IScatterChartPoints & { index: number };\nconst getClassNames = classNamesFunction<IScatterChartStyleProps, IScatterChartStyles>();\n\n// Create a ScatterChart variant which uses these default styles and this styled subcomponent.\n/**\n * ScatterChart component\n * {@docCategory ScatterChart}\n */\nexport const ScatterChartBase: React.FunctionComponent<IScatterChartProps> = React.forwardRef<\n HTMLDivElement,\n IScatterChartProps\n>((props, forwardedRef) => {\n const _circleId = React.useMemo(() => getId('circle'), []);\n const _seriesId: string = React.useMemo(() => getId('seriesID'), []);\n const _verticalLine: string = React.useMemo(() => getId('verticalLine'), []);\n const _tooltipId: string = React.useMemo(() => getId('ScatterChartTooltipId_'), []);\n const _firstRenderOptimization = true;\n const _emptyChartId: string = React.useMemo(() => getId('_ScatterChart_empty'), []);\n const _points = React.useRef<ScatterChartDataWithIndex[]>(\n _injectIndexPropertyInScatterChartData(props.data.scatterChartData),\n );\n let _calloutPoints = React.useMemo(() => calloutData(_points.current) || {}, [_points]);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const _xAxisScale: any = React.useRef<any>('');\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const _yAxisScale: any = React.useRef<any>('');\n const _uniqueCallOutID = React.useRef<string | null>(null);\n const _refArray = React.useMemo(() => [], []);\n const margins = React.useRef<IMargins | null>(null);\n\n const renderSeries = React.useRef<JSXElement[]>([]);\n let _xAxisLabels: string[] = [];\n const _xAxisCalloutAccessibilityData: IAccessibilityProps = {};\n const _xBandwidth = React.useRef<number>(0);\n const cartesianChartRef = React.useRef<IChart>(null);\n const legendsRef = React.useRef<ILegendContainer>(null);\n\n const [hoverXValue, setHoverXValue] = React.useState<string | number>('');\n const [activeLegend, setActiveLegend] = React.useState<string>('');\n const [YValueHover, setYValueHover] = React.useState<IYValueHover[]>([]);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const [selectedLegendPoints, setSelectedLegendPoints] = React.useState<any[]>([]);\n const [isSelectedLegend, setIsSelectedLegend] = React.useState<boolean>(false);\n const [activePoint, setActivePoint] = React.useState<string>('');\n const [stackCalloutProps, setStackCalloutProps] = React.useState<ICustomizedCalloutData>();\n const [isCalloutVisible, setCalloutVisible] = React.useState(false);\n const [selectedLegends, setSelectedLegends] = React.useState<string[]>(props.legendProps?.selectedLegends || []);\n const [refSelected, setRefSelected] = React.useState<string>('');\n const prevSelectedLegendsRef = React.useRef<string[] | undefined>(undefined);\n const _isScatterPolarRef = React.useRef(false);\n const _isTextMode = React.useRef(false);\n\n const classNames = getClassNames(props.styles!, {\n theme: props.theme!,\n });\n\n React.useEffect(() => {\n if (\n prevSelectedLegendsRef.current &&\n !areArraysEqual(prevSelectedLegendsRef.current, props.legendProps?.selectedLegends)\n ) {\n setSelectedLegends(props.legendProps?.selectedLegends || []);\n }\n prevSelectedLegendsRef.current = props.legendProps?.selectedLegends;\n }, [props.legendProps?.selectedLegends]);\n\n React.useImperativeHandle(\n props.componentRef,\n () => ({\n chartContainer: cartesianChartRef.current?.chartContainer ?? null,\n toImage: (opts?: IImageExportOptions): Promise<string> => {\n return exportChartsAsImage(\n [{ container: cartesianChartRef.current?.chartContainer }],\n props.hideLegend ? undefined : legendsRef.current?.toSVG,\n getRTL(),\n opts,\n );\n },\n }),\n [props.hideLegend],\n );\n\n const _xAxisType: XAxisTypes =\n props.data.scatterChartData! &&\n props.data.scatterChartData!.length > 0 &&\n props.data.scatterChartData![0].data &&\n props.data.scatterChartData![0].data.length > 0\n ? (getTypeOfAxis(props.data.scatterChartData![0].data[0].x, true) as XAxisTypes)\n : XAxisTypes.StringAxis;\n\n // Detect y axis type (numeric or string)\n const _yAxisType: YAxisType =\n props.data.scatterChartData &&\n props.data.scatterChartData.length > 0 &&\n props.data.scatterChartData[0].data &&\n props.data.scatterChartData[0].data.length > 0\n ? typeof props.data.scatterChartData[0].data[0].y === 'string'\n ? YAxisType.StringAxis\n : YAxisType.NumericAxis\n : YAxisType.NumericAxis;\n\n const pointsRef = React.useRef<ScatterChartDataWithIndex[] | []>([]);\n React.useEffect(() => {\n /** note that height and width are not used to resize or set as dimesions of the chart,\n * fitParentContainer is responisble for setting the height and width or resizing of the svg/chart\n */\n\n if (\n _points.current !== _injectIndexPropertyInScatterChartData(props.data.scatterChartData) ||\n props.data !== _points.current\n ) {\n pointsRef.current = _injectIndexPropertyInScatterChartData(props.data.scatterChartData);\n }\n }, [props.height, props.width, props.data, _points]);\n\n function _injectIndexPropertyInScatterChartData(\n scatterChartData?: IScatterChartPoints[],\n ): ScatterChartDataWithIndex[] | [] {\n return scatterChartData\n ? scatterChartData.map((item: IScatterChartPoints, index: number) => {\n let color: string;\n if (typeof item.color === 'undefined') {\n color = getNextColor(index, 0);\n } else {\n color = getColorFromToken(item.color);\n }\n return {\n ...item,\n index: -1,\n color,\n };\n })\n : [];\n }\n\n const _getMargins = React.useCallback((_margins: IMargins) => {\n margins.current = _margins;\n }, []);\n\n function _onHoverCardHide() {\n setSelectedLegendPoints([]);\n setIsSelectedLegend(false);\n }\n\n function _createLegends(data: ScatterChartDataWithIndex[]): JSXElement {\n const { legendProps } = props;\n const isLegendMultiSelectEnabled = !!(legendProps && !!legendProps.canSelectMultipleLegends);\n const mapLegendToPoints: Record<string, ScatterChartDataWithIndex[]> = {};\n data.forEach((point: ScatterChartDataWithIndex) => {\n if (point.legend) {\n if (!mapLegendToPoints[point.legend]) {\n mapLegendToPoints[point.legend] = [];\n }\n mapLegendToPoints[point.legend].push(point);\n }\n });\n const legendDataItems: ILegend[] = Object.entries(mapLegendToPoints).map(([legendTitle, points]) => {\n const representativePoint = points[0];\n // mapping data to the format Legends component needs\n const legend: ILegend = {\n title: legendTitle,\n color: representativePoint.color!,\n onMouseOutAction: () => {\n setActiveLegend('');\n },\n hoverAction: () => {\n _handleChartMouseLeave();\n setActiveLegend(legendTitle);\n },\n ...(representativePoint.legendShape && {\n shape: representativePoint.legendShape,\n }),\n };\n return legend;\n });\n\n return (\n <Legends\n ref={legendsRef}\n legends={[...legendDataItems]}\n enabledWrapLines={props.enabledLegendsWrapLines}\n overflowProps={props.legendsOverflowProps}\n focusZonePropsInHoverCard={props.focusZonePropsForLegendsInHoverCard}\n overflowText={props.legendsOverflowText}\n {...(isLegendMultiSelectEnabled && { onLegendHoverCardLeave: _onHoverCardHide })}\n onChange={_onLegendSelectionChange}\n {...props.legendProps}\n />\n );\n }\n\n function _getOrderedYAxisLabels() {\n const shouldOrderYAxisLabelsByCategoryOrder =\n _yAxisType === YAxisType.StringAxis && props.yAxisCategoryOrder !== 'default';\n if (!shouldOrderYAxisLabelsByCategoryOrder) {\n // Collect all unique string y values from all data points in all series, in reverse order\n const yLabelsSet = new Set<string>();\n for (let i = _points.current.length - 1; i >= 0; i--) {\n const point = _points.current[i];\n if (point.data && Array.isArray(point.data)) {\n for (const d of point.data) {\n if (typeof d.y === 'string') {\n yLabelsSet.add(d.y);\n }\n }\n }\n }\n return Array.from(yLabelsSet);\n }\n\n return sortAxisCategories(_mapCategoryToValues(), props.yAxisCategoryOrder);\n }\n\n function _mapCategoryToValues() {\n const categoryToValues: Record<string, number[]> = {};\n _points.current.forEach(point => {\n if (point.data && Array.isArray(point.data)) {\n point.data.forEach(d => {\n if (typeof d.y === 'string') {\n if (!categoryToValues[d.y]) {\n categoryToValues[d.y] = [];\n }\n if (typeof d.x === 'number') {\n categoryToValues[d.y].push(d.x);\n }\n }\n });\n }\n });\n return categoryToValues;\n }\n\n function _onLegendSelectionChange(\n legendsSelected: string[],\n event: React.MouseEvent<HTMLButtonElement>,\n currentLegend?: ILegend,\n ): void {\n if (props.legendProps?.canSelectMultipleLegends) {\n setSelectedLegends(legendsSelected);\n } else {\n setSelectedLegends(legendsSelected.slice(-1));\n }\n\n if (props.legendProps?.onChange) {\n props.legendProps.onChange(legendsSelected, event, currentLegend);\n }\n }\n\n const _getPointFill = React.useCallback(\n (lineColor: string, pointId: string) => {\n const { theme } = props;\n if (activePoint === pointId) {\n return theme!.semanticColors.bodyBackground;\n } else {\n return lineColor;\n }\n },\n [activePoint, props],\n );\n\n const getDomainNRangeValuesScatterChart = React.useCallback(\n (\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n points: any,\n domainMargins: IMargins,\n width: number,\n _chartType: ChartTypes,\n isRTL: boolean,\n xAxisType: XAxisTypes,\n _barWidth: number,\n tickValues: number[] | Date[] | string[] | undefined,\n ) => {\n if (xAxisType === XAxisTypes.NumericAxis) {\n return domainRangeOfNumericForAreaLineScatterCharts(\n points,\n domainMargins,\n width,\n isRTL,\n props.xScaleType,\n true,\n );\n } else if (xAxisType === XAxisTypes.DateAxis) {\n return domainRangeOfDateForAreaLineScatterVerticalBarCharts(\n points,\n domainMargins,\n width,\n isRTL,\n tickValues! as Date[],\n _chartType,\n );\n }\n // String Axis type\n return domainRangeOfXStringAxis(domainMargins, width, isRTL);\n },\n [props.xScaleType],\n );\n\n const _handleFocus = React.useCallback(\n (\n seriesId: string,\n x: number | Date | string,\n xAxisCalloutData: string | undefined,\n circleId: string,\n xAxisCalloutAccessibilityData?: IAccessibilityProps,\n ) => {\n _uniqueCallOutID.current = circleId;\n const formattedData = x instanceof Date ? formatDateToLocaleString(x, props.culture, props.useUTC) : x;\n const found = findCalloutPoints(_calloutPoints, x);\n // if no points need to be called out then don't show vertical line and callout card\n if (found) {\n d3Select(`#${_verticalLine}`)\n .attr('transform', () => `translate(${_xAxisScale.current?.(x) + _xBandwidth.current}, 0)`)\n .attr('visibility', 'visibility');\n _refArray.forEach((obj: IRefArrayData) => {\n if (obj.index === seriesId) {\n setCalloutVisible(true);\n xAxisCalloutData ? setHoverXValue(xAxisCalloutData) : setHoverXValue('' + formattedData);\n setRefSelected(`#${circleId}`);\n setYValueHover(found!.values);\n setActivePoint(circleId);\n }\n });\n } else {\n setActivePoint(circleId);\n }\n },\n [_verticalLine, _xAxisScale, _xBandwidth, _calloutPoints, _refArray, props.culture, props.useUTC],\n );\n\n const _handleHover = React.useCallback(\n (\n x: number | Date | string,\n y: number,\n lineHeight: number,\n xAxisCalloutData: string | undefined,\n circleId: string,\n xAxisCalloutAccessibilityData: IAccessibilityProps | undefined,\n mouseEvent: React.MouseEvent<SVGElement>,\n ) => {\n mouseEvent?.persist();\n const formattedData = x instanceof Date ? formatDateToLocaleString(x, props.culture, props.useUTC) : x;\n const found = findCalloutPoints(_calloutPoints, x) as ICustomizedCalloutData | undefined;\n // if no points need to be called out then don't show vertical line and callout card\n if (found) {\n d3Select(`#${_verticalLine}`)\n .attr(\n 'transform',\n () => `translate(${_xAxisScale.current?.(x) + _xBandwidth.current}, ${_yAxisScale.current?.(y)})`,\n )\n .attr('visibility', 'visibility')\n .attr('y2', `${lineHeight - _yAxisScale.current?.(y)}`);\n\n if (_uniqueCallOutID.current !== circleId) {\n _uniqueCallOutID.current = circleId;\n setCalloutVisible(true);\n xAxisCalloutData ? setHoverXValue(xAxisCalloutData) : setHoverXValue('' + formattedData);\n setRefSelected(`#${circleId}`);\n setYValueHover(found.values);\n setStackCalloutProps(found!);\n setActivePoint(circleId);\n }\n } else {\n setActivePoint(circleId);\n }\n },\n [_verticalLine, _xAxisScale, _xBandwidth, _calloutPoints, props.culture, props.useUTC],\n );\n\n const _handleMouseOut = React.useCallback(() => {\n d3Select(`#${_verticalLine}`).attr('visibility', 'hidden');\n }, [_verticalLine]);\n\n const _handleChartMouseLeave = React.useCallback(() => {\n _uniqueCallOutID.current = null;\n setActivePoint('');\n if (isCalloutVisible) {\n setCalloutVisible(false);\n }\n }, [_uniqueCallOutID, isCalloutVisible, setActivePoint, setCalloutVisible]);\n\n const _getHighlightedLegend = React.useCallback((): string[] => {\n return selectedLegends.length > 0 ? selectedLegends : activeLegend ? [activeLegend] : [];\n }, [selectedLegends, activeLegend]);\n\n /**\n * This function checks if none of the legends is selected or hovered.*/\n const _noLegendHighlighted = React.useCallback((): boolean => {\n return _getHighlightedLegend().length === 0;\n }, [_getHighlightedLegend]);\n\n /**\n * This function checks if the given legend is highlighted or not.\n * A legend can be highlighted in 2 ways:\n * 1. selection: if the user clicks on it\n * 2. hovering: if there is no selected legend and the user hovers over it*/\n\n const _legendHighlighted = React.useCallback(\n (legend: string): boolean => {\n return _getHighlightedLegend().includes(legend);\n },\n [_getHighlightedLegend],\n );\n\n const _getAriaLabel = React.useCallback(\n (seriesIndex: number, pointIndex: number): string => {\n const series = _points.current?.[seriesIndex];\n const point = series.data[pointIndex];\n const formattedDate =\n point.x instanceof Date ? formatDateToLocaleString(point.x, props.culture, props.useUTC) : point.x;\n const xValue = point.xAxisCalloutData || formattedDate;\n const legend = series.legend;\n const yValue = point.yAxisCalloutData || point.y;\n return point.callOutAccessibilityData?.ariaLabel || `${xValue}. ${legend}, ${yValue}.`;\n },\n [_points, props.culture, props.useUTC],\n );\n\n const _createPlot = React.useCallback(\n (xElement: SVGElement, containerHeight: number): JSXElement[] => {\n const series: JSXElement[] = [];\n if (isSelectedLegend) {\n _points.current = selectedLegendPoints;\n } else {\n _points.current = _injectIndexPropertyInScatterChartData(props.data.scatterChartData);\n }\n\n if (_xAxisType === XAxisTypes.StringAxis) {\n _xBandwidth.current = _xAxisScale.current?.bandwidth() / 2;\n }\n\n const minMarkerSize =\n d3Min(_points.current, (point: IScatterChartPoints) => {\n return d3Min(point.data as IScatterChartDataPoint[], (item: IScatterChartDataPoint) => {\n return item.markerSize as number;\n });\n }) ?? 0;\n const maxMarkerSize =\n d3Max(_points.current, (point: IScatterChartPoints) => {\n return d3Max(point.data as IScatterChartDataPoint[], (item: IScatterChartDataPoint) => {\n return item.markerSize as number;\n });\n }) ?? 0;\n const isContinuousXY = _xAxisType !== XAxisTypes.StringAxis && _yAxisType !== YAxisType.StringAxis;\n const extraMaxPixels = isContinuousXY\n ? getRangeForScatterMarkerSize({\n data: _points.current,\n xScale: _xAxisScale.current,\n yScalePrimary: _yAxisScale.current,\n xScaleType: props.xScaleType,\n yScaleType: props.yScaleType,\n })\n : 0;\n\n for (let i = _points.current?.length - 1; i >= 0; i--) {\n const pointsForSeries: JSXElement[] = [];\n\n const legendVal: string = _points.current?.[i]?.legend;\n const seriesColor: string = _points.current?.[i]?.color!;\n const verticaLineHeight = containerHeight - (margins.current?.bottom ?? 0) + 6;\n\n for (let j = 0; j < _points.current?.[i]?.data?.length; j++) {\n const { x, y, xAxisCalloutData, xAxisCalloutAccessibilityData } = _points.current?.[i]?.data[j];\n const xPoint = _xAxisScale.current?.(x);\n // Use string y axis scale if needed\n const yPoint =\n _yAxisType === YAxisType.StringAxis\n ? _yAxisScale.current?.(y) + (_yAxisScale.current?.bandwidth ? _yAxisScale.current.bandwidth() / 2 : 0)\n : _yAxisScale.current?.(y);\n if (!isPlottable(xPoint, yPoint)) {\n continue;\n }\n\n const seriesId = `${_seriesId}_${i}_${j}`;\n const circleId = `${_circleId}_${i}_${j}`;\n const pointMarkerSize = (_points.current?.[i]?.data[j] as IScatterChartDataPoint).markerSize;\n const minPixel = 4;\n const maxPixel = 16;\n let circleRadius = activePoint === circleId ? 6 : 4;\n\n if (pointMarkerSize) {\n if (isContinuousXY && maxMarkerSize !== 0) {\n circleRadius = (pointMarkerSize * extraMaxPixels) / maxMarkerSize;\n } else if (!isContinuousXY && maxMarkerSize !== minMarkerSize) {\n circleRadius =\n minPixel +\n ((pointMarkerSize - minMarkerSize) / (maxMarkerSize - minMarkerSize)) * (maxPixel - minPixel);\n }\n }\n\n const isLegendSelected: boolean = _legendHighlighted(legendVal) || _noLegendHighlighted() || isSelectedLegend;\n\n const currentPointHidden = _points.current?.[i]?.hideNonActiveDots && activePoint !== circleId;\n const text = _points.current?.[i].data[j]?.text;\n if (!_isTextMode.current) {\n pointsForSeries.push(\n <>\n <circle\n id={circleId}\n key={circleId}\n r={Math.max(circleRadius, 4)}\n cx={xPoint + _xBandwidth.current}\n cy={yPoint}\n data-is-focusable={isLegendSelected}\n onMouseOver={(event: React.MouseEvent<SVGElement>) =>\n _handleHover(\n x,\n y,\n verticaLineHeight,\n xAxisCalloutData,\n circleId,\n xAxisCalloutAccessibilityData,\n event,\n )\n }\n onMouseMove={(event: React.MouseEvent<SVGElement>) =>\n _handleHover(\n x,\n y,\n verticaLineHeight,\n xAxisCalloutData,\n circleId,\n xAxisCalloutAccessibilityData,\n event,\n )\n }\n onMouseOut={_handleMouseOut}\n onFocus={() => _handleFocus(seriesId, x, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData)}\n onBlur={_handleMouseOut}\n {..._getClickHandler(_points.current?.[i]?.data[j]?.onDataPointClick)}\n opacity={isLegendSelected && !currentPointHidden ? 1 : 0.1}\n fill={_getPointFill(seriesColor, circleId)}\n stroke={seriesColor}\n role=\"img\"\n aria-label={_getAriaLabel(i, j)}\n tabIndex={_points.current?.[i]?.legend !== '' ? 0 : undefined}\n />\n </>,\n );\n }\n if (_isTextMode && text) {\n pointsForSeries.push(\n <text\n key={`${circleId}-label`}\n x={xPoint + _xBandwidth.current}\n y={yPoint + Math.max(circleRadius + 12, 16)}\n className={classNames.markerLabel}\n >\n {text}\n </text>,\n );\n }\n }\n\n if (_isScatterPolarRef.current) {\n pointsForSeries.push(\n ...renderScatterPolarCategoryLabels({\n xAxisScale: _xAxisScale.current,\n yAxisScale: _yAxisScale.current,\n className: classNames.markerLabel || '',\n lineOptions: (_points.current?.[i] as Partial<ILineChartPoints>)?.lineOptions,\n }),\n );\n }\n\n series.push(\n <g\n key={`series_${i}`}\n role=\"region\"\n aria-label={`${legendVal}, series ${i + 1} of ${_points.current?.length} with ${\n _points.current?.[i]?.data?.length\n } data points.`}\n >\n {pointsForSeries}\n </g>,\n );\n }\n\n // Removing un wanted tooltip div from DOM, when prop not provided.\n if (!props.showXAxisLablesTooltip) {\n try {\n document.getElementById(_tooltipId) && document.getElementById(_tooltipId)!.remove();\n // eslint-disable-next-line no-empty\n } catch (e) {}\n }\n // Used to display tooltip at x axis labels.\n if (!props.wrapXAxisLables && props.showXAxisLablesTooltip) {\n const xAxisElement = d3Select(xElement).call(_xAxisScale.current);\n try {\n document.getElementById(_tooltipId) && document.getElementById(_tooltipId)!.remove();\n // eslint-disable-next-line no-empty\n } catch (e) {}\n const tooltipProps = {\n tooltipCls: classNames.tooltip!,\n id: _tooltipId,\n xAxis: xAxisElement,\n };\n xAxisElement && tooltipOfAxislabels(tooltipProps);\n }\n return series;\n },\n [\n _xAxisScale,\n _yAxisScale,\n props.data.scatterChartData,\n props.showXAxisLablesTooltip,\n props.wrapXAxisLables,\n _circleId,\n _getAriaLabel,\n _getPointFill,\n _handleFocus,\n _handleHover,\n _handleMouseOut,\n _legendHighlighted,\n _noLegendHighlighted,\n _seriesId,\n _tooltipId,\n _xAxisType,\n _yAxisType,\n activePoint,\n isSelectedLegend,\n selectedLegendPoints,\n classNames,\n props.xScaleType,\n props.yScaleType,\n ],\n );\n\n const _initializeScatterChartData = React.useCallback(\n (\n xScale: NumericAxis,\n yScale: NumericAxis,\n containerHeight: number,\n containerWidth: number,\n xElement: SVGElement | null,\n ) => {\n _xAxisScale.current = xScale;\n _yAxisScale.current = yScale;\n _isScatterPolarRef.current = isScatterPolarSeries(_points.current);\n _isTextMode.current = isTextMode(_points.current);\n renderSeries.current = _createPlot(xElement!, containerHeight!);\n },\n [renderSeries, _xAxisScale, _yAxisScale, _createPlot],\n );\n\n /**\n * Screen readers announce an element as clickable if the onClick attribute is set.\n * This function sets the attribute only when a click event handler is provided.*/\n\n function _getClickHandler(func?: () => void): { onClick?: () => void } {\n if (func) {\n return {\n onClick: func,\n };\n }\n\n return {};\n }\n\n function _isChartEmpty(): boolean {\n return !(\n props.data &&\n props.data.scatterChartData &&\n props.data.scatterChartData.length > 0 &&\n props.data.scatterChartData.filter((item: IScatterChartPoints) => item.data.length).length > 0\n );\n }\n\n function _closeCallout() {\n setCalloutVisible(false);\n }\n\n const _getNumericMinMaxOfY = React.useCallback(\n (points: IScatterChartPoints[], yAxisType?: YAxisType): { startValue: number; endValue: number } => {\n const { startValue, endValue } = findNumericMinMaxOfY(points, yAxisType, undefined, props.yScaleType);\n const yPadding = getDomainPaddingForMarkers(startValue, endValue, props.yScaleType);\n\n return {\n startValue: startValue - yPadding.start,\n endValue: endValue + yPadding.end,\n };\n },\n [props.yScaleType],\n );\n\n const { legendProps, tickValues, tickFormat } = props;\n _points.current = _injectIndexPropertyInScatterChartData(props.data.scatterChartData);\n\n let points = _points.current as IScatterChartPoints[];\n if (legendProps && !!legendProps.canSelectMultipleLegends) {\n points = selectedLegendPoints.length >= 1 ? selectedLegendPoints : _points.current;\n _calloutPoints = calloutData(points);\n }\n\n let legendBars = null;\n // reduce computation cost by only creating legendBars\n // if when hideLegend is false.\n // NOTE: they are rendered only when hideLegend is false in CartesianChart.\n if (!props.hideLegend && !_isTextMode.current) {\n legendBars = _createLegends(_points.current!); // ToDo: Memoize legends to improve performance.\n }\n const calloutProps = {\n isCalloutVisible,\n directionalHint: DirectionalHint.topAutoEdge,\n YValueHover,\n hoverXValue,\n id: `toolTip${_uniqueCallOutID.current}`,\n target: refSelected,\n isBeakVisible: false,\n gapSpace: 15,\n onDismiss: _closeCallout,\n preventDismissOnEvent: () => true,\n hidden: !(!props.hideTooltip && isCalloutVisible),\n descriptionMessage:\n props.getCalloutDescriptionMessage && stackCalloutProps\n ? props.getCalloutDescriptionMessage(stackCalloutProps)\n : undefined,\n 'data-is-focusable': true,\n xAxisCalloutAccessibilityData: _xAxisCalloutAccessibilityData,\n ...props.calloutProps,\n };\n const tickParams = {\n tickValues,\n tickFormat,\n };\n\n const xAxisLabels: string[] = _points.current\n .map((point: ScatterChartDataWithIndex) => point.data.map((dp: IScatterChartDataPoint) => dp.x as string))\n .flat();\n\n _xAxisLabels = Array.from(new Set(xAxisLabels));\n\n // Compute unique y axis labels for string y axis\n const _yAxisLabels: string[] = _getOrderedYAxisLabels();\n\n return !_isChartEmpty() ? (\n <CartesianChart\n {...props}\n ref={cartesianChartRef}\n chartTitle={props.data.chartTitle}\n isCalloutForStack\n points={points}\n chartType={ChartTypes.ScatterChart}\n calloutProps={calloutProps}\n tickParams={tickParams}\n legendBars={legendBars}\n getmargins={_getMargins}\n getMinMaxOfYAxis={_getNumericMinMaxOfY}\n getDomainNRangeValues={getDomainNRangeValuesScatterChart}\n createYAxis={createNumericYAxis}\n createStringYAxis={createStringYAxis}\n getGraphData={_initializeScatterChartData}\n xAxisType={_xAxisType}\n yAxisType={_yAxisType}\n // Pass stringDatasetForYAxisDomain only if y axis is string\n {...(_yAxisType === YAxisType.StringAxis ? { stringDatasetForYAxisDomain: _yAxisLabels } : {})}\n onChartMouseLeave={_handleChartMouseLeave}\n enableFirstRenderOptimization={_firstRenderOptimization}\n datasetForXAxisDomain={_xAxisLabels}\n componentRef={cartesianChartRef}\n {...(_isScatterPolarRef.current ? { yMaxValue: 1, yMinValue: -1 } : {})}\n /* eslint-disable react/jsx-no-bind */\n\n children={(childProps: IChildProps) => {\n _xAxisScale.current = childProps.xScale!;\n _yAxisScale.current = childProps.yScalePrimary!;\n return (\n <>\n <g>\n <line\n x1={0}\n y1={0}\n x2={0}\n y2={childProps.containerHeight}\n stroke={'#323130'}\n id={_verticalLine}\n visibility={'hidden'}\n strokeDasharray={'5,5'}\n />\n <g>{renderSeries.current}</g>\n </g>\n </>\n );\n }}\n />\n ) : (\n <div id={_emptyChartId} role={'alert'} style={{ opacity: '0' }} aria-label={'Graph has no data to display'} />\n );\n});\nScatterChartBase.displayName = 'ScatterChart';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScatterChart.types.js","sourceRoot":"../src/","sources":["components/ScatterChart/ScatterChart.types.ts"],"names":[],"mappings":"","sourcesContent":["
|
|
1
|
+
{"version":3,"file":"ScatterChart.types.js","sourceRoot":"../src/","sources":["components/ScatterChart/ScatterChart.types.ts"],"names":[],"mappings":"","sourcesContent":["import { IRenderFunction } from '@fluentui/react/lib/Utilities';\nimport {\n IChartProps,\n ILineChartPoints,\n IMargins,\n IBasestate,\n IRefArrayData,\n ICustomizedCalloutData,\n} from '../../types/index';\nimport {\n ICartesianChartProps,\n ICartesianChartStyleProps,\n ICartesianChartStyles,\n IChildProps,\n} from '../CommonComponents/index';\nimport { IStyle } from '@fluentui/react';\n\nexport type { IChildProps, ILineChartPoints, IMargins, IBasestate, IRefArrayData };\n\n/**\n * Line Chart properties\n * {@docCategory LineChart}\n */\nexport interface IScatterChartProps extends ICartesianChartProps {\n /**\n * Data to render in the chart.\n */\n data: IChartProps;\n\n /**\n * Call to provide customized styling that will layer on top of the variant rules.\n */\n styles?: IScatterChartStyles;\n\n /**\n * Define a custom callout renderer for a data point\n */\n onRenderCalloutPerDataPoint?: IRenderFunction<ICustomizedCalloutData>;\n\n /**\n * Callback for getting callout description message\n */\n getCalloutDescriptionMessage?: (calloutDataProps: ICustomizedCalloutData) => string | undefined;\n\n /**\n * The prop used to define the culture to localized the numbers\n */\n culture?: string;\n}\n\n/**\n * Scatter Chart styles\n * {@docCategory ScatterChart}\n */\nexport interface IScatterChartStyles extends ICartesianChartStyles {\n /**\n * Style for the marker label\n */\n markerLabel?: IStyle;\n}\n\n/**\n * Scatter Chart style properties\n * {@docCategory ScatterChart}\n */\nexport interface IScatterChartStyleProps extends ICartesianChartStyleProps {}\n"]}
|
|
@@ -24,7 +24,6 @@ var MultiStackedBarChartBase = /** @class */ (function (_super) {
|
|
|
24
24
|
barHeight: barHeight,
|
|
25
25
|
});
|
|
26
26
|
};
|
|
27
|
-
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
28
27
|
_this._getLegendData = function (data, hideRatio, palette) {
|
|
29
28
|
var defaultPalette = [palette.blueLight, palette.blue, palette.blueMid, palette.red, palette.black];
|
|
30
29
|
var actions = [];
|
|
@@ -167,7 +166,6 @@ var MultiStackedBarChartBase = /** @class */ (function (_super) {
|
|
|
167
166
|
this.setState({ barSpacingInPercent: currentBarSpacing });
|
|
168
167
|
}
|
|
169
168
|
};
|
|
170
|
-
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
171
169
|
MultiStackedBarChartBase.prototype.render = function () {
|
|
172
170
|
var _this = this;
|
|
173
171
|
if (!this._isChartEmpty()) {
|
|
@@ -185,7 +183,6 @@ var MultiStackedBarChartBase = /** @class */ (function (_super) {
|
|
|
185
183
|
var legendName = this.state.xCalloutValue ? this.state.xCalloutValue : this.state.calloutLegend;
|
|
186
184
|
var calloutYVal = this.state.yCalloutValue ? this.state.yCalloutValue : this.state.dataForHoverCard;
|
|
187
185
|
this._longestBarTotalValue = this._computeLongestBarTotalValue();
|
|
188
|
-
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
189
186
|
var bars = data.map(function (singleChartData, index) {
|
|
190
187
|
var singleChartBars = _this._createBarsAndLegends(singleChartData, _this.props.barHeight, palette_1, _this.props.hideRatio[index], _this.props.hideDenominator[index], _this.props.href, index);
|
|
191
188
|
return (React.createElement("div", { key: index, id: "_MSBC_bar-".concat(index) }, singleChartBars));
|
|
@@ -193,9 +190,7 @@ var MultiStackedBarChartBase = /** @class */ (function (_super) {
|
|
|
193
190
|
return (React.createElement("div", { className: this._classNames.root, onMouseLeave: this._handleChartMouseLeave },
|
|
194
191
|
bars,
|
|
195
192
|
!this.props.hideLegend && React.createElement("div", { className: this._classNames.legendContainer }, legends),
|
|
196
|
-
React.createElement(Callout, __assign({ gapSpace: 15, isBeakVisible: false, target: this.state.refSelected, setInitialFocus: true, hidden: !(!this.props.hideTooltip && isCalloutVisible), directionalHint: DirectionalHint.topAutoEdge, id: this._calloutId, onDismiss: this._closeCallout,
|
|
197
|
-
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
198
|
-
preventDismissOnLostFocus: true,
|
|
193
|
+
React.createElement(Callout, __assign({ gapSpace: 15, isBeakVisible: false, target: this.state.refSelected, setInitialFocus: true, hidden: !(!this.props.hideTooltip && isCalloutVisible), directionalHint: DirectionalHint.topAutoEdge, id: this._calloutId, onDismiss: this._closeCallout, preventDismissOnLostFocus: true,
|
|
199
194
|
/** Keep the callout updated with details of focused/hovered bar */
|
|
200
195
|
shouldUpdateWhenHidden: true }, this.props.calloutProps, getAccessibleDataObject(this.state.callOutAccessibilityData, 'text', false)),
|
|
201
196
|
React.createElement(React.Fragment, null, this.props.onRenderCalloutPerDataPoint ? (this.props.onRenderCalloutPerDataPoint(this.state.dataPointCalloutProps)) : (React.createElement(ChartHoverCard, { Legend: legendName, YValue: calloutYVal, color: this.state.color, culture: culture }))))));
|