@fluentui/react-charts 9.0.1 → 9.0.3
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.md +58 -2
- package/dist/index.d.ts +1432 -238
- package/lib/AreaChart.js +1 -0
- package/lib/AreaChart.js.map +1 -0
- package/lib/GaugeChart.js +1 -0
- package/lib/GaugeChart.js.map +1 -0
- package/lib/GroupedVerticalBarChart.js +1 -0
- package/lib/GroupedVerticalBarChart.js.map +1 -0
- package/lib/HeatMapChart.js +1 -0
- package/lib/HeatMapChart.js.map +1 -0
- package/lib/HorizontalBarChartWithAxis.js +1 -0
- package/lib/HorizontalBarChartWithAxis.js.map +1 -0
- package/lib/SankeyChart.js +1 -0
- package/lib/SankeyChart.js.map +1 -0
- package/lib/ScatterChart.js +1 -0
- package/lib/ScatterChart.js.map +1 -0
- package/lib/VerticalStackedBarChart.js +1 -0
- package/lib/VerticalStackedBarChart.js.map +1 -0
- package/lib/components/AreaChart/AreaChart.js +775 -0
- package/lib/components/AreaChart/AreaChart.js.map +1 -0
- package/lib/components/AreaChart/AreaChart.types.js +4 -0
- package/lib/components/AreaChart/AreaChart.types.js.map +1 -0
- package/lib/components/AreaChart/index.js +3 -0
- package/lib/components/AreaChart/index.js.map +1 -0
- package/lib/components/AreaChart/useAreaChartStyles.styles.js +64 -0
- package/lib/components/AreaChart/useAreaChartStyles.styles.js.map +1 -0
- package/lib/components/CommonComponents/CartesianChart.js +30 -14
- package/lib/components/CommonComponents/CartesianChart.js.map +1 -1
- package/lib/components/CommonComponents/CartesianChart.types.js.map +1 -1
- package/lib/components/DeclarativeChart/DeclarativeChart.js +112 -65
- package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +570 -159
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib/components/DonutChart/Arc/Arc.js +1 -1
- package/lib/components/DonutChart/Arc/Arc.js.map +1 -1
- package/lib/components/DonutChart/DonutChart.js +1 -1
- package/lib/components/DonutChart/DonutChart.js.map +1 -1
- package/lib/components/GaugeChart/GaugeChart.js +592 -0
- package/lib/components/GaugeChart/GaugeChart.js.map +1 -0
- package/lib/components/GaugeChart/GaugeChart.types.js +4 -0
- package/lib/components/GaugeChart/GaugeChart.types.js.map +1 -0
- package/lib/components/GaugeChart/index.js +3 -0
- package/lib/components/GaugeChart/index.js.map +1 -0
- package/lib/components/GaugeChart/useGaugeChartStyles.styles.js +174 -0
- package/lib/components/GaugeChart/useGaugeChartStyles.styles.js.map +1 -0
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +501 -0
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -0
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.js +4 -0
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.js.map +1 -0
- package/lib/components/GroupedVerticalBarChart/index.js +3 -0
- package/lib/components/GroupedVerticalBarChart/index.js.map +1 -0
- package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js +90 -0
- package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js.map +1 -0
- package/lib/components/HeatMapChart/HeatMapChart.js +588 -0
- package/lib/components/HeatMapChart/HeatMapChart.js.map +1 -0
- package/lib/components/HeatMapChart/HeatMapChart.types.js +4 -0
- package/lib/components/HeatMapChart/HeatMapChart.types.js.map +1 -0
- package/lib/components/HeatMapChart/index.js +3 -0
- package/lib/components/HeatMapChart/index.js.map +1 -0
- package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.js +46 -0
- package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.js.map +1 -0
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +571 -0
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -0
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js +4 -0
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js.map +1 -0
- package/lib/components/HorizontalBarChartWithAxis/index.js +3 -0
- package/lib/components/HorizontalBarChartWithAxis/index.js.map +1 -0
- package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js +76 -0
- package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js.map +1 -0
- package/lib/components/Legends/Legends.js +38 -37
- package/lib/components/Legends/Legends.js.map +1 -1
- package/lib/components/Legends/Legends.types.js.map +1 -1
- package/lib/components/LineChart/LineChart.js +43 -35
- package/lib/components/LineChart/LineChart.js.map +1 -1
- package/lib/components/SankeyChart/SankeyChart.js +1022 -0
- package/lib/components/SankeyChart/SankeyChart.js.map +1 -0
- package/lib/components/SankeyChart/SankeyChart.types.js +3 -0
- package/lib/components/SankeyChart/SankeyChart.types.js.map +1 -0
- package/lib/components/SankeyChart/index.js +3 -0
- package/lib/components/SankeyChart/index.js.map +1 -0
- package/lib/components/SankeyChart/useSankeyChartStyles.styles.js +109 -0
- package/lib/components/SankeyChart/useSankeyChartStyles.styles.js.map +1 -0
- package/lib/components/ScatterChart/ScatterChart.js +465 -0
- package/lib/components/ScatterChart/ScatterChart.js.map +1 -0
- package/lib/components/ScatterChart/ScatterChart.types.js +4 -0
- package/lib/components/ScatterChart/ScatterChart.types.js.map +1 -0
- package/lib/components/ScatterChart/index.js +3 -0
- package/lib/components/ScatterChart/index.js.map +1 -0
- package/lib/components/ScatterChart/useScatterChartStyles.styles.js +65 -0
- package/lib/components/ScatterChart/useScatterChartStyles.styles.js.map +1 -0
- package/lib/components/Sparkline/Sparkline.js.map +1 -1
- package/lib/components/VerticalBarChart/VerticalBarChart.js +165 -88
- package/lib/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
- package/lib/components/VerticalBarChart/VerticalBarChart.types.js.map +1 -1
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js +904 -0
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -0
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js +1 -0
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js.map +1 -0
- package/lib/components/VerticalStackedBarChart/index.js +3 -0
- package/lib/components/VerticalStackedBarChart/index.js.map +1 -0
- package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js +73 -0
- package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js.map +1 -0
- package/lib/index.js +8 -0
- package/lib/index.js.map +1 -1
- package/lib/types/DataPoint.js +1 -3
- package/lib/types/DataPoint.js.map +1 -1
- package/lib/utilities/SVGTooltipText.js +49 -4
- package/lib/utilities/SVGTooltipText.js.map +1 -1
- package/lib/utilities/colors.js +20 -0
- package/lib/utilities/colors.js.map +1 -1
- package/lib/utilities/string.js +32 -0
- package/lib/utilities/string.js.map +1 -0
- package/lib/utilities/test-data.js +53 -0
- package/lib/utilities/test-data.js.map +1 -1
- package/lib/utilities/utilities.js +210 -20
- package/lib/utilities/utilities.js.map +1 -1
- package/lib-commonjs/AreaChart.js +6 -0
- package/lib-commonjs/AreaChart.js.map +1 -0
- package/lib-commonjs/GaugeChart.js +6 -0
- package/lib-commonjs/GaugeChart.js.map +1 -0
- package/lib-commonjs/GroupedVerticalBarChart.js +6 -0
- package/lib-commonjs/GroupedVerticalBarChart.js.map +1 -0
- package/lib-commonjs/HeatMapChart.js +6 -0
- package/lib-commonjs/HeatMapChart.js.map +1 -0
- package/lib-commonjs/HorizontalBarChartWithAxis.js +6 -0
- package/lib-commonjs/HorizontalBarChartWithAxis.js.map +1 -0
- package/lib-commonjs/SankeyChart.js +6 -0
- package/lib-commonjs/SankeyChart.js.map +1 -0
- package/lib-commonjs/ScatterChart.js +6 -0
- package/lib-commonjs/ScatterChart.js.map +1 -0
- package/lib-commonjs/VerticalStackedBarChart.js +6 -0
- package/lib-commonjs/VerticalStackedBarChart.js.map +1 -0
- package/lib-commonjs/components/AreaChart/AreaChart.js +781 -0
- package/lib-commonjs/components/AreaChart/AreaChart.js.map +1 -0
- package/lib-commonjs/components/AreaChart/AreaChart.types.js +7 -0
- package/lib-commonjs/components/AreaChart/AreaChart.types.js.map +1 -0
- package/lib-commonjs/components/AreaChart/index.js +8 -0
- package/lib-commonjs/components/AreaChart/index.js.map +1 -0
- package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.js +104 -0
- package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.js.map +1 -0
- package/lib-commonjs/components/CommonComponents/CartesianChart.js +29 -14
- package/lib-commonjs/components/CommonComponents/CartesianChart.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/CartesianChart.types.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js +120 -73
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +592 -178
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib-commonjs/components/DonutChart/Arc/Arc.js +1 -1
- package/lib-commonjs/components/DonutChart/Arc/Arc.js.map +1 -1
- package/lib-commonjs/components/DonutChart/DonutChart.js +1 -1
- package/lib-commonjs/components/DonutChart/DonutChart.js.map +1 -1
- package/lib-commonjs/components/GaugeChart/GaugeChart.js +621 -0
- package/lib-commonjs/components/GaugeChart/GaugeChart.js.map +1 -0
- package/lib-commonjs/components/GaugeChart/GaugeChart.types.js +7 -0
- package/lib-commonjs/components/GaugeChart/GaugeChart.types.js.map +1 -0
- package/lib-commonjs/components/GaugeChart/index.js +8 -0
- package/lib-commonjs/components/GaugeChart/index.js.map +1 -0
- package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.js +252 -0
- package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.js.map +1 -0
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +507 -0
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -0
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.js +7 -0
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.js.map +1 -0
- package/lib-commonjs/components/GroupedVerticalBarChart/index.js +8 -0
- package/lib-commonjs/components/GroupedVerticalBarChart/index.js.map +1 -0
- package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js +139 -0
- package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js.map +1 -0
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.js +599 -0
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.js.map +1 -0
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.types.js +7 -0
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.types.js.map +1 -0
- package/lib-commonjs/components/HeatMapChart/index.js +8 -0
- package/lib-commonjs/components/HeatMapChart/index.js.map +1 -0
- package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.js +68 -0
- package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.js.map +1 -0
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +580 -0
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -0
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js +7 -0
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js.map +1 -0
- package/lib-commonjs/components/HorizontalBarChartWithAxis/index.js +8 -0
- package/lib-commonjs/components/HorizontalBarChartWithAxis/index.js.map +1 -0
- package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js +116 -0
- package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js.map +1 -0
- package/lib-commonjs/components/Legends/Legends.js +37 -37
- package/lib-commonjs/components/Legends/Legends.js.map +1 -1
- package/lib-commonjs/components/Legends/Legends.types.js.map +1 -1
- package/lib-commonjs/components/LineChart/LineChart.js +41 -33
- package/lib-commonjs/components/LineChart/LineChart.js.map +1 -1
- package/lib-commonjs/components/SankeyChart/SankeyChart.js +1038 -0
- package/lib-commonjs/components/SankeyChart/SankeyChart.js.map +1 -0
- package/lib-commonjs/components/SankeyChart/SankeyChart.types.js +6 -0
- package/lib-commonjs/components/SankeyChart/SankeyChart.types.js.map +1 -0
- package/lib-commonjs/components/SankeyChart/index.js +8 -0
- package/lib-commonjs/components/SankeyChart/index.js.map +1 -0
- package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.js +179 -0
- package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.js.map +1 -0
- package/lib-commonjs/components/ScatterChart/ScatterChart.js +471 -0
- package/lib-commonjs/components/ScatterChart/ScatterChart.js.map +1 -0
- package/lib-commonjs/components/ScatterChart/ScatterChart.types.js +7 -0
- package/lib-commonjs/components/ScatterChart/ScatterChart.types.js.map +1 -0
- package/lib-commonjs/components/ScatterChart/index.js +8 -0
- package/lib-commonjs/components/ScatterChart/index.js.map +1 -0
- package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.js +96 -0
- package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.js.map +1 -0
- package/lib-commonjs/components/Sparkline/Sparkline.js.map +1 -1
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js +164 -87
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.types.js.map +1 -1
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js +915 -0
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -0
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js +6 -0
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js.map +1 -0
- package/lib-commonjs/components/VerticalStackedBarChart/index.js +8 -0
- package/lib-commonjs/components/VerticalStackedBarChart/index.js.map +1 -0
- package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js +120 -0
- package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js.map +1 -0
- package/lib-commonjs/index.js +8 -0
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/types/DataPoint.js +1 -3
- package/lib-commonjs/types/DataPoint.js.map +1 -1
- package/lib-commonjs/utilities/SVGTooltipText.js +49 -4
- package/lib-commonjs/utilities/SVGTooltipText.js.map +1 -1
- package/lib-commonjs/utilities/colors.js +23 -0
- package/lib-commonjs/utilities/colors.js.map +1 -1
- package/lib-commonjs/utilities/string.js +29 -0
- package/lib-commonjs/utilities/string.js.map +1 -0
- package/lib-commonjs/utilities/test-data.js +59 -0
- package/lib-commonjs/utilities/test-data.js.map +1 -1
- package/lib-commonjs/utilities/utilities.js +206 -19
- package/lib-commonjs/utilities/utilities.js.map +1 -1
- package/package.json +11 -8
- package/lib/components/DeclarativeChart/PlotlySchema.js +0 -7
- package/lib/components/DeclarativeChart/PlotlySchema.js.map +0 -1
- package/lib-commonjs/components/DeclarativeChart/PlotlySchema.js +0 -10
- package/lib-commonjs/components/DeclarativeChart/PlotlySchema.js.map +0 -1
|
@@ -0,0 +1,471 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "ScatterChart", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return ScatterChart;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
12
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
13
|
+
const _useScatterChartStylesstyles = require("./useScatterChartStyles.styles");
|
|
14
|
+
const _d3selection = require("d3-selection");
|
|
15
|
+
const _index = require("../Legends/index");
|
|
16
|
+
const _d3array = require("d3-array");
|
|
17
|
+
const _reactutilities = require("@fluentui/react-utilities");
|
|
18
|
+
const _index1 = require("../../utilities/index");
|
|
19
|
+
const _index2 = require("../../index");
|
|
20
|
+
const _reacttheme = require("@fluentui/react-theme");
|
|
21
|
+
const ScatterChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
|
|
22
|
+
const _circleId = (0, _reactutilities.useId)('circle');
|
|
23
|
+
const _seriesId = (0, _reactutilities.useId)('seriesID');
|
|
24
|
+
const _verticalLine = (0, _reactutilities.useId)('verticalLine');
|
|
25
|
+
const _tooltipId = (0, _reactutilities.useId)('ScatterChartTooltipId_');
|
|
26
|
+
const _firstRenderOptimization = true;
|
|
27
|
+
const _emptyChartId = (0, _reactutilities.useId)('_ScatterChart_empty');
|
|
28
|
+
let _points = _injectIndexPropertyInScatterChartData(props.data.lineChartData);
|
|
29
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
30
|
+
let _calloutPoints = (0, _index1.calloutData)(_points) || [];
|
|
31
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
32
|
+
let _xAxisScale = '';
|
|
33
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
34
|
+
let _yAxisScale = '';
|
|
35
|
+
let _uniqueCallOutID = '';
|
|
36
|
+
let _refArray = [];
|
|
37
|
+
let margins;
|
|
38
|
+
let renderSeries;
|
|
39
|
+
let _xAxisLabels = [];
|
|
40
|
+
let xAxisCalloutAccessibilityData = {};
|
|
41
|
+
let _xBandwidth = 0;
|
|
42
|
+
const cartesianChartRef = _react.useRef(null);
|
|
43
|
+
const [hoverXValue, setHoverXValue] = _react.useState('');
|
|
44
|
+
const [activeLegend, setActiveLegend] = _react.useState('');
|
|
45
|
+
const [YValueHover, setYValueHover] = _react.useState([]);
|
|
46
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
47
|
+
const [selectedLegendPoints, setSelectedLegendPoints] = _react.useState([]);
|
|
48
|
+
const [isSelectedLegend, setIsSelectedLegend] = _react.useState(false);
|
|
49
|
+
const [activePoint, setActivePoint] = _react.useState('');
|
|
50
|
+
const [stackCalloutProps, setStackCalloutProps] = _react.useState();
|
|
51
|
+
const [clickPosition, setClickPosition] = _react.useState({
|
|
52
|
+
x: 0,
|
|
53
|
+
y: 0
|
|
54
|
+
});
|
|
55
|
+
const [isPopoverOpen, setPopoverOpen] = _react.useState(false);
|
|
56
|
+
const [selectedLegends, setSelectedLegends] = _react.useState([]);
|
|
57
|
+
const prevPropsRef = _react.useRef(null);
|
|
58
|
+
_react.useEffect(()=>{
|
|
59
|
+
if (prevPropsRef.current) {
|
|
60
|
+
var _prevProps_legendProps, _props_legendProps;
|
|
61
|
+
const prevProps = prevPropsRef.current;
|
|
62
|
+
if (!(0, _index1.areArraysEqual)((_prevProps_legendProps = prevProps.legendProps) === null || _prevProps_legendProps === void 0 ? void 0 : _prevProps_legendProps.selectedLegends, (_props_legendProps = props.legendProps) === null || _props_legendProps === void 0 ? void 0 : _props_legendProps.selectedLegends)) {
|
|
63
|
+
var _props_legendProps1;
|
|
64
|
+
setSelectedLegends(((_props_legendProps1 = props.legendProps) === null || _props_legendProps1 === void 0 ? void 0 : _props_legendProps1.selectedLegends) || []);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
prevPropsRef.current = props;
|
|
68
|
+
}, [
|
|
69
|
+
props
|
|
70
|
+
]);
|
|
71
|
+
_react.useImperativeHandle(props.componentRef, ()=>{
|
|
72
|
+
var _cartesianChartRef_current;
|
|
73
|
+
var _cartesianChartRef_current_chartContainer;
|
|
74
|
+
return {
|
|
75
|
+
chartContainer: (_cartesianChartRef_current_chartContainer = (_cartesianChartRef_current = cartesianChartRef.current) === null || _cartesianChartRef_current === void 0 ? void 0 : _cartesianChartRef_current.chartContainer) !== null && _cartesianChartRef_current_chartContainer !== void 0 ? _cartesianChartRef_current_chartContainer : null
|
|
76
|
+
};
|
|
77
|
+
}, []);
|
|
78
|
+
const _xAxisType = props.data.lineChartData && props.data.lineChartData.length > 0 && props.data.lineChartData[0].data && props.data.lineChartData[0].data.length > 0 ? (0, _index1.getTypeOfAxis)(props.data.lineChartData[0].data[0].x, true) : _index1.XAxisTypes.StringAxis;
|
|
79
|
+
const pointsRef = _react.useRef([]);
|
|
80
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
81
|
+
const calloutPointsRef = _react.useRef([]);
|
|
82
|
+
_react.useEffect(()=>{
|
|
83
|
+
/** note that height and width are not used to resize or set as dimesions of the chart,
|
|
84
|
+
* fitParentContainer is responisble for setting the height and width or resizing of the svg/chart
|
|
85
|
+
*/ if (_points !== _injectIndexPropertyInScatterChartData(props.data.lineChartData) || props.data !== _points) {
|
|
86
|
+
pointsRef.current = _injectIndexPropertyInScatterChartData(props.data.lineChartData);
|
|
87
|
+
calloutPointsRef.current = (0, _index1.calloutData)(pointsRef.current);
|
|
88
|
+
}
|
|
89
|
+
}, [
|
|
90
|
+
props.height,
|
|
91
|
+
props.width,
|
|
92
|
+
props.data,
|
|
93
|
+
_points
|
|
94
|
+
]);
|
|
95
|
+
function _injectIndexPropertyInScatterChartData(scatterChartData) {
|
|
96
|
+
return scatterChartData ? scatterChartData.map((item, index)=>{
|
|
97
|
+
let color;
|
|
98
|
+
if (typeof item.color === 'undefined') {
|
|
99
|
+
color = (0, _index1.getNextColor)(index, 0);
|
|
100
|
+
} else {
|
|
101
|
+
color = (0, _index1.getColorFromToken)(item.color);
|
|
102
|
+
}
|
|
103
|
+
return {
|
|
104
|
+
...item,
|
|
105
|
+
index: -1,
|
|
106
|
+
color
|
|
107
|
+
};
|
|
108
|
+
}) : [];
|
|
109
|
+
}
|
|
110
|
+
function updatePosition(newX, newY) {
|
|
111
|
+
const threshold = 1; // Set a threshold for movement
|
|
112
|
+
const { x, y } = clickPosition;
|
|
113
|
+
// Calculate the distance moved
|
|
114
|
+
const distance = Math.sqrt(Math.pow(newX - x, 2) + Math.pow(newY - y, 2));
|
|
115
|
+
// Update the position only if the distance moved is greater than the threshold
|
|
116
|
+
if (distance > threshold) {
|
|
117
|
+
setClickPosition({
|
|
118
|
+
x: newX,
|
|
119
|
+
y: newY
|
|
120
|
+
});
|
|
121
|
+
setPopoverOpen(true);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
function _getMargins(_margins) {
|
|
125
|
+
margins = _margins;
|
|
126
|
+
}
|
|
127
|
+
function _initializeScatterChartData(xScale, yScale, containerHeight, containerWidth, xElement) {
|
|
128
|
+
_xAxisScale = xScale;
|
|
129
|
+
_yAxisScale = yScale;
|
|
130
|
+
renderSeries = _createPlot(xElement, containerHeight);
|
|
131
|
+
}
|
|
132
|
+
function _onHoverCardHide() {
|
|
133
|
+
setSelectedLegendPoints([]);
|
|
134
|
+
setIsSelectedLegend(false);
|
|
135
|
+
}
|
|
136
|
+
function _createLegends(data) {
|
|
137
|
+
const { legendProps } = props;
|
|
138
|
+
const isLegendMultiSelectEnabled = !!(legendProps && !!legendProps.canSelectMultipleLegends);
|
|
139
|
+
const legendDataItems = data.map((point)=>{
|
|
140
|
+
const color = point.color;
|
|
141
|
+
// mapping data to the format Legends component needs
|
|
142
|
+
const legend = {
|
|
143
|
+
title: point.legend,
|
|
144
|
+
color,
|
|
145
|
+
onMouseOutAction: ()=>{
|
|
146
|
+
setActiveLegend('');
|
|
147
|
+
},
|
|
148
|
+
hoverAction: ()=>{
|
|
149
|
+
_handleChartMouseLeave();
|
|
150
|
+
setActiveLegend(point.legend);
|
|
151
|
+
},
|
|
152
|
+
...point.legendShape && {
|
|
153
|
+
shape: point.legendShape
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
return legend;
|
|
157
|
+
});
|
|
158
|
+
return /*#__PURE__*/ _react.createElement(_index.Legends, {
|
|
159
|
+
legends: [
|
|
160
|
+
...legendDataItems
|
|
161
|
+
],
|
|
162
|
+
enabledWrapLines: props.enabledLegendsWrapLines,
|
|
163
|
+
overflowText: props.legendsOverflowText,
|
|
164
|
+
...isLegendMultiSelectEnabled && {
|
|
165
|
+
onLegendHoverCardLeave: _onHoverCardHide
|
|
166
|
+
},
|
|
167
|
+
...props.legendProps,
|
|
168
|
+
selectedLegends: selectedLegends,
|
|
169
|
+
onChange: _onLegendSelectionChange
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
function _onLegendSelectionChange(legendsSelected, event, currentLegend) {
|
|
173
|
+
var _props_legendProps, _props_legendProps1;
|
|
174
|
+
if ((_props_legendProps = props.legendProps) === null || _props_legendProps === void 0 ? void 0 : _props_legendProps.canSelectMultipleLegends) {
|
|
175
|
+
setSelectedLegends(legendsSelected);
|
|
176
|
+
} else {
|
|
177
|
+
setSelectedLegends(legendsSelected.slice(-1));
|
|
178
|
+
}
|
|
179
|
+
if ((_props_legendProps1 = props.legendProps) === null || _props_legendProps1 === void 0 ? void 0 : _props_legendProps1.onChange) {
|
|
180
|
+
props.legendProps.onChange(legendsSelected, event, currentLegend);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
function _getPointFill(seriesColor, pointId, pointIndex, isLastPoint) {
|
|
184
|
+
if (activePoint === pointId) {
|
|
185
|
+
return _reacttheme.tokens.colorNeutralBackground1;
|
|
186
|
+
} else {
|
|
187
|
+
return seriesColor;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
function _createPlot(xElement, containerHeight) {
|
|
191
|
+
const series = [];
|
|
192
|
+
if (isSelectedLegend) {
|
|
193
|
+
_points = selectedLegendPoints;
|
|
194
|
+
} else {
|
|
195
|
+
_points = _injectIndexPropertyInScatterChartData(props.data.lineChartData);
|
|
196
|
+
}
|
|
197
|
+
const yMax = (0, _d3array.max)(points, (point)=>{
|
|
198
|
+
return (0, _d3array.max)(point.data, (item)=>item.y);
|
|
199
|
+
});
|
|
200
|
+
const yMin = (0, _d3array.min)(points, (point)=>{
|
|
201
|
+
return (0, _d3array.min)(point.data, (item)=>item.y);
|
|
202
|
+
});
|
|
203
|
+
const yPadding = (yMax - yMin) * 0.1;
|
|
204
|
+
const yPaddingRange = Math.abs(_yAxisScale(yMin + yPadding) - _yAxisScale(yMin));
|
|
205
|
+
let maxMarkerRange = 40;
|
|
206
|
+
let xPaddingRange = 0;
|
|
207
|
+
if (_xAxisType === _index1.XAxisTypes.StringAxis) {
|
|
208
|
+
_xBandwidth = _xAxisScale.bandwidth() / 2;
|
|
209
|
+
xPaddingRange = _xBandwidth;
|
|
210
|
+
} else if (_xAxisType === _index1.XAxisTypes.DateAxis) {
|
|
211
|
+
const xMin = (0, _d3array.min)(points, (point)=>{
|
|
212
|
+
return (0, _d3array.min)(point.data, (item)=>item.x);
|
|
213
|
+
});
|
|
214
|
+
const xMax = (0, _d3array.max)(points, (point)=>{
|
|
215
|
+
return (0, _d3array.max)(point.data, (item)=>{
|
|
216
|
+
return item.x;
|
|
217
|
+
});
|
|
218
|
+
});
|
|
219
|
+
const xPadding = (xMax.getTime() - xMin.getTime()) * 0.1;
|
|
220
|
+
xPaddingRange = Math.abs(_xAxisScale(new Date(xMin.getTime() + xPadding)) - _xAxisScale(xMin));
|
|
221
|
+
} else {
|
|
222
|
+
const xMin = (0, _d3array.min)(points, (point)=>{
|
|
223
|
+
return (0, _d3array.min)(point.data, (item)=>item.x);
|
|
224
|
+
});
|
|
225
|
+
const xMax = (0, _d3array.max)(points, (point)=>{
|
|
226
|
+
return (0, _d3array.max)(point.data, (item)=>{
|
|
227
|
+
return item.x;
|
|
228
|
+
});
|
|
229
|
+
});
|
|
230
|
+
const xPadding = (xMax - xMin) * 0.1;
|
|
231
|
+
xPaddingRange = Math.abs(_xAxisScale(xMin + xPadding) - _xAxisScale(xMin));
|
|
232
|
+
}
|
|
233
|
+
maxMarkerRange = Math.min(maxMarkerRange, Math.min(xPaddingRange, yPaddingRange));
|
|
234
|
+
const maxMarkerSize = (0, _d3array.max)(_points, (point)=>{
|
|
235
|
+
return (0, _d3array.max)(point.data, (item)=>{
|
|
236
|
+
return item.markerSize;
|
|
237
|
+
});
|
|
238
|
+
});
|
|
239
|
+
for(let i = _points.length - 1; i >= 0; i--){
|
|
240
|
+
const pointsForSeries = [];
|
|
241
|
+
const legendVal = _points[i].legend;
|
|
242
|
+
const seriesColor = _points[i].color;
|
|
243
|
+
const verticaLineHeight = containerHeight - margins.bottom + 6;
|
|
244
|
+
for(let j = 0; j < _points[i].data.length; j++){
|
|
245
|
+
const seriesId = `${_seriesId}_${i}_${j}`;
|
|
246
|
+
const circleId = `${_circleId}_${i}_${j}`;
|
|
247
|
+
const { x, y, xAxisCalloutData, xAxisCalloutAccessibilityData } = _points[i].data[j];
|
|
248
|
+
let circleRadius = 3.5;
|
|
249
|
+
const pointMarkerSize = _points[i].data[j].markerSize;
|
|
250
|
+
if (pointMarkerSize !== undefined) {
|
|
251
|
+
circleRadius = Math.min(pointMarkerSize * maxMarkerRange / maxMarkerSize, pointMarkerSize);
|
|
252
|
+
}
|
|
253
|
+
const isLegendSelected = _legendHighlighted(legendVal) || _noLegendHighlighted() || isSelectedLegend;
|
|
254
|
+
const currentPointHidden = _points[i].hideNonActiveDots && activePoint !== circleId;
|
|
255
|
+
pointsForSeries.push(/*#__PURE__*/ _react.createElement("circle", {
|
|
256
|
+
id: circleId,
|
|
257
|
+
key: circleId,
|
|
258
|
+
r: circleRadius,
|
|
259
|
+
cx: _xAxisScale(x) + _xBandwidth,
|
|
260
|
+
cy: _yAxisScale(y),
|
|
261
|
+
"data-is-focusable": isLegendSelected,
|
|
262
|
+
onMouseOver: (event)=>_handleHover(x, y, verticaLineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData, event),
|
|
263
|
+
onMouseMove: (event)=>_handleHover(x, y, verticaLineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData, event),
|
|
264
|
+
onMouseOut: _handleMouseOut,
|
|
265
|
+
onFocus: ()=>_handleFocus(seriesId, x, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData),
|
|
266
|
+
onBlur: _handleMouseOut,
|
|
267
|
+
..._getClickHandler(_points[i].data[j].onDataPointClick),
|
|
268
|
+
opacity: isLegendSelected && !currentPointHidden ? 1 : 0.1,
|
|
269
|
+
fill: _getPointFill(seriesColor, circleId, j, false),
|
|
270
|
+
stroke: seriesColor,
|
|
271
|
+
role: "img",
|
|
272
|
+
"aria-label": _getAriaLabel(i, j),
|
|
273
|
+
tabIndex: _points[i].legend !== '' ? 0 : undefined
|
|
274
|
+
}));
|
|
275
|
+
}
|
|
276
|
+
series.push(/*#__PURE__*/ _react.createElement("g", {
|
|
277
|
+
key: `series_${i}`,
|
|
278
|
+
role: "region",
|
|
279
|
+
"aria-label": `${legendVal}, series ${i + 1} of ${_points.length} with ${_points[i].data.length} data points.`
|
|
280
|
+
}, pointsForSeries));
|
|
281
|
+
}
|
|
282
|
+
const classes = (0, _useScatterChartStylesstyles.useScatterChartStyles_unstable)(props);
|
|
283
|
+
// Removing un wanted tooltip div from DOM, when prop not provided.
|
|
284
|
+
if (!props.showXAxisLablesTooltip) {
|
|
285
|
+
try {
|
|
286
|
+
document.getElementById(_tooltipId) && document.getElementById(_tooltipId).remove();
|
|
287
|
+
// eslint-disable-next-line no-empty
|
|
288
|
+
} catch (e) {}
|
|
289
|
+
}
|
|
290
|
+
// Used to display tooltip at x axis labels.
|
|
291
|
+
if (!props.wrapXAxisLables && props.showXAxisLablesTooltip) {
|
|
292
|
+
const xAxisElement = (0, _d3selection.select)(xElement).call(_xAxisScale);
|
|
293
|
+
try {
|
|
294
|
+
document.getElementById(_tooltipId) && document.getElementById(_tooltipId).remove();
|
|
295
|
+
// eslint-disable-next-line no-empty
|
|
296
|
+
} catch (e) {}
|
|
297
|
+
const tooltipProps = {
|
|
298
|
+
tooltipCls: classes.tooltip,
|
|
299
|
+
id: _tooltipId,
|
|
300
|
+
xAxis: xAxisElement
|
|
301
|
+
};
|
|
302
|
+
xAxisElement && (0, _index1.tooltipOfXAxislabels)(tooltipProps);
|
|
303
|
+
}
|
|
304
|
+
return series;
|
|
305
|
+
}
|
|
306
|
+
function _handleFocus(seriesId, x, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData) {
|
|
307
|
+
_uniqueCallOutID = circleId;
|
|
308
|
+
const formattedData = x instanceof Date ? (0, _index1.formatDate)(x, props.useUTC) : x;
|
|
309
|
+
const xVal = x instanceof Date ? x.getTime() : x;
|
|
310
|
+
const found = (0, _index1.find)(_calloutPoints, (element)=>element.x === xVal);
|
|
311
|
+
// if no points need to be called out then don't show vertical line and callout card
|
|
312
|
+
if (found) {
|
|
313
|
+
(0, _d3selection.select)(`#${_verticalLine}`).attr('transform', ()=>`translate(${_xAxisScale(x) + _xBandwidth}, 0)`).attr('visibility', 'visibility');
|
|
314
|
+
_refArray.forEach((obj)=>{
|
|
315
|
+
if (obj.index === seriesId) {
|
|
316
|
+
setPopoverOpen(true);
|
|
317
|
+
xAxisCalloutData ? setHoverXValue(xAxisCalloutData) : setHoverXValue('' + formattedData);
|
|
318
|
+
setYValueHover(found.values);
|
|
319
|
+
setStackCalloutProps(found);
|
|
320
|
+
setActivePoint(circleId);
|
|
321
|
+
}
|
|
322
|
+
});
|
|
323
|
+
} else {
|
|
324
|
+
setActivePoint(circleId);
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
function _handleHover(x, y, lineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData, mouseEvent) {
|
|
328
|
+
mouseEvent === null || mouseEvent === void 0 ? void 0 : mouseEvent.persist();
|
|
329
|
+
const formattedData = x instanceof Date ? (0, _index1.formatDate)(x, props.useUTC) : x;
|
|
330
|
+
const xVal = x instanceof Date ? x.getTime() : x;
|
|
331
|
+
const found = (0, _index1.find)(_calloutPoints, (element)=>element.x === xVal);
|
|
332
|
+
// if no points need to be called out then don't show vertical line and callout card
|
|
333
|
+
if (found) {
|
|
334
|
+
(0, _d3selection.select)(`#${_verticalLine}`).attr('transform', ()=>`translate(${_xAxisScale(x) + _xBandwidth}, ${_yAxisScale(y)})`).attr('visibility', 'visibility').attr('y2', `${lineHeight - _yAxisScale(y)}`);
|
|
335
|
+
if (_uniqueCallOutID !== circleId) {
|
|
336
|
+
_uniqueCallOutID = circleId;
|
|
337
|
+
updatePosition(mouseEvent.clientX, mouseEvent.clientY);
|
|
338
|
+
xAxisCalloutData ? setHoverXValue(xAxisCalloutData) : setHoverXValue('' + formattedData);
|
|
339
|
+
setYValueHover(found.values);
|
|
340
|
+
setStackCalloutProps(found);
|
|
341
|
+
setActivePoint(circleId);
|
|
342
|
+
}
|
|
343
|
+
} else {
|
|
344
|
+
setActivePoint(circleId);
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
/**
|
|
348
|
+
* Screen readers announce an element as clickable if the onClick attribute is set.
|
|
349
|
+
* This function sets the attribute only when a click event handler is provided.*/ function _getClickHandler(func) {
|
|
350
|
+
if (func) {
|
|
351
|
+
return {
|
|
352
|
+
onClick: func
|
|
353
|
+
};
|
|
354
|
+
}
|
|
355
|
+
return {};
|
|
356
|
+
}
|
|
357
|
+
function _handleMouseOut() {
|
|
358
|
+
(0, _d3selection.select)(`#${_verticalLine}`).attr('visibility', 'hidden');
|
|
359
|
+
}
|
|
360
|
+
function _handleChartMouseLeave() {
|
|
361
|
+
_uniqueCallOutID = null;
|
|
362
|
+
setActivePoint('');
|
|
363
|
+
if (isPopoverOpen) {
|
|
364
|
+
setPopoverOpen(false);
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
/**
|
|
368
|
+
* This function checks if the given legend is highlighted or not.
|
|
369
|
+
* A legend can be highlighted in 2 ways:
|
|
370
|
+
* 1. selection: if the user clicks on it
|
|
371
|
+
* 2. hovering: if there is no selected legend and the user hovers over it*/ function _legendHighlighted(legend) {
|
|
372
|
+
return _getHighlightedLegend().includes(legend);
|
|
373
|
+
}
|
|
374
|
+
/**
|
|
375
|
+
* This function checks if none of the legends is selected or hovered.*/ function _noLegendHighlighted() {
|
|
376
|
+
return selectedLegends.length === 0;
|
|
377
|
+
}
|
|
378
|
+
function _getHighlightedLegend() {
|
|
379
|
+
return selectedLegends.length > 0 ? selectedLegends : activeLegend ? [
|
|
380
|
+
activeLegend
|
|
381
|
+
] : [];
|
|
382
|
+
}
|
|
383
|
+
function _getAriaLabel(seriesIndex, pointIndex) {
|
|
384
|
+
var _point_callOutAccessibilityData;
|
|
385
|
+
const series = _points[seriesIndex];
|
|
386
|
+
const point = series.data[pointIndex];
|
|
387
|
+
const formattedDate = point.x instanceof Date ? (0, _index1.formatDate)(point.x, props.useUTC) : point.x;
|
|
388
|
+
const xValue = point.xAxisCalloutData || formattedDate;
|
|
389
|
+
const legend = series.legend;
|
|
390
|
+
const yValue = point.yAxisCalloutData || point.y;
|
|
391
|
+
return ((_point_callOutAccessibilityData = point.callOutAccessibilityData) === null || _point_callOutAccessibilityData === void 0 ? void 0 : _point_callOutAccessibilityData.ariaLabel) || `${xValue}. ${legend}, ${yValue}.`;
|
|
392
|
+
}
|
|
393
|
+
function _isChartEmpty() {
|
|
394
|
+
return !(props.data && props.data.lineChartData && props.data.lineChartData.length > 0 && props.data.lineChartData.filter((item)=>item.data.length).length > 0);
|
|
395
|
+
}
|
|
396
|
+
const { legendProps, tickValues, tickFormat } = props;
|
|
397
|
+
_points = _injectIndexPropertyInScatterChartData(props.data.lineChartData);
|
|
398
|
+
let points = _points;
|
|
399
|
+
if (legendProps && !!legendProps.canSelectMultipleLegends) {
|
|
400
|
+
points = selectedLegendPoints.length >= 1 ? selectedLegendPoints : _points;
|
|
401
|
+
_calloutPoints = (0, _index1.calloutData)(points);
|
|
402
|
+
}
|
|
403
|
+
let legendBars = null;
|
|
404
|
+
// reduce computation cost by only creating legendBars
|
|
405
|
+
// if when hideLegend is false.
|
|
406
|
+
// NOTE: they are rendered only when hideLegend is false in CartesianChart.
|
|
407
|
+
if (!props.hideLegend) {
|
|
408
|
+
legendBars = _createLegends(_points); // ToDo: Memoize legends to improve performance.
|
|
409
|
+
}
|
|
410
|
+
var _props_culture;
|
|
411
|
+
const calloutProps = {
|
|
412
|
+
YValueHover,
|
|
413
|
+
hoverXValue,
|
|
414
|
+
descriptionMessage: props.getCalloutDescriptionMessage && stackCalloutProps ? props.getCalloutDescriptionMessage(stackCalloutProps) : undefined,
|
|
415
|
+
'data-is-focusable': true,
|
|
416
|
+
xAxisCalloutAccessibilityData,
|
|
417
|
+
...props.calloutProps,
|
|
418
|
+
clickPosition,
|
|
419
|
+
isPopoverOpen,
|
|
420
|
+
isCalloutForStack: true,
|
|
421
|
+
culture: (_props_culture = props.culture) !== null && _props_culture !== void 0 ? _props_culture : 'en-us',
|
|
422
|
+
isCartesian: true
|
|
423
|
+
};
|
|
424
|
+
const tickParams = {
|
|
425
|
+
tickValues,
|
|
426
|
+
tickFormat
|
|
427
|
+
};
|
|
428
|
+
const xAxisLabels = _points.map((point)=>point.data.map((dp)=>dp.x)).flat();
|
|
429
|
+
_xAxisLabels = [
|
|
430
|
+
...new Set(xAxisLabels)
|
|
431
|
+
];
|
|
432
|
+
return !_isChartEmpty() ? /*#__PURE__*/ _react.createElement(_index2.CartesianChart, {
|
|
433
|
+
...props,
|
|
434
|
+
chartTitle: props.data.chartTitle,
|
|
435
|
+
points: points,
|
|
436
|
+
chartType: _index1.ChartTypes.ScatterChart,
|
|
437
|
+
calloutProps: calloutProps,
|
|
438
|
+
tickParams: tickParams,
|
|
439
|
+
legendBars: legendBars,
|
|
440
|
+
getmargins: _getMargins,
|
|
441
|
+
getGraphData: _initializeScatterChartData,
|
|
442
|
+
xAxisType: _xAxisType,
|
|
443
|
+
onChartMouseLeave: _handleChartMouseLeave,
|
|
444
|
+
enableFirstRenderOptimization: _firstRenderOptimization,
|
|
445
|
+
datasetForXAxisDomain: _xAxisLabels,
|
|
446
|
+
componentRef: cartesianChartRef,
|
|
447
|
+
/* eslint-disable react/jsx-no-bind */ // eslint-disable-next-line react/no-children-prop
|
|
448
|
+
children: (props)=>{
|
|
449
|
+
_xAxisScale = props.xScale;
|
|
450
|
+
_yAxisScale = props.yScale;
|
|
451
|
+
return /*#__PURE__*/ _react.createElement(_react.Fragment, null, /*#__PURE__*/ _react.createElement("g", null, /*#__PURE__*/ _react.createElement("line", {
|
|
452
|
+
x1: 0,
|
|
453
|
+
y1: 0,
|
|
454
|
+
x2: 0,
|
|
455
|
+
y2: props.containerHeight,
|
|
456
|
+
stroke: '#323130',
|
|
457
|
+
id: _verticalLine,
|
|
458
|
+
visibility: 'hidden',
|
|
459
|
+
strokeDasharray: '5,5'
|
|
460
|
+
}), /*#__PURE__*/ _react.createElement("g", null, renderSeries)));
|
|
461
|
+
}
|
|
462
|
+
}) : /*#__PURE__*/ _react.createElement("div", {
|
|
463
|
+
id: _emptyChartId,
|
|
464
|
+
role: 'alert',
|
|
465
|
+
style: {
|
|
466
|
+
opacity: '0'
|
|
467
|
+
},
|
|
468
|
+
"aria-label": 'Graph has no data to display'
|
|
469
|
+
});
|
|
470
|
+
});
|
|
471
|
+
ScatterChart.displayName = 'ScatterChart';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["ScatterChart.tsx"],"sourcesContent":["import * as React from 'react';\nimport { ScatterChartProps } from './ScatterChart.types';\nimport { useScatterChartStyles_unstable } from './useScatterChartStyles.styles';\nimport { Axis as D3Axis } from 'd3-axis';\nimport { select as d3Select } from 'd3-selection';\nimport { Legend, Legends } from '../Legends/index';\nimport { max as d3Max, min as d3Min } from 'd3-array';\nimport { useId } from '@fluentui/react-utilities';\nimport { areArraysEqual, find } from '../../utilities/index';\nimport {\n AccessibilityProps,\n CartesianChart,\n ChildProps,\n LineChartPoints,\n CustomizedCalloutData,\n Margins,\n RefArrayData,\n ScatterChartDataPoint,\n Chart,\n} from '../../index';\nimport { tokens } from '@fluentui/react-theme';\nimport {\n calloutData,\n ChartTypes,\n XAxisTypes,\n tooltipOfXAxislabels,\n getTypeOfAxis,\n getNextColor,\n getColorFromToken,\n formatDate,\n} from '../../utilities/index';\n\ntype NumericAxis = D3Axis<number | { valueOf(): number }>;\n\ntype ScatterChartDataWithIndex = LineChartPoints & { index: number };\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 ScatterChart: React.FunctionComponent<ScatterChartProps> = React.forwardRef<\n HTMLDivElement,\n ScatterChartProps\n>((props, forwardedRef) => {\n const _circleId: string = useId('circle');\n const _seriesId: string = useId('seriesID');\n const _verticalLine: string = useId('verticalLine');\n const _tooltipId: string = useId('ScatterChartTooltipId_');\n const _firstRenderOptimization = true;\n const _emptyChartId: string = useId('_ScatterChart_empty');\n let _points: ScatterChartDataWithIndex[] = _injectIndexPropertyInScatterChartData(props.data.lineChartData);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let _calloutPoints: any[] = calloutData(_points) || [];\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let _xAxisScale: any = '';\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let _yAxisScale: any = '';\n let _uniqueCallOutID: string | null = '';\n let _refArray: RefArrayData[] = [];\n let margins: Margins;\n let renderSeries: JSX.Element[];\n let _xAxisLabels: string[] = [];\n let xAxisCalloutAccessibilityData: AccessibilityProps = {};\n let _xBandwidth = 0;\n const cartesianChartRef = React.useRef<Chart>(null);\n\n const [hoverXValue, setHoverXValue] = React.useState<string | number>('');\n const [activeLegend, setActiveLegend] = React.useState<string>('');\n const [YValueHover, setYValueHover] = React.useState<[]>([]);\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<CustomizedCalloutData>();\n const [clickPosition, setClickPosition] = React.useState({ x: 0, y: 0 });\n const [isPopoverOpen, setPopoverOpen] = React.useState(false);\n const [selectedLegends, setSelectedLegends] = React.useState<string[]>([]);\n const prevPropsRef = React.useRef<ScatterChartProps | null>(null);\n\n React.useEffect(() => {\n if (prevPropsRef.current) {\n const prevProps = prevPropsRef.current;\n if (!areArraysEqual(prevProps.legendProps?.selectedLegends, props.legendProps?.selectedLegends)) {\n setSelectedLegends(props.legendProps?.selectedLegends || []);\n }\n }\n prevPropsRef.current = props;\n }, [props]);\n\n React.useImperativeHandle(\n props.componentRef,\n () => ({\n chartContainer: cartesianChartRef.current?.chartContainer ?? null,\n }),\n [],\n );\n\n const _xAxisType: XAxisTypes =\n props.data.lineChartData! &&\n props.data.lineChartData!.length > 0 &&\n props.data.lineChartData![0].data &&\n props.data.lineChartData![0].data.length > 0\n ? (getTypeOfAxis(props.data.lineChartData![0].data[0].x, true) as XAxisTypes)\n : XAxisTypes.StringAxis;\n\n const pointsRef = React.useRef<ScatterChartDataWithIndex[] | []>([]);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const calloutPointsRef = React.useRef<any[]>([]);\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 (_points !== _injectIndexPropertyInScatterChartData(props.data.lineChartData) || props.data !== _points) {\n pointsRef.current = _injectIndexPropertyInScatterChartData(props.data.lineChartData);\n calloutPointsRef.current = calloutData(pointsRef.current);\n }\n }, [props.height, props.width, props.data, _points]);\n\n function _injectIndexPropertyInScatterChartData(\n scatterChartData?: LineChartPoints[],\n ): ScatterChartDataWithIndex[] | [] {\n return scatterChartData\n ? scatterChartData.map((item: LineChartPoints, 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 function updatePosition(newX: number, newY: number) {\n const threshold = 1; // Set a threshold for movement\n const { x, y } = clickPosition;\n // Calculate the distance moved\n const distance = Math.sqrt(Math.pow(newX - x, 2) + Math.pow(newY - y, 2));\n // Update the position only if the distance moved is greater than the threshold\n if (distance > threshold) {\n setClickPosition({ x: newX, y: newY });\n setPopoverOpen(true);\n }\n }\n\n function _getMargins(_margins: Margins) {\n margins = _margins;\n }\n\n function _initializeScatterChartData(\n xScale: NumericAxis,\n yScale: NumericAxis,\n containerHeight: number,\n containerWidth: number,\n xElement: SVGElement | null,\n ) {\n _xAxisScale = xScale;\n _yAxisScale = yScale;\n renderSeries = _createPlot(xElement!, containerHeight!);\n }\n\n function _onHoverCardHide() {\n setSelectedLegendPoints([]);\n setIsSelectedLegend(false);\n }\n\n function _createLegends(data: ScatterChartDataWithIndex[]): JSX.Element {\n const { legendProps } = props;\n const isLegendMultiSelectEnabled = !!(legendProps && !!legendProps.canSelectMultipleLegends);\n const legendDataItems = data.map((point: ScatterChartDataWithIndex) => {\n const color: string = point.color!;\n // mapping data to the format Legends component needs\n const legend: Legend = {\n title: point.legend!,\n color,\n onMouseOutAction: () => {\n setActiveLegend('');\n },\n hoverAction: () => {\n _handleChartMouseLeave();\n setActiveLegend(point.legend);\n },\n ...(point.legendShape && {\n shape: point.legendShape,\n }),\n };\n return legend;\n });\n\n return (\n <Legends\n legends={[...legendDataItems]}\n enabledWrapLines={props.enabledLegendsWrapLines}\n overflowText={props.legendsOverflowText}\n {...(isLegendMultiSelectEnabled && { onLegendHoverCardLeave: _onHoverCardHide })}\n {...props.legendProps}\n selectedLegends={selectedLegends}\n onChange={_onLegendSelectionChange}\n />\n );\n }\n\n function _onLegendSelectionChange(\n legendsSelected: string[],\n event: React.MouseEvent<HTMLButtonElement>,\n currentLegend?: Legend,\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 function _getPointFill(seriesColor: string, pointId: string, pointIndex: number, isLastPoint: boolean) {\n if (activePoint === pointId) {\n return tokens.colorNeutralBackground1;\n } else {\n return seriesColor;\n }\n }\n\n function _createPlot(xElement: SVGElement, containerHeight: number): JSX.Element[] {\n const series: JSX.Element[] = [];\n if (isSelectedLegend) {\n _points = selectedLegendPoints;\n } else {\n _points = _injectIndexPropertyInScatterChartData(props.data.lineChartData);\n }\n\n const yMax = d3Max(points, (point: LineChartPoints) => {\n return d3Max(point.data as ScatterChartDataPoint[], (item: ScatterChartDataPoint) => item.y)!;\n })!;\n const yMin = d3Min(points, (point: LineChartPoints) => {\n return d3Min(point.data as ScatterChartDataPoint[], (item: ScatterChartDataPoint) => item.y)!;\n })!;\n const yPadding = (yMax - yMin) * 0.1;\n const yPaddingRange = Math.abs(_yAxisScale(yMin + yPadding) - _yAxisScale(yMin));\n\n let maxMarkerRange = 40;\n let xPaddingRange = 0;\n if (_xAxisType === XAxisTypes.StringAxis) {\n _xBandwidth = _xAxisScale.bandwidth() / 2;\n xPaddingRange = _xBandwidth;\n } else if (_xAxisType === XAxisTypes.DateAxis) {\n const xMin = d3Min(points, (point: LineChartPoints) => {\n return d3Min(point.data as ScatterChartDataPoint[], (item: ScatterChartDataPoint) => item.x as Date)!;\n })!;\n\n const xMax = d3Max(points, (point: LineChartPoints) => {\n return d3Max(point.data as ScatterChartDataPoint[], (item: ScatterChartDataPoint) => {\n return item.x as Date;\n });\n })!;\n\n const xPadding = (xMax.getTime() - xMin.getTime()) * 0.1;\n xPaddingRange = Math.abs(_xAxisScale(new Date(xMin.getTime() + xPadding)) - _xAxisScale(xMin));\n } else {\n const xMin = d3Min(points, (point: LineChartPoints) => {\n return d3Min(point.data as ScatterChartDataPoint[], (item: ScatterChartDataPoint) => item.x as number)!;\n })!;\n\n const xMax = d3Max(points, (point: LineChartPoints) => {\n return d3Max(point.data as ScatterChartDataPoint[], (item: ScatterChartDataPoint) => {\n return item.x as number;\n });\n })!;\n\n const xPadding = (xMax - xMin) * 0.1;\n xPaddingRange = Math.abs(_xAxisScale(xMin + xPadding) - _xAxisScale(xMin));\n }\n maxMarkerRange = Math.min(maxMarkerRange, Math.min(xPaddingRange, yPaddingRange));\n\n const maxMarkerSize = d3Max(_points, (point: LineChartPoints) => {\n return d3Max(point.data as ScatterChartDataPoint[], (item: ScatterChartDataPoint) => {\n return item.markerSize as number;\n });\n })!;\n\n for (let i = _points.length - 1; i >= 0; i--) {\n const pointsForSeries: JSX.Element[] = [];\n\n const legendVal: string = _points[i].legend;\n const seriesColor: string = _points[i].color!;\n const verticaLineHeight = containerHeight - margins.bottom! + 6;\n\n for (let j = 0; j < _points[i].data.length; j++) {\n const seriesId = `${_seriesId}_${i}_${j}`;\n const circleId = `${_circleId}_${i}_${j}`;\n const { x, y, xAxisCalloutData, xAxisCalloutAccessibilityData } = _points[i].data[j];\n let circleRadius = 3.5;\n const pointMarkerSize = (_points[i].data[j] as ScatterChartDataPoint).markerSize;\n if ((pointMarkerSize as number) !== undefined) {\n circleRadius = Math.min((pointMarkerSize! * maxMarkerRange) / maxMarkerSize, pointMarkerSize!);\n }\n\n const isLegendSelected: boolean = _legendHighlighted(legendVal) || _noLegendHighlighted() || isSelectedLegend;\n\n const currentPointHidden = _points[i].hideNonActiveDots && activePoint !== circleId;\n pointsForSeries.push(\n <circle\n id={circleId}\n key={circleId}\n r={circleRadius}\n cx={_xAxisScale(x) + _xBandwidth}\n cy={_yAxisScale(y)}\n data-is-focusable={isLegendSelected}\n onMouseOver={(event: React.MouseEvent<SVGElement>) =>\n _handleHover(x, y, verticaLineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData, event)\n }\n onMouseMove={(event: React.MouseEvent<SVGElement>) =>\n _handleHover(x, y, verticaLineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData, event)\n }\n onMouseOut={_handleMouseOut}\n onFocus={() => _handleFocus(seriesId, x, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData)}\n onBlur={_handleMouseOut}\n {..._getClickHandler(_points[i].data[j].onDataPointClick)}\n opacity={isLegendSelected && !currentPointHidden ? 1 : 0.1}\n fill={_getPointFill(seriesColor, circleId, j, false)}\n stroke={seriesColor}\n role=\"img\"\n aria-label={_getAriaLabel(i, j)}\n tabIndex={_points[i].legend !== '' ? 0 : undefined}\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.length} with ${_points[i].data.length} data points.`}\n >\n {pointsForSeries}\n </g>,\n );\n }\n const classes = useScatterChartStyles_unstable(props);\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);\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: classes.tooltip!,\n id: _tooltipId,\n xAxis: xAxisElement,\n };\n xAxisElement && tooltipOfXAxislabels(tooltipProps);\n }\n return series;\n }\n\n function _handleFocus(\n seriesId: string,\n x: number | Date | string,\n\n xAxisCalloutData: string | undefined,\n circleId: string,\n xAxisCalloutAccessibilityData?: AccessibilityProps,\n ) {\n _uniqueCallOutID = circleId;\n const formattedData = x instanceof Date ? formatDate(x, props.useUTC) : x;\n const xVal = x instanceof Date ? x.getTime() : x;\n const found = find(_calloutPoints, (element: { x: string | number }) => element.x === xVal);\n // if no points need to be called out then don't show vertical line and callout card\n\n if (found) {\n d3Select(`#${_verticalLine}`)\n .attr('transform', () => `translate(${_xAxisScale(x) + _xBandwidth}, 0)`)\n .attr('visibility', 'visibility');\n _refArray.forEach((obj: RefArrayData) => {\n if (obj.index === seriesId) {\n setPopoverOpen(true);\n xAxisCalloutData ? setHoverXValue(xAxisCalloutData) : setHoverXValue('' + formattedData);\n setYValueHover(found.values);\n setStackCalloutProps(found!);\n setActivePoint(circleId);\n }\n });\n } else {\n setActivePoint(circleId);\n }\n }\n\n function _handleHover(\n x: number | Date | string,\n y: number | Date,\n lineHeight: number,\n xAxisCalloutData: string | undefined,\n circleId: string,\n xAxisCalloutAccessibilityData: AccessibilityProps | undefined,\n mouseEvent: React.MouseEvent<SVGElement>,\n ) {\n mouseEvent?.persist();\n const formattedData = x instanceof Date ? formatDate(x, props.useUTC) : x;\n const xVal = x instanceof Date ? x.getTime() : x;\n const found = find(_calloutPoints, (element: { x: string | number }) => element.x === xVal);\n // if no points need to be called out then don't show vertical line and callout card\n\n if (found) {\n d3Select(`#${_verticalLine}`)\n .attr('transform', () => `translate(${_xAxisScale(x) + _xBandwidth}, ${_yAxisScale(y)})`)\n .attr('visibility', 'visibility')\n .attr('y2', `${lineHeight - _yAxisScale(y)}`);\n\n if (_uniqueCallOutID !== circleId) {\n _uniqueCallOutID = circleId;\n updatePosition(mouseEvent.clientX, mouseEvent.clientY);\n xAxisCalloutData ? setHoverXValue(xAxisCalloutData) : setHoverXValue('' + formattedData);\n setYValueHover(found.values);\n setStackCalloutProps(found!);\n setActivePoint(circleId);\n }\n } else {\n setActivePoint(circleId);\n }\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 _handleMouseOut() {\n d3Select(`#${_verticalLine}`).attr('visibility', 'hidden');\n }\n\n function _handleChartMouseLeave() {\n _uniqueCallOutID = null;\n setActivePoint('');\n if (isPopoverOpen) {\n setPopoverOpen(false);\n }\n }\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 function _legendHighlighted(legend: string): boolean {\n return _getHighlightedLegend().includes(legend);\n }\n\n /**\n * This function checks if none of the legends is selected or hovered.*/\n\n function _noLegendHighlighted(): boolean {\n return selectedLegends.length === 0;\n }\n\n function _getHighlightedLegend(): string[] {\n return selectedLegends.length > 0 ? selectedLegends : activeLegend ? [activeLegend] : [];\n }\n\n function _getAriaLabel(seriesIndex: number, pointIndex: number): string {\n const series = _points[seriesIndex];\n const point = series.data[pointIndex];\n const formattedDate = point.x instanceof Date ? formatDate(point.x, 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\n function _isChartEmpty(): boolean {\n return !(\n props.data &&\n props.data.lineChartData &&\n props.data.lineChartData.length > 0 &&\n props.data.lineChartData.filter((item: LineChartPoints) => item.data.length).length > 0\n );\n }\n\n const { legendProps, tickValues, tickFormat } = props;\n _points = _injectIndexPropertyInScatterChartData(props.data.lineChartData);\n\n let points = _points;\n if (legendProps && !!legendProps.canSelectMultipleLegends) {\n points = selectedLegendPoints.length >= 1 ? selectedLegendPoints : _points;\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) {\n legendBars = _createLegends(_points!); // ToDo: Memoize legends to improve performance.\n }\n const calloutProps = {\n YValueHover,\n hoverXValue,\n descriptionMessage:\n props.getCalloutDescriptionMessage && stackCalloutProps\n ? props.getCalloutDescriptionMessage(stackCalloutProps)\n : undefined,\n 'data-is-focusable': true,\n xAxisCalloutAccessibilityData,\n ...props.calloutProps,\n clickPosition,\n isPopoverOpen,\n isCalloutForStack: true,\n culture: props.culture ?? 'en-us',\n isCartesian: true,\n };\n const tickParams = {\n tickValues,\n tickFormat,\n };\n\n const xAxisLabels: string[] = _points\n .map((point: ScatterChartDataWithIndex) => point.data.map((dp: ScatterChartDataPoint) => dp.x as string))\n .flat();\n\n _xAxisLabels = [...new Set(xAxisLabels)];\n\n return !_isChartEmpty() ? (\n <CartesianChart\n {...props}\n chartTitle={props.data.chartTitle}\n points={points}\n chartType={ChartTypes.ScatterChart}\n calloutProps={calloutProps}\n tickParams={tickParams}\n legendBars={legendBars}\n getmargins={_getMargins}\n getGraphData={_initializeScatterChartData}\n xAxisType={_xAxisType}\n onChartMouseLeave={_handleChartMouseLeave}\n enableFirstRenderOptimization={_firstRenderOptimization}\n datasetForXAxisDomain={_xAxisLabels}\n componentRef={cartesianChartRef}\n /* eslint-disable react/jsx-no-bind */\n // eslint-disable-next-line react/no-children-prop\n children={(props: ChildProps) => {\n _xAxisScale = props.xScale!;\n _yAxisScale = props.yScale!;\n return (\n <>\n <g>\n <line\n x1={0}\n y1={0}\n x2={0}\n y2={props.containerHeight}\n stroke={'#323130'}\n id={_verticalLine}\n visibility={'hidden'}\n strokeDasharray={'5,5'}\n />\n <g>{renderSeries}</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});\nScatterChart.displayName = 'ScatterChart';\n"],"names":["ScatterChart","React","forwardRef","props","forwardedRef","_circleId","useId","_seriesId","_verticalLine","_tooltipId","_firstRenderOptimization","_emptyChartId","_points","_injectIndexPropertyInScatterChartData","data","lineChartData","_calloutPoints","calloutData","_xAxisScale","_yAxisScale","_uniqueCallOutID","_refArray","margins","renderSeries","_xAxisLabels","xAxisCalloutAccessibilityData","_xBandwidth","cartesianChartRef","useRef","hoverXValue","setHoverXValue","useState","activeLegend","setActiveLegend","YValueHover","setYValueHover","selectedLegendPoints","setSelectedLegendPoints","isSelectedLegend","setIsSelectedLegend","activePoint","setActivePoint","stackCalloutProps","setStackCalloutProps","clickPosition","setClickPosition","x","y","isPopoverOpen","setPopoverOpen","selectedLegends","setSelectedLegends","prevPropsRef","useEffect","current","prevProps","areArraysEqual","legendProps","useImperativeHandle","componentRef","chartContainer","_xAxisType","length","getTypeOfAxis","XAxisTypes","StringAxis","pointsRef","calloutPointsRef","height","width","scatterChartData","map","item","index","color","getNextColor","getColorFromToken","updatePosition","newX","newY","threshold","distance","Math","sqrt","pow","_getMargins","_margins","_initializeScatterChartData","xScale","yScale","containerHeight","containerWidth","xElement","_createPlot","_onHoverCardHide","_createLegends","isLegendMultiSelectEnabled","canSelectMultipleLegends","legendDataItems","point","legend","title","onMouseOutAction","hoverAction","_handleChartMouseLeave","legendShape","shape","createElement","Legends","legends","enabledWrapLines","enabledLegendsWrapLines","overflowText","legendsOverflowText","onLegendHoverCardLeave","onChange","_onLegendSelectionChange","legendsSelected","event","currentLegend","slice","_getPointFill","seriesColor","pointId","pointIndex","isLastPoint","tokens","colorNeutralBackground1","series","yMax","d3Max","points","yMin","d3Min","yPadding","yPaddingRange","abs","maxMarkerRange","xPaddingRange","bandwidth","DateAxis","xMin","xMax","xPadding","getTime","Date","min","maxMarkerSize","markerSize","i","pointsForSeries","legendVal","verticaLineHeight","bottom","j","seriesId","circleId","xAxisCalloutData","circleRadius","pointMarkerSize","undefined","isLegendSelected","_legendHighlighted","_noLegendHighlighted","currentPointHidden","hideNonActiveDots","push","circle","id","key","r","cx","cy","data-is-focusable","onMouseOver","_handleHover","onMouseMove","onMouseOut","_handleMouseOut","onFocus","_handleFocus","onBlur","_getClickHandler","onDataPointClick","opacity","fill","stroke","role","aria-label","_getAriaLabel","tabIndex","g","classes","useScatterChartStyles_unstable","showXAxisLablesTooltip","document","getElementById","remove","e","wrapXAxisLables","xAxisElement","d3Select","call","tooltipProps","tooltipCls","tooltip","xAxis","tooltipOfXAxislabels","formattedData","formatDate","useUTC","xVal","found","find","element","attr","forEach","obj","values","lineHeight","mouseEvent","persist","clientX","clientY","func","onClick","_getHighlightedLegend","includes","seriesIndex","formattedDate","xValue","yValue","yAxisCalloutData","callOutAccessibilityData","ariaLabel","_isChartEmpty","filter","tickValues","tickFormat","legendBars","hideLegend","calloutProps","descriptionMessage","getCalloutDescriptionMessage","isCalloutForStack","culture","isCartesian","tickParams","xAxisLabels","dp","flat","Set","CartesianChart","chartTitle","chartType","ChartTypes","getmargins","getGraphData","xAxisType","onChartMouseLeave","enableFirstRenderOptimization","datasetForXAxisDomain","children","Fragment","line","x1","y1","x2","y2","visibility","strokeDasharray","div","style","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAyCaA;;;eAAAA;;;;iEAzCU;6CAEwB;6BAEZ;uBACH;yBACW;gCACrB;wBACe;wBAW9B;4BACgB;AAqBhB,MAAMA,eAAAA,WAAAA,GAA2DC,OAAMC,UAAU,CAGtF,CAACC,OAAOC;IACR,MAAMC,YAAoBC,IAAAA,qBAAAA,EAAM;IAChC,MAAMC,YAAoBD,IAAAA,qBAAAA,EAAM;IAChC,MAAME,gBAAwBF,IAAAA,qBAAAA,EAAM;IACpC,MAAMG,aAAqBH,IAAAA,qBAAAA,EAAM;IACjC,MAAMI,2BAA2B;IACjC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;QACT0P,YAAY1P,MAAMW,IAAI,CAAC+O,UAAU;QACjC1H,QAAQA;QACR2H,WAAWC,kBAAAA,CAAW/P,YAAY;QAClCiP,cAAcA;QACdM,YAAYA;QACZR,YAAYA;QACZiB,YAAY3K;QACZ4K,cAAc1K;QACd2K,WAAWrM;QACXsM,mBAAmB3J;QACnB4J,+BAA+B1P;QAC/B2P,uBAAuB7O;QACvBmC,cAAchC;QACd,oCAAoC,GACpC,kDAAkD;QAClD2O,UAAU,CAACnQ;YACTe,cAAcf,MAAMqF,MAAM;YAC1BrE,cAAchB,MAAMsF,MAAM;YAC1B,OAAA,WAAA,GACExF,OAAA0G,aAAA,CAAA1G,OAAAsQ,QAAA,EAAA,MAAA,WAAA,GACEtQ,OAAA0G,aAAA,CAACoF,KAAAA,MAAAA,WAAAA,GACC9L,OAAA0G,aAAA,CAAC6J,QAAAA;gBACCC,IAAI;gBACJC,IAAI;gBACJC,IAAI;gBACJC,IAAIzQ,MAAMuF,eAAe;gBACzBgG,QAAQ;gBACRlB,IAAIhK;gBACJqQ,YAAY;gBACZC,iBAAiB;8BAEnB7Q,OAAA0G,aAAA,CAACoF,KAAAA,MAAGxK;QAIZ;uBAGFtB,OAAA0G,aAAA,CAACoK,OAAAA;QAAIvG,IAAI7J;QAAegL,MAAM;QAASqF,OAAO;YAAExF,SAAS;QAAI;QAAGI,cAAY;;AAEhF;AACA5L,aAAaiR,WAAW,GAAG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["ScatterChart.types.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\nimport { RenderFunction } from '../../utilities/index';\nimport {\n ChartProps,\n LineChartPoints,\n Margins,\n Basestate,\n RefArrayData,\n CustomizedCalloutData,\n} from '../../types/index';\nimport {\n CartesianChartProps,\n CartesianChartStyleProps,\n CartesianChartStyles,\n ChildProps,\n} from '../CommonComponents/index';\n\nexport type { ChildProps, LineChartPoints, Margins, Basestate, RefArrayData };\n\n/**\n * Line Chart properties\n * {@docCategory LineChart}\n */\nexport interface ScatterChartProps extends CartesianChartProps {\n /**\n * Data to render in the chart.\n */\n data: ChartProps;\n\n /**\n * Call to provide customized styling that will layer on top of the variant rules.\n */\n styles?: ScatterChartStyles;\n\n /**\n * Define a custom callout renderer for a data point\n */\n onRenderCalloutPerDataPoint?: RenderFunction<CustomizedCalloutData>;\n\n /**\n * Callback for getting callout description message\n */\n getCalloutDescriptionMessage?: (calloutDataProps: CustomizedCalloutData) => 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 ScatterChartStyles extends CartesianChartStyles {}\n\n/**\n * Scatter Chart style properties\n * {@docCategory ScatterChart}\n */\nexport interface ScatterChartStyleProps extends CartesianChartStyleProps {}\n"],"names":[],"rangeMappings":";;;","mappings":"AAAA,uDAAuD,GAwDvD;;;CAGC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
const _export_star = require("@swc/helpers/_/_export_star");
|
|
6
|
+
_export_star._(require("./ScatterChart"), exports);
|
|
7
|
+
_export_star._(require("./ScatterChart.types"), exports);
|
|
8
|
+
_export_star._(require("../../types/index"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export * from './ScatterChart';\nexport * from './ScatterChart.types';\nexport * from '../../types/index';\n"],"names":[],"rangeMappings":";;;;;;;","mappings":";;;;;uBAAc;uBACA;uBACA"}
|