@mui/x-charts 9.0.3 → 9.1.0
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/BarChart/BarChart.d.mts +1 -2
- package/BarChart/BarChart.d.ts +1 -2
- package/BarChart/BarChart.js +2 -913
- package/BarChart/BarChart.mjs +2 -913
- package/BarChart/FocusedBar.js +3 -0
- package/BarChart/FocusedBar.mjs +3 -0
- package/BarChart/seriesConfig/bar/seriesProcessor.js +2 -0
- package/BarChart/seriesConfig/bar/seriesProcessor.mjs +2 -0
- package/CHANGELOG.md +220 -0
- package/ChartsAxisHighlightValue/ChartsAxisHighlightValue.d.mts +55 -0
- package/ChartsAxisHighlightValue/ChartsAxisHighlightValue.d.ts +55 -0
- package/ChartsAxisHighlightValue/ChartsAxisHighlightValue.js +94 -0
- package/ChartsAxisHighlightValue/ChartsAxisHighlightValue.mjs +88 -0
- package/ChartsAxisHighlightValue/ChartsAxisHighlightValueItem.d.mts +13 -0
- package/ChartsAxisHighlightValue/ChartsAxisHighlightValueItem.d.ts +13 -0
- package/ChartsAxisHighlightValue/ChartsAxisHighlightValueItem.js +86 -0
- package/ChartsAxisHighlightValue/ChartsAxisHighlightValueItem.mjs +80 -0
- package/ChartsAxisHighlightValue/chartsAxisHighlightValueClasses.d.mts +18 -0
- package/ChartsAxisHighlightValue/chartsAxisHighlightValueClasses.d.ts +18 -0
- package/ChartsAxisHighlightValue/chartsAxisHighlightValueClasses.js +26 -0
- package/ChartsAxisHighlightValue/chartsAxisHighlightValueClasses.mjs +16 -0
- package/ChartsAxisHighlightValue/index.d.mts +1 -0
- package/ChartsAxisHighlightValue/index.d.ts +1 -0
- package/ChartsAxisHighlightValue/index.js +16 -0
- package/ChartsAxisHighlightValue/index.mjs +1 -0
- package/ChartsAxisHighlightValue/useAxisHighlightValue.d.mts +14 -0
- package/ChartsAxisHighlightValue/useAxisHighlightValue.d.ts +14 -0
- package/ChartsAxisHighlightValue/useAxisHighlightValue.js +130 -0
- package/ChartsAxisHighlightValue/useAxisHighlightValue.mjs +124 -0
- package/ChartsContainer/ChartsContainer.js +4 -1431
- package/ChartsContainer/ChartsContainer.mjs +4 -1431
- package/ChartsRadialAxisHighlight/ChartsRadialAxisHighlight.d.mts +15 -0
- package/ChartsRadialAxisHighlight/ChartsRadialAxisHighlight.d.ts +15 -0
- package/ChartsRadialAxisHighlight/ChartsRadialAxisHighlight.js +56 -0
- package/ChartsRadialAxisHighlight/ChartsRadialAxisHighlight.mjs +50 -0
- package/ChartsRadialAxisHighlight/ChartsRadialAxisHighlight.types.d.mts +6 -0
- package/ChartsRadialAxisHighlight/ChartsRadialAxisHighlight.types.d.ts +6 -0
- package/ChartsRadialAxisHighlight/ChartsRadialAxisHighlight.types.js +5 -0
- package/ChartsRadialAxisHighlight/ChartsRadialAxisHighlight.types.mjs +1 -0
- package/ChartsRadialAxisHighlight/ChartsRadialAxisHighlightPath.d.mts +11 -0
- package/ChartsRadialAxisHighlight/ChartsRadialAxisHighlightPath.d.ts +11 -0
- package/ChartsRadialAxisHighlight/ChartsRadialAxisHighlightPath.js +70 -0
- package/ChartsRadialAxisHighlight/ChartsRadialAxisHighlightPath.mjs +64 -0
- package/ChartsRadialAxisHighlight/ChartsRadiusAxisHighlight.d.mts +9 -0
- package/ChartsRadialAxisHighlight/ChartsRadiusAxisHighlight.d.ts +9 -0
- package/ChartsRadialAxisHighlight/ChartsRadiusAxisHighlight.js +87 -0
- package/ChartsRadialAxisHighlight/ChartsRadiusAxisHighlight.mjs +81 -0
- package/ChartsRadialAxisHighlight/ChartsRotationAxisHighlight.d.mts +9 -0
- package/ChartsRadialAxisHighlight/ChartsRotationAxisHighlight.d.ts +9 -0
- package/ChartsRadialAxisHighlight/ChartsRotationAxisHighlight.js +98 -0
- package/ChartsRadialAxisHighlight/ChartsRotationAxisHighlight.mjs +92 -0
- package/ChartsRadialAxisHighlight/chartsRadialAxisHighlightClasses.d.mts +7 -0
- package/ChartsRadialAxisHighlight/chartsRadialAxisHighlightClasses.d.ts +7 -0
- package/ChartsRadialAxisHighlight/chartsRadialAxisHighlightClasses.js +14 -0
- package/ChartsRadialAxisHighlight/chartsRadialAxisHighlightClasses.mjs +6 -0
- package/ChartsRadialAxisHighlight/index.d.mts +5 -0
- package/ChartsRadialAxisHighlight/index.d.ts +5 -0
- package/ChartsRadialAxisHighlight/index.js +47 -0
- package/ChartsRadialAxisHighlight/index.mjs +4 -0
- package/ChartsRadiusAxis/index.d.mts +3 -2
- package/ChartsRadiusAxis/index.d.ts +3 -2
- package/ChartsRadiusAxis/index.mjs +3 -1
- package/ChartsRotationAxis/index.d.mts +3 -2
- package/ChartsRotationAxis/index.d.ts +3 -2
- package/ChartsRotationAxis/index.mjs +3 -1
- package/ChartsTooltip/useAxesTooltip.js +11 -3
- package/ChartsTooltip/useAxesTooltip.mjs +11 -3
- package/ChartsXAxis/useAxisTicksProps.d.mts +162 -81
- package/ChartsXAxis/useAxisTicksProps.d.ts +162 -81
- package/ChartsYAxis/useAxisTicksProps.d.mts +162 -81
- package/ChartsYAxis/useAxisTicksProps.d.ts +162 -81
- package/LICENSE +2 -0
- package/LineChart/FocusedLineMark.js +3 -0
- package/LineChart/FocusedLineMark.mjs +3 -0
- package/LineChart/LineChart.js +2 -913
- package/LineChart/LineChart.mjs +2 -913
- package/LineChart/seriesConfig/curveEvaluation.d.mts +19 -1
- package/LineChart/seriesConfig/curveEvaluation.d.ts +19 -1
- package/LineChart/seriesConfig/curveEvaluation.js +132 -0
- package/LineChart/seriesConfig/curveEvaluation.mjs +131 -0
- package/LineChart/seriesConfig/getItemAtPosition.js +12 -35
- package/LineChart/seriesConfig/getItemAtPosition.mjs +10 -33
- package/LineChart/seriesConfig/getSeriesWithDefaultValues.js +2 -1
- package/LineChart/seriesConfig/getSeriesWithDefaultValues.mjs +2 -1
- package/LineChart/seriesConfig/seriesProcessor.js +4 -0
- package/LineChart/seriesConfig/seriesProcessor.mjs +4 -0
- package/LineChart/useAreaPlotData.js +4 -0
- package/LineChart/useAreaPlotData.mjs +4 -0
- package/LineChart/useLinePlotData.js +2 -0
- package/LineChart/useLinePlotData.mjs +2 -0
- package/LineChart/useMarkPlotData.js +2 -0
- package/LineChart/useMarkPlotData.mjs +2 -0
- package/PieChart/FocusedPieArc.js +3 -0
- package/PieChart/FocusedPieArc.mjs +3 -0
- package/RadarChart/FocusedRadarMark.js +3 -0
- package/RadarChart/FocusedRadarMark.mjs +3 -0
- package/ScatterChart/FocusedScatterMark.js +10 -21
- package/ScatterChart/FocusedScatterMark.mjs +10 -21
- package/ScatterChart/HighlightedScatterMark.d.mts +11 -0
- package/ScatterChart/HighlightedScatterMark.d.ts +11 -0
- package/ScatterChart/HighlightedScatterMark.js +68 -0
- package/ScatterChart/HighlightedScatterMark.mjs +62 -0
- package/ScatterChart/ScatterChart.d.mts +1 -2
- package/ScatterChart/ScatterChart.d.ts +1 -2
- package/ScatterChart/ScatterChart.js +2 -913
- package/ScatterChart/ScatterChart.mjs +2 -913
- package/ScatterChart/index.d.mts +1 -0
- package/ScatterChart/index.d.ts +1 -0
- package/ScatterChart/index.js +12 -0
- package/ScatterChart/index.mjs +1 -0
- package/ScatterChart/scatterClasses.d.mts +3 -1
- package/ScatterChart/scatterClasses.d.ts +3 -1
- package/ScatterChart/scatterClasses.js +3 -2
- package/ScatterChart/scatterClasses.mjs +3 -2
- package/ScatterChart/useScatterChartProps.js +3 -1
- package/ScatterChart/useScatterChartProps.mjs +3 -1
- package/ScatterChart/useScatterItemPosition.d.mts +16 -0
- package/ScatterChart/useScatterItemPosition.d.ts +16 -0
- package/ScatterChart/useScatterItemPosition.js +47 -0
- package/ScatterChart/useScatterItemPosition.mjs +41 -0
- package/SparkLineChart/SparkLineChart.js +2 -913
- package/SparkLineChart/SparkLineChart.mjs +2 -913
- package/hooks/useAxis.d.mts +3 -3
- package/hooks/useAxis.d.ts +3 -3
- package/hooks/useAxisSystem.d.mts +1 -1
- package/hooks/useAxisSystem.d.ts +1 -1
- package/hooks/useAxisSystem.js +1 -1
- package/hooks/useAxisSystem.mjs +1 -1
- package/index.d.mts +2 -0
- package/index.d.ts +2 -0
- package/index.js +25 -1
- package/index.mjs +3 -1
- package/internals/commonNextFocusItem.js +62 -8
- package/internals/commonNextFocusItem.mjs +62 -8
- package/internals/findClosestIndex.d.mts +5 -0
- package/internals/findClosestIndex.d.ts +5 -0
- package/internals/findClosestIndex.js +27 -0
- package/internals/findClosestIndex.mjs +22 -0
- package/internals/getAsNumber.d.mts +1 -0
- package/internals/getAsNumber.d.ts +1 -0
- package/internals/getAsNumber.js +9 -0
- package/internals/getAsNumber.mjs +3 -0
- package/internals/index.d.mts +6 -0
- package/internals/index.d.ts +6 -0
- package/internals/index.js +60 -0
- package/internals/index.mjs +6 -0
- package/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.js +4 -2
- package/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.mjs +4 -2
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/polarExtremumGetter.types.d.mts +2 -2
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/polarExtremumGetter.types.d.ts +2 -2
- package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisValue.js +4 -21
- package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisValue.mjs +4 -21
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.mts +3 -2
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +3 -2
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/findVisibleDataIndex.d.mts +30 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/findVisibleDataIndex.d.ts +30 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/findVisibleDataIndex.js +57 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/findVisibleDataIndex.mjs +51 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/getMaxSeriesLength.js +7 -1
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/getMaxSeriesLength.mjs +7 -1
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/getNonEmptySeriesArray.js +7 -1
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/getNonEmptySeriesArray.mjs +7 -1
- package/internals/plugins/featurePlugins/useChartPolarAxis/computeAxisValue.d.mts +4 -7
- package/internals/plugins/featurePlugins/useChartPolarAxis/computeAxisValue.d.ts +4 -7
- package/internals/plugins/featurePlugins/useChartPolarAxis/computeAxisValue.js +2 -1
- package/internals/plugins/featurePlugins/useChartPolarAxis/computeAxisValue.mjs +2 -1
- package/internals/plugins/featurePlugins/useChartPolarAxis/defaultizeAxis.d.mts +3 -2
- package/internals/plugins/featurePlugins/useChartPolarAxis/defaultizeAxis.d.ts +3 -2
- package/internals/plugins/featurePlugins/useChartPolarAxis/getAxisExtremum.d.mts +2 -2
- package/internals/plugins/featurePlugins/useChartPolarAxis/getAxisExtremum.d.ts +2 -2
- package/internals/plugins/featurePlugins/useChartPolarAxis/getAxisIndex.d.mts +2 -2
- package/internals/plugins/featurePlugins/useChartPolarAxis/getAxisIndex.d.ts +2 -2
- package/internals/plugins/featurePlugins/useChartPolarAxis/getAxisIndex.js +27 -6
- package/internals/plugins/featurePlugins/useChartPolarAxis/getAxisIndex.mjs +27 -5
- package/internals/plugins/featurePlugins/useChartPolarAxis/index.d.mts +2 -1
- package/internals/plugins/featurePlugins/useChartPolarAxis/index.d.ts +2 -1
- package/internals/plugins/featurePlugins/useChartPolarAxis/index.js +12 -0
- package/internals/plugins/featurePlugins/useChartPolarAxis/index.mjs +2 -1
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.selectors.d.mts +4 -4
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.selectors.d.ts +4 -4
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.types.d.mts +3 -3
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.types.d.ts +3 -3
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors.d.mts +1 -1
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors.d.ts +1 -1
- package/models/axis.d.mts +28 -28
- package/models/axis.d.ts +28 -28
- package/models/axis.js +5 -1
- package/models/axis.mjs +5 -1
- package/models/seriesType/line.d.mts +6 -6
- package/models/seriesType/line.d.ts +6 -6
- package/package.json +170 -142
package/ScatterChart/index.d.mts
CHANGED
|
@@ -4,6 +4,7 @@ export * from "./Scatter.mjs";
|
|
|
4
4
|
export * from "./ScatterMarker.types.mjs";
|
|
5
5
|
export * from "./ScatterMarker.mjs";
|
|
6
6
|
export * from "./FocusedScatterMark.mjs";
|
|
7
|
+
export * from "./HighlightedScatterMark.mjs";
|
|
7
8
|
export * from "./ScatterChart.plugins.mjs";
|
|
8
9
|
export { scatterClasses } from "./scatterClasses.mjs";
|
|
9
10
|
export type { ScatterClassKey, ScatterClasses } from "./scatterClasses.mjs";
|
package/ScatterChart/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export * from "./Scatter.js";
|
|
|
4
4
|
export * from "./ScatterMarker.types.js";
|
|
5
5
|
export * from "./ScatterMarker.js";
|
|
6
6
|
export * from "./FocusedScatterMark.js";
|
|
7
|
+
export * from "./HighlightedScatterMark.js";
|
|
7
8
|
export * from "./ScatterChart.plugins.js";
|
|
8
9
|
export { scatterClasses } from "./scatterClasses.js";
|
|
9
10
|
export type { ScatterClassKey, ScatterClasses } from "./scatterClasses.js";
|
package/ScatterChart/index.js
CHANGED
|
@@ -84,6 +84,18 @@ Object.keys(_FocusedScatterMark).forEach(function (key) {
|
|
|
84
84
|
}
|
|
85
85
|
});
|
|
86
86
|
});
|
|
87
|
+
var _HighlightedScatterMark = require("./HighlightedScatterMark");
|
|
88
|
+
Object.keys(_HighlightedScatterMark).forEach(function (key) {
|
|
89
|
+
if (key === "default" || key === "__esModule") return;
|
|
90
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
91
|
+
if (key in exports && exports[key] === _HighlightedScatterMark[key]) return;
|
|
92
|
+
Object.defineProperty(exports, key, {
|
|
93
|
+
enumerable: true,
|
|
94
|
+
get: function () {
|
|
95
|
+
return _HighlightedScatterMark[key];
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
});
|
|
87
99
|
var _ScatterChart2 = require("./ScatterChart.plugins");
|
|
88
100
|
Object.keys(_ScatterChart2).forEach(function (key) {
|
|
89
101
|
if (key === "default" || key === "__esModule") return;
|
package/ScatterChart/index.mjs
CHANGED
|
@@ -4,5 +4,6 @@ export * from "./Scatter.mjs";
|
|
|
4
4
|
export * from "./ScatterMarker.types.mjs";
|
|
5
5
|
export * from "./ScatterMarker.mjs";
|
|
6
6
|
export * from "./FocusedScatterMark.mjs";
|
|
7
|
+
export * from "./HighlightedScatterMark.mjs";
|
|
7
8
|
export * from "./ScatterChart.plugins.mjs";
|
|
8
9
|
export { scatterClasses } from "./scatterClasses.mjs";
|
|
@@ -10,6 +10,8 @@ export interface ScatterClasses {
|
|
|
10
10
|
marker: string;
|
|
11
11
|
/** Styles applied to the focused scatter mark element. */
|
|
12
12
|
focusedMark: string;
|
|
13
|
+
/** Styles applied to the highlighted scatter mark element. */
|
|
14
|
+
highlightedMark: string;
|
|
13
15
|
}
|
|
14
16
|
export type ScatterClassKey = keyof ScatterClasses;
|
|
15
17
|
export declare function getScatterUtilityClass(slot: string): string;
|
|
@@ -17,4 +19,4 @@ export declare const scatterClasses: ScatterClasses;
|
|
|
17
19
|
export interface UseUtilityClassesOptions {
|
|
18
20
|
classes?: Partial<ScatterClasses>;
|
|
19
21
|
}
|
|
20
|
-
export declare const useUtilityClasses: (options?: UseUtilityClassesOptions) => Record<"root" | "marker" | "series" | "focusedMark", string>;
|
|
22
|
+
export declare const useUtilityClasses: (options?: UseUtilityClassesOptions) => Record<"root" | "marker" | "series" | "focusedMark" | "highlightedMark", string>;
|
|
@@ -10,6 +10,8 @@ export interface ScatterClasses {
|
|
|
10
10
|
marker: string;
|
|
11
11
|
/** Styles applied to the focused scatter mark element. */
|
|
12
12
|
focusedMark: string;
|
|
13
|
+
/** Styles applied to the highlighted scatter mark element. */
|
|
14
|
+
highlightedMark: string;
|
|
13
15
|
}
|
|
14
16
|
export type ScatterClassKey = keyof ScatterClasses;
|
|
15
17
|
export declare function getScatterUtilityClass(slot: string): string;
|
|
@@ -17,4 +19,4 @@ export declare const scatterClasses: ScatterClasses;
|
|
|
17
19
|
export interface UseUtilityClassesOptions {
|
|
18
20
|
classes?: Partial<ScatterClasses>;
|
|
19
21
|
}
|
|
20
|
-
export declare const useUtilityClasses: (options?: UseUtilityClassesOptions) => Record<"root" | "marker" | "series" | "focusedMark", string>;
|
|
22
|
+
export declare const useUtilityClasses: (options?: UseUtilityClassesOptions) => Record<"root" | "marker" | "series" | "focusedMark" | "highlightedMark", string>;
|
|
@@ -12,7 +12,7 @@ var _generateUtilityClasses = _interopRequireDefault(require("@mui/utils/generat
|
|
|
12
12
|
function getScatterUtilityClass(slot) {
|
|
13
13
|
return (0, _generateUtilityClass.default)('MuiScatterChart', slot);
|
|
14
14
|
}
|
|
15
|
-
const scatterClasses = exports.scatterClasses = (0, _generateUtilityClasses.default)('MuiScatterChart', ['root', 'series', 'marker', 'focusedMark']);
|
|
15
|
+
const scatterClasses = exports.scatterClasses = (0, _generateUtilityClasses.default)('MuiScatterChart', ['root', 'series', 'marker', 'focusedMark', 'highlightedMark']);
|
|
16
16
|
const useUtilityClasses = options => {
|
|
17
17
|
const {
|
|
18
18
|
classes
|
|
@@ -21,7 +21,8 @@ const useUtilityClasses = options => {
|
|
|
21
21
|
root: ['root'],
|
|
22
22
|
series: ['series'],
|
|
23
23
|
marker: ['marker'],
|
|
24
|
-
focusedMark: ['focusedMark']
|
|
24
|
+
focusedMark: ['focusedMark'],
|
|
25
|
+
highlightedMark: ['highlightedMark']
|
|
25
26
|
};
|
|
26
27
|
return (0, _composeClasses.default)(slots, getScatterUtilityClass, classes);
|
|
27
28
|
};
|
|
@@ -4,7 +4,7 @@ import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
|
|
|
4
4
|
export function getScatterUtilityClass(slot) {
|
|
5
5
|
return generateUtilityClass('MuiScatterChart', slot);
|
|
6
6
|
}
|
|
7
|
-
export const scatterClasses = generateUtilityClasses('MuiScatterChart', ['root', 'series', 'marker', 'focusedMark']);
|
|
7
|
+
export const scatterClasses = generateUtilityClasses('MuiScatterChart', ['root', 'series', 'marker', 'focusedMark', 'highlightedMark']);
|
|
8
8
|
export const useUtilityClasses = options => {
|
|
9
9
|
const {
|
|
10
10
|
classes
|
|
@@ -13,7 +13,8 @@ export const useUtilityClasses = options => {
|
|
|
13
13
|
root: ['root'],
|
|
14
14
|
series: ['series'],
|
|
15
15
|
marker: ['marker'],
|
|
16
|
-
focusedMark: ['focusedMark']
|
|
16
|
+
focusedMark: ['focusedMark'],
|
|
17
|
+
highlightedMark: ['highlightedMark']
|
|
17
18
|
};
|
|
18
19
|
return composeClasses(slots, getScatterUtilityClass, classes);
|
|
19
20
|
};
|
|
@@ -50,7 +50,9 @@ const useScatterChartProps = props => {
|
|
|
50
50
|
type: 'scatter'
|
|
51
51
|
}, s)), [series]);
|
|
52
52
|
const resolvedDisableHitArea = disableHitArea;
|
|
53
|
-
|
|
53
|
+
// 'svg-single' (and the undefined default) is the only renderer with per-item DOM events.
|
|
54
|
+
// Every other renderer needs voronoi-based click handling regardless of disableHitArea.
|
|
55
|
+
const useVoronoiOnItemClick = resolvedDisableHitArea !== true || renderer !== undefined && renderer !== 'svg-single';
|
|
54
56
|
const chartsContainerProps = (0, _extends2.default)({}, other, {
|
|
55
57
|
series: seriesWithDefault,
|
|
56
58
|
width,
|
|
@@ -43,7 +43,9 @@ export const useScatterChartProps = props => {
|
|
|
43
43
|
type: 'scatter'
|
|
44
44
|
}, s)), [series]);
|
|
45
45
|
const resolvedDisableHitArea = disableHitArea;
|
|
46
|
-
|
|
46
|
+
// 'svg-single' (and the undefined default) is the only renderer with per-item DOM events.
|
|
47
|
+
// Every other renderer needs voronoi-based click handling regardless of disableHitArea.
|
|
48
|
+
const useVoronoiOnItemClick = resolvedDisableHitArea !== true || renderer !== undefined && renderer !== 'svg-single';
|
|
47
49
|
const chartsContainerProps = _extends({}, other, {
|
|
48
50
|
series: seriesWithDefault,
|
|
49
51
|
width,
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type DefaultizedScatterSeriesType, type ScatterItemIdentifier, type ScatterValueType } from "../models/seriesType/scatter.mjs";
|
|
2
|
+
export interface ResolvedScatterItem {
|
|
3
|
+
cx: number;
|
|
4
|
+
cy: number;
|
|
5
|
+
series: DefaultizedScatterSeriesType;
|
|
6
|
+
scatterPoint: ScatterValueType;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Resolves a scatter item identifier to its on-screen position and the owning
|
|
10
|
+
* series. Shared by `FocusedScatterMark`, `HighlightedScatterMark`, and other
|
|
11
|
+
* overlay components that need to draw an SVG element at a specific scatter point.
|
|
12
|
+
*
|
|
13
|
+
* Returns `null` if the identifier is missing, the identifier doesn't point to
|
|
14
|
+
* a scatter series, or the referenced point can't be resolved.
|
|
15
|
+
*/
|
|
16
|
+
export declare function useScatterItemPosition(item: Pick<ScatterItemIdentifier, 'seriesId' | 'dataIndex'> | null | undefined): ResolvedScatterItem | null;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type DefaultizedScatterSeriesType, type ScatterItemIdentifier, type ScatterValueType } from "../models/seriesType/scatter.js";
|
|
2
|
+
export interface ResolvedScatterItem {
|
|
3
|
+
cx: number;
|
|
4
|
+
cy: number;
|
|
5
|
+
series: DefaultizedScatterSeriesType;
|
|
6
|
+
scatterPoint: ScatterValueType;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Resolves a scatter item identifier to its on-screen position and the owning
|
|
10
|
+
* series. Shared by `FocusedScatterMark`, `HighlightedScatterMark`, and other
|
|
11
|
+
* overlay components that need to draw an SVG element at a specific scatter point.
|
|
12
|
+
*
|
|
13
|
+
* Returns `null` if the identifier is missing, the identifier doesn't point to
|
|
14
|
+
* a scatter series, or the referenced point can't be resolved.
|
|
15
|
+
*/
|
|
16
|
+
export declare function useScatterItemPosition(item: Pick<ScatterItemIdentifier, 'seriesId' | 'dataIndex'> | null | undefined): ResolvedScatterItem | null;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useScatterItemPosition = useScatterItemPosition;
|
|
7
|
+
var _hooks = require("../hooks");
|
|
8
|
+
/**
|
|
9
|
+
* Resolves a scatter item identifier to its on-screen position and the owning
|
|
10
|
+
* series. Shared by `FocusedScatterMark`, `HighlightedScatterMark`, and other
|
|
11
|
+
* overlay components that need to draw an SVG element at a specific scatter point.
|
|
12
|
+
*
|
|
13
|
+
* Returns `null` if the identifier is missing, the identifier doesn't point to
|
|
14
|
+
* a scatter series, or the referenced point can't be resolved.
|
|
15
|
+
*/
|
|
16
|
+
function useScatterItemPosition(item) {
|
|
17
|
+
const scatterSeries = (0, _hooks.useScatterSeriesContext)();
|
|
18
|
+
const {
|
|
19
|
+
xAxis,
|
|
20
|
+
xAxisIds
|
|
21
|
+
} = (0, _hooks.useXAxes)();
|
|
22
|
+
const {
|
|
23
|
+
yAxis,
|
|
24
|
+
yAxisIds
|
|
25
|
+
} = (0, _hooks.useYAxes)();
|
|
26
|
+
if (!item || !scatterSeries) {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
const series = scatterSeries.series[item.seriesId];
|
|
30
|
+
if (!series || series.hidden) {
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
const scatterPoint = series.data[item.dataIndex];
|
|
34
|
+
if (!scatterPoint) {
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
const xAxisId = series.xAxisId ?? xAxisIds[0];
|
|
38
|
+
const yAxisId = series.yAxisId ?? yAxisIds[0];
|
|
39
|
+
const cx = (0, _hooks.getValueToPositionMapper)(xAxis[xAxisId].scale)(scatterPoint.x);
|
|
40
|
+
const cy = (0, _hooks.getValueToPositionMapper)(yAxis[yAxisId].scale)(scatterPoint.y);
|
|
41
|
+
return {
|
|
42
|
+
cx,
|
|
43
|
+
cy,
|
|
44
|
+
series,
|
|
45
|
+
scatterPoint
|
|
46
|
+
};
|
|
47
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { getValueToPositionMapper, useScatterSeriesContext, useXAxes, useYAxes } from "../hooks/index.mjs";
|
|
2
|
+
/**
|
|
3
|
+
* Resolves a scatter item identifier to its on-screen position and the owning
|
|
4
|
+
* series. Shared by `FocusedScatterMark`, `HighlightedScatterMark`, and other
|
|
5
|
+
* overlay components that need to draw an SVG element at a specific scatter point.
|
|
6
|
+
*
|
|
7
|
+
* Returns `null` if the identifier is missing, the identifier doesn't point to
|
|
8
|
+
* a scatter series, or the referenced point can't be resolved.
|
|
9
|
+
*/
|
|
10
|
+
export function useScatterItemPosition(item) {
|
|
11
|
+
const scatterSeries = useScatterSeriesContext();
|
|
12
|
+
const {
|
|
13
|
+
xAxis,
|
|
14
|
+
xAxisIds
|
|
15
|
+
} = useXAxes();
|
|
16
|
+
const {
|
|
17
|
+
yAxis,
|
|
18
|
+
yAxisIds
|
|
19
|
+
} = useYAxes();
|
|
20
|
+
if (!item || !scatterSeries) {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
const series = scatterSeries.series[item.seriesId];
|
|
24
|
+
if (!series || series.hidden) {
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
const scatterPoint = series.data[item.dataIndex];
|
|
28
|
+
if (!scatterPoint) {
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
const xAxisId = series.xAxisId ?? xAxisIds[0];
|
|
32
|
+
const yAxisId = series.yAxisId ?? yAxisIds[0];
|
|
33
|
+
const cx = getValueToPositionMapper(xAxis[xAxisId].scale)(scatterPoint.x);
|
|
34
|
+
const cy = getValueToPositionMapper(yAxis[yAxisId].scale)(scatterPoint.y);
|
|
35
|
+
return {
|
|
36
|
+
cx,
|
|
37
|
+
cy,
|
|
38
|
+
series,
|
|
39
|
+
scatterPoint
|
|
40
|
+
};
|
|
41
|
+
}
|