@mui/x-charts 9.7.0 → 9.8.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/CHANGELOG.md +130 -1
- package/ChartsTooltip/ChartsTooltipContainer.js +14 -3
- package/ChartsTooltip/ChartsTooltipContainer.mjs +15 -4
- package/ChartsXAxis/ChartsGroupedXAxisTicks.js +3 -13
- package/ChartsXAxis/ChartsGroupedXAxisTicks.mjs +2 -12
- package/ChartsYAxis/ChartsGroupedYAxisTicks.js +4 -16
- package/ChartsYAxis/ChartsGroupedYAxisTicks.mjs +3 -13
- package/hooks/index.d.mts +2 -1
- package/hooks/index.d.ts +2 -1
- package/hooks/index.js +10 -2
- package/hooks/index.mjs +2 -1
- package/hooks/usePolarGeometry.d.mts +51 -0
- package/hooks/usePolarGeometry.d.ts +51 -0
- package/hooks/usePolarGeometry.js +47 -0
- package/hooks/usePolarGeometry.mjs +41 -0
- package/index.js +1 -1
- package/index.mjs +1 -1
- package/internals/animation/animation.d.mts +1 -1
- package/internals/animation/animation.d.ts +1 -1
- package/internals/commonNextFocusItem.d.mts +15 -5
- package/internals/commonNextFocusItem.d.ts +15 -5
- package/internals/commonNextFocusItem.js +6 -0
- package/internals/commonNextFocusItem.mjs +7 -0
- package/internals/createCommonKeyboardFocusHandler.d.mts +5 -1
- package/internals/createCommonKeyboardFocusHandler.d.ts +5 -1
- package/internals/getGroupingConfig.d.mts +6 -0
- package/internals/getGroupingConfig.d.ts +6 -0
- package/internals/getGroupingConfig.js +20 -0
- package/internals/getGroupingConfig.mjs +12 -0
- package/internals/plugins/corePlugins/useChartSeries/useChartSeries.selectors.d.mts +1 -0
- package/internals/plugins/corePlugins/useChartSeries/useChartSeries.selectors.d.ts +1 -0
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/colorProcessor.types.d.mts +1 -1
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/colorProcessor.types.d.ts +1 -1
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/seriesConfig.types.d.mts +7 -1
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/seriesConfig.types.d.ts +7 -1
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/tooltipItemPositionGetter.types.d.mts +18 -7
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/tooltipItemPositionGetter.types.d.ts +18 -7
- package/internals/plugins/featurePlugins/useChartHighlight/createIsFaded.d.mts +1 -1
- package/internals/plugins/featurePlugins/useChartHighlight/createIsFaded.d.ts +1 -1
- package/internals/plugins/featurePlugins/useChartHighlight/createIsHighlighted.d.mts +1 -1
- package/internals/plugins/featurePlugins/useChartHighlight/createIsHighlighted.d.ts +1 -1
- package/internals/plugins/featurePlugins/useChartTooltip/useChartTooltip.selectors.d.mts +1 -1
- package/internals/plugins/featurePlugins/useChartTooltip/useChartTooltip.selectors.d.ts +1 -1
- package/internals/plugins/featurePlugins/useChartTooltip/useChartTooltip.selectors.js +3 -7
- package/internals/plugins/featurePlugins/useChartTooltip/useChartTooltip.selectors.mjs +3 -7
- package/internals/plugins/featurePlugins/useGeoProjection/useGeoProjection.selectors.d.mts +1 -2
- package/internals/plugins/featurePlugins/useGeoProjection/useGeoProjection.selectors.d.ts +1 -2
- package/internals/plugins/featurePlugins/useGeoProjection/useGeoProjection.types.d.mts +9 -0
- package/internals/plugins/featurePlugins/useGeoProjection/useGeoProjection.types.d.ts +9 -0
- package/internals/shallowEqual.d.mts +1 -1
- package/internals/shallowEqual.d.ts +1 -1
- package/internals/shallowEqual.js +1 -1
- package/internals/shallowEqual.mjs +1 -1
- package/package.json +4 -4
|
@@ -1,12 +1,22 @@
|
|
|
1
1
|
import type { UseChartKeyboardNavigationSignature } from "./plugins/featurePlugins/useChartKeyboardNavigation/index.mjs";
|
|
2
2
|
import type { ChartState } from "./plugins/models/chart.mjs";
|
|
3
3
|
import type { ChartSeriesType } from "../models/seriesType/config.mjs";
|
|
4
|
-
import type { SeriesId
|
|
4
|
+
import type { SeriesId } from "../models/seriesType/index.mjs";
|
|
5
5
|
type ReturnedItem<OutSeriesType extends ChartSeriesType> = {
|
|
6
6
|
type: OutSeriesType;
|
|
7
7
|
seriesId: SeriesId;
|
|
8
8
|
dataIndex: number;
|
|
9
9
|
} | null;
|
|
10
|
+
/**
|
|
11
|
+
* The item the navigators work on. Decoupled from the public `FocusedItemIdentifier` because
|
|
12
|
+
* navigation is position-based: series keyed differently (e.g. `mapShape`, keyed by `name`)
|
|
13
|
+
* reuse these helpers by translating to a `dataIndex` at their boundary.
|
|
14
|
+
*/
|
|
15
|
+
type WorkingItem = {
|
|
16
|
+
type: Exclude<ChartSeriesType, 'sankey' | 'heatmap'>;
|
|
17
|
+
seriesId: SeriesId;
|
|
18
|
+
dataIndex?: number;
|
|
19
|
+
};
|
|
10
20
|
type StateParameters<SeriesType extends ChartSeriesType> = Pick<ChartState<[UseChartKeyboardNavigationSignature], [], SeriesType>, 'series'>;
|
|
11
21
|
export declare function createGetNextIndexFocusedItem<InSeriesType extends Exclude<ChartSeriesType, 'sankey' | 'heatmap'>, OutSeriesType extends Exclude<ChartSeriesType, 'sankey' | 'heatmap'> = InSeriesType>(
|
|
12
22
|
/**
|
|
@@ -20,7 +30,7 @@ allowCycles?: boolean,
|
|
|
20
30
|
/**
|
|
21
31
|
* If true, series max index is defined by the current series length and not all series.
|
|
22
32
|
*/
|
|
23
|
-
useCurrentSeriesMaxLength?: boolean): (currentItem:
|
|
33
|
+
useCurrentSeriesMaxLength?: boolean): (currentItem: WorkingItem | null, state: StateParameters<InSeriesType>) => ReturnedItem<OutSeriesType>;
|
|
24
34
|
export declare function createGetPreviousIndexFocusedItem<InSeriesType extends Exclude<ChartSeriesType, 'sankey' | 'heatmap'>, OutSeriesType extends Exclude<ChartSeriesType, 'sankey' | 'heatmap'> = InSeriesType>(
|
|
25
35
|
/**
|
|
26
36
|
* The set of series types compatible with this navigation action.
|
|
@@ -33,15 +43,15 @@ allowCycles?: boolean,
|
|
|
33
43
|
/**
|
|
34
44
|
* If true, series max index is defined by the current series length and not all series.
|
|
35
45
|
*/
|
|
36
|
-
useCurrentSeriesMaxLength?: boolean): (currentItem:
|
|
46
|
+
useCurrentSeriesMaxLength?: boolean): (currentItem: WorkingItem | null, state: StateParameters<InSeriesType>) => ReturnedItem<OutSeriesType>;
|
|
37
47
|
export declare function createGetNextSeriesFocusedItem<InSeriesType extends Exclude<ChartSeriesType, 'sankey' | 'heatmap'>, OutSeriesType extends Exclude<ChartSeriesType, 'sankey' | 'heatmap'> = InSeriesType>(
|
|
38
48
|
/**
|
|
39
49
|
* The set of series types compatible with this navigation action.
|
|
40
50
|
*/
|
|
41
|
-
compatibleSeriesTypes: Set<OutSeriesType>): (currentItem:
|
|
51
|
+
compatibleSeriesTypes: Set<OutSeriesType>): (currentItem: WorkingItem | null, state: StateParameters<InSeriesType>) => ReturnedItem<OutSeriesType>;
|
|
42
52
|
export declare function createGetPreviousSeriesFocusedItem<InSeriesType extends Exclude<ChartSeriesType, 'sankey' | 'heatmap'>, OutSeriesType extends Exclude<ChartSeriesType, 'sankey' | 'heatmap'> = InSeriesType>(
|
|
43
53
|
/**
|
|
44
54
|
* The set of series types compatible with this navigation action.
|
|
45
55
|
*/
|
|
46
|
-
compatibleSeriesTypes: Set<OutSeriesType>): (currentItem:
|
|
56
|
+
compatibleSeriesTypes: Set<OutSeriesType>): (currentItem: WorkingItem | null, state: StateParameters<InSeriesType>) => ReturnedItem<OutSeriesType>;
|
|
47
57
|
export {};
|
|
@@ -1,12 +1,22 @@
|
|
|
1
1
|
import type { UseChartKeyboardNavigationSignature } from "./plugins/featurePlugins/useChartKeyboardNavigation/index.js";
|
|
2
2
|
import type { ChartState } from "./plugins/models/chart.js";
|
|
3
3
|
import type { ChartSeriesType } from "../models/seriesType/config.js";
|
|
4
|
-
import type { SeriesId
|
|
4
|
+
import type { SeriesId } from "../models/seriesType/index.js";
|
|
5
5
|
type ReturnedItem<OutSeriesType extends ChartSeriesType> = {
|
|
6
6
|
type: OutSeriesType;
|
|
7
7
|
seriesId: SeriesId;
|
|
8
8
|
dataIndex: number;
|
|
9
9
|
} | null;
|
|
10
|
+
/**
|
|
11
|
+
* The item the navigators work on. Decoupled from the public `FocusedItemIdentifier` because
|
|
12
|
+
* navigation is position-based: series keyed differently (e.g. `mapShape`, keyed by `name`)
|
|
13
|
+
* reuse these helpers by translating to a `dataIndex` at their boundary.
|
|
14
|
+
*/
|
|
15
|
+
type WorkingItem = {
|
|
16
|
+
type: Exclude<ChartSeriesType, 'sankey' | 'heatmap'>;
|
|
17
|
+
seriesId: SeriesId;
|
|
18
|
+
dataIndex?: number;
|
|
19
|
+
};
|
|
10
20
|
type StateParameters<SeriesType extends ChartSeriesType> = Pick<ChartState<[UseChartKeyboardNavigationSignature], [], SeriesType>, 'series'>;
|
|
11
21
|
export declare function createGetNextIndexFocusedItem<InSeriesType extends Exclude<ChartSeriesType, 'sankey' | 'heatmap'>, OutSeriesType extends Exclude<ChartSeriesType, 'sankey' | 'heatmap'> = InSeriesType>(
|
|
12
22
|
/**
|
|
@@ -20,7 +30,7 @@ allowCycles?: boolean,
|
|
|
20
30
|
/**
|
|
21
31
|
* If true, series max index is defined by the current series length and not all series.
|
|
22
32
|
*/
|
|
23
|
-
useCurrentSeriesMaxLength?: boolean): (currentItem:
|
|
33
|
+
useCurrentSeriesMaxLength?: boolean): (currentItem: WorkingItem | null, state: StateParameters<InSeriesType>) => ReturnedItem<OutSeriesType>;
|
|
24
34
|
export declare function createGetPreviousIndexFocusedItem<InSeriesType extends Exclude<ChartSeriesType, 'sankey' | 'heatmap'>, OutSeriesType extends Exclude<ChartSeriesType, 'sankey' | 'heatmap'> = InSeriesType>(
|
|
25
35
|
/**
|
|
26
36
|
* The set of series types compatible with this navigation action.
|
|
@@ -33,15 +43,15 @@ allowCycles?: boolean,
|
|
|
33
43
|
/**
|
|
34
44
|
* If true, series max index is defined by the current series length and not all series.
|
|
35
45
|
*/
|
|
36
|
-
useCurrentSeriesMaxLength?: boolean): (currentItem:
|
|
46
|
+
useCurrentSeriesMaxLength?: boolean): (currentItem: WorkingItem | null, state: StateParameters<InSeriesType>) => ReturnedItem<OutSeriesType>;
|
|
37
47
|
export declare function createGetNextSeriesFocusedItem<InSeriesType extends Exclude<ChartSeriesType, 'sankey' | 'heatmap'>, OutSeriesType extends Exclude<ChartSeriesType, 'sankey' | 'heatmap'> = InSeriesType>(
|
|
38
48
|
/**
|
|
39
49
|
* The set of series types compatible with this navigation action.
|
|
40
50
|
*/
|
|
41
|
-
compatibleSeriesTypes: Set<OutSeriesType>): (currentItem:
|
|
51
|
+
compatibleSeriesTypes: Set<OutSeriesType>): (currentItem: WorkingItem | null, state: StateParameters<InSeriesType>) => ReturnedItem<OutSeriesType>;
|
|
42
52
|
export declare function createGetPreviousSeriesFocusedItem<InSeriesType extends Exclude<ChartSeriesType, 'sankey' | 'heatmap'>, OutSeriesType extends Exclude<ChartSeriesType, 'sankey' | 'heatmap'> = InSeriesType>(
|
|
43
53
|
/**
|
|
44
54
|
* The set of series types compatible with this navigation action.
|
|
45
55
|
*/
|
|
46
|
-
compatibleSeriesTypes: Set<OutSeriesType>): (currentItem:
|
|
56
|
+
compatibleSeriesTypes: Set<OutSeriesType>): (currentItem: WorkingItem | null, state: StateParameters<InSeriesType>) => ReturnedItem<OutSeriesType>;
|
|
47
57
|
export {};
|
|
@@ -13,6 +13,12 @@ var _getNextNonEmptySeries = require("./plugins/featurePlugins/useChartKeyboardN
|
|
|
13
13
|
var _findVisibleDataIndex = require("./plugins/featurePlugins/useChartKeyboardNavigation/utils/findVisibleDataIndex");
|
|
14
14
|
var _seriesHasData = require("./seriesHasData");
|
|
15
15
|
var _useChartSeries = require("./plugins/corePlugins/useChartSeries/useChartSeries.selectors");
|
|
16
|
+
/**
|
|
17
|
+
* The item the navigators work on. Decoupled from the public `FocusedItemIdentifier` because
|
|
18
|
+
* navigation is position-based: series keyed differently (e.g. `mapShape`, keyed by `name`)
|
|
19
|
+
* reuse these helpers by translating to a `dataIndex` at their boundary.
|
|
20
|
+
*/
|
|
21
|
+
|
|
16
22
|
function isSeriesHidden(processedSeries, type, seriesId) {
|
|
17
23
|
const seriesItem = processedSeries[type]?.series[seriesId];
|
|
18
24
|
return Boolean(seriesItem && 'hidden' in seriesItem && seriesItem.hidden);
|
|
@@ -4,6 +4,13 @@ import { getNextNonEmptySeries } from "./plugins/featurePlugins/useChartKeyboard
|
|
|
4
4
|
import { findVisibleDataIndex } from "./plugins/featurePlugins/useChartKeyboardNavigation/utils/findVisibleDataIndex.mjs";
|
|
5
5
|
import { seriesHasData } from "./seriesHasData.mjs";
|
|
6
6
|
import { selectorChartSeriesProcessed } from "./plugins/corePlugins/useChartSeries/useChartSeries.selectors.mjs";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* The item the navigators work on. Decoupled from the public `FocusedItemIdentifier` because
|
|
10
|
+
* navigation is position-based: series keyed differently (e.g. `mapShape`, keyed by `name`)
|
|
11
|
+
* reuse these helpers by translating to a `dataIndex` at their boundary.
|
|
12
|
+
*/
|
|
13
|
+
|
|
7
14
|
function isSeriesHidden(processedSeries, type, seriesId) {
|
|
8
15
|
const seriesItem = processedSeries[type]?.series[seriesId];
|
|
9
16
|
return Boolean(seriesItem && 'hidden' in seriesItem && seriesItem.hidden);
|
|
@@ -2,7 +2,11 @@ import type { ChartSeriesType } from "../models/seriesType/config.mjs";
|
|
|
2
2
|
/**
|
|
3
3
|
* Create a keyboard focus handler for common use cases where focused item are defined by the series is and data index.
|
|
4
4
|
*/
|
|
5
|
-
export declare function createCommonKeyboardFocusHandler<SeriesType extends Exclude<ChartSeriesType, 'sankey' | 'heatmap'>, TInputSeriesType extends Exclude<ChartSeriesType, 'sankey' | 'heatmap'> = SeriesType>(outSeriesTypes: Set<SeriesType>, allowCycles?: boolean, useCurrentSeriesMaxLength?: boolean): (event: KeyboardEvent) => ((currentItem:
|
|
5
|
+
export declare function createCommonKeyboardFocusHandler<SeriesType extends Exclude<ChartSeriesType, 'sankey' | 'heatmap'>, TInputSeriesType extends Exclude<ChartSeriesType, 'sankey' | 'heatmap'> = SeriesType>(outSeriesTypes: Set<SeriesType>, allowCycles?: boolean, useCurrentSeriesMaxLength?: boolean): (event: KeyboardEvent) => ((currentItem: {
|
|
6
|
+
type: Exclude<ChartSeriesType, "sankey" | "heatmap">;
|
|
7
|
+
seriesId: import("../index.mjs").SeriesId;
|
|
8
|
+
dataIndex?: number;
|
|
9
|
+
} | null, state: {
|
|
6
10
|
series: {
|
|
7
11
|
defaultizedSeries: import("./plugins/corePlugins/useChartSeries/useChartSeries.types.mjs").DefaultizedSeriesGroups<TInputSeriesType>;
|
|
8
12
|
idToType: import("./index.mjs").SeriesIdToType;
|
|
@@ -2,7 +2,11 @@ import type { ChartSeriesType } from "../models/seriesType/config.js";
|
|
|
2
2
|
/**
|
|
3
3
|
* Create a keyboard focus handler for common use cases where focused item are defined by the series is and data index.
|
|
4
4
|
*/
|
|
5
|
-
export declare function createCommonKeyboardFocusHandler<SeriesType extends Exclude<ChartSeriesType, 'sankey' | 'heatmap'>, TInputSeriesType extends Exclude<ChartSeriesType, 'sankey' | 'heatmap'> = SeriesType>(outSeriesTypes: Set<SeriesType>, allowCycles?: boolean, useCurrentSeriesMaxLength?: boolean): (event: KeyboardEvent) => ((currentItem:
|
|
5
|
+
export declare function createCommonKeyboardFocusHandler<SeriesType extends Exclude<ChartSeriesType, 'sankey' | 'heatmap'>, TInputSeriesType extends Exclude<ChartSeriesType, 'sankey' | 'heatmap'> = SeriesType>(outSeriesTypes: Set<SeriesType>, allowCycles?: boolean, useCurrentSeriesMaxLength?: boolean): (event: KeyboardEvent) => ((currentItem: {
|
|
6
|
+
type: Exclude<ChartSeriesType, "sankey" | "heatmap">;
|
|
7
|
+
seriesId: import("../index.js").SeriesId;
|
|
8
|
+
dataIndex?: number;
|
|
9
|
+
} | null, state: {
|
|
6
10
|
series: {
|
|
7
11
|
defaultizedSeries: import("./plugins/corePlugins/useChartSeries/useChartSeries.types.js").DefaultizedSeriesGroups<TInputSeriesType>;
|
|
8
12
|
idToType: import("./index.js").SeriesIdToType;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { AxisGroup } from "../models/axis.mjs";
|
|
2
|
+
export declare const getGroupingConfig: (groups: AxisGroup[], groupIndex: number, tickSize: number | undefined, computedGroupTickSizes?: number[]) => {
|
|
3
|
+
tickSize: number;
|
|
4
|
+
getValue: (value: any, dataIndex: number) => string | number | Date;
|
|
5
|
+
tickLabelStyle?: import("../index.mjs").ChartsTextProps["style"];
|
|
6
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { AxisGroup } from "../models/axis.js";
|
|
2
|
+
export declare const getGroupingConfig: (groups: AxisGroup[], groupIndex: number, tickSize: number | undefined, computedGroupTickSizes?: number[]) => {
|
|
3
|
+
tickSize: number;
|
|
4
|
+
getValue: (value: any, dataIndex: number) => string | number | Date;
|
|
5
|
+
tickLabelStyle?: import("../index.js").ChartsTextProps["style"];
|
|
6
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.getGroupingConfig = void 0;
|
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
+
const DEFAULT_GROUPING_CONFIG = {
|
|
10
|
+
tickSize: 6
|
|
11
|
+
};
|
|
12
|
+
const getGroupingConfig = (groups, groupIndex, tickSize, computedGroupTickSizes) => {
|
|
13
|
+
const config = groups[groupIndex] ?? {};
|
|
14
|
+
const defaultTickSize = tickSize ?? DEFAULT_GROUPING_CONFIG.tickSize;
|
|
15
|
+
const calculatedTickSize = defaultTickSize * groupIndex * 2 + defaultTickSize;
|
|
16
|
+
return (0, _extends2.default)({}, DEFAULT_GROUPING_CONFIG, config, {
|
|
17
|
+
tickSize: computedGroupTickSizes?.[groupIndex] ?? config.tickSize ?? calculatedTickSize
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
exports.getGroupingConfig = getGroupingConfig;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
const DEFAULT_GROUPING_CONFIG = {
|
|
3
|
+
tickSize: 6
|
|
4
|
+
};
|
|
5
|
+
export const getGroupingConfig = (groups, groupIndex, tickSize, computedGroupTickSizes) => {
|
|
6
|
+
const config = groups[groupIndex] ?? {};
|
|
7
|
+
const defaultTickSize = tickSize ?? DEFAULT_GROUPING_CONFIG.tickSize;
|
|
8
|
+
const calculatedTickSize = defaultTickSize * groupIndex * 2 + defaultTickSize;
|
|
9
|
+
return _extends({}, DEFAULT_GROUPING_CONFIG, config, {
|
|
10
|
+
tickSize: computedGroupTickSizes?.[groupIndex] ?? config.tickSize ?? calculatedTickSize
|
|
11
|
+
});
|
|
12
|
+
};
|
|
@@ -33,6 +33,7 @@ export declare const selectorChartSeriesConfigGetter: (args_0: import("../useCha
|
|
|
33
33
|
tooltipGetter: import("../useChartSeriesConfig/index.mjs").TooltipGetter<"pie">;
|
|
34
34
|
ItemTooltipContent?: import("react").ComponentType<import("../useChartSeriesConfig/index.mjs").ItemTooltipContentProps<"pie">> | undefined;
|
|
35
35
|
tooltipItemPositionGetter?: import("../useChartSeriesConfig/index.mjs").TooltipItemPositionGetter<"pie"> | undefined;
|
|
36
|
+
selectorTooltipItemPosition?: import("../useChartSeriesConfig/index.mjs").TooltipItemPositionSelector;
|
|
36
37
|
getSeriesWithDefaultValues: import("../useChartSeriesConfig/index.mjs").GetSeriesWithDefaultValues<"pie">;
|
|
37
38
|
keyboardFocusHandler?: import("../../../index.mjs").KeyboardFocusHandler<"pie"> | undefined;
|
|
38
39
|
identifierSerializer: import("../useChartSeriesConfig/index.mjs").IdentifierSerializer<"pie">;
|
|
@@ -33,6 +33,7 @@ export declare const selectorChartSeriesConfigGetter: (args_0: import("../useCha
|
|
|
33
33
|
tooltipGetter: import("../useChartSeriesConfig/index.js").TooltipGetter<"pie">;
|
|
34
34
|
ItemTooltipContent?: import("react").ComponentType<import("../useChartSeriesConfig/index.js").ItemTooltipContentProps<"pie">> | undefined;
|
|
35
35
|
tooltipItemPositionGetter?: import("../useChartSeriesConfig/index.js").TooltipItemPositionGetter<"pie"> | undefined;
|
|
36
|
+
selectorTooltipItemPosition?: import("../useChartSeriesConfig/index.js").TooltipItemPositionSelector;
|
|
36
37
|
getSeriesWithDefaultValues: import("../useChartSeriesConfig/index.js").GetSeriesWithDefaultValues<"pie">;
|
|
37
38
|
keyboardFocusHandler?: import("../../../index.js").KeyboardFocusHandler<"pie"> | undefined;
|
|
38
39
|
identifierSerializer: import("../useChartSeriesConfig/index.js").IdentifierSerializer<"pie">;
|
|
@@ -6,7 +6,7 @@ import type { ChartSeriesType } from "../../../../../models/seriesType/config.mj
|
|
|
6
6
|
* Map data index to a color.
|
|
7
7
|
* If dataIndex is not defined, it falls back to the series color when defined.
|
|
8
8
|
*/
|
|
9
|
-
export type ColorGetter<SeriesType extends ChartSeriesType> = SeriesType extends 'pie' | 'funnel' ? (dataIndex: number) => string : SeriesType extends 'heatmap' ? (value: number | null) => string : SeriesType extends 'mapShape' ? (
|
|
9
|
+
export type ColorGetter<SeriesType extends ChartSeriesType> = SeriesType extends 'pie' | 'funnel' ? (dataIndex: number) => string : SeriesType extends 'heatmap' ? (value: number | null) => string : SeriesType extends 'mapShape' ? (name?: string) => string | null : (dataIndex?: number) => string;
|
|
10
10
|
export type ColorProcessor<SeriesType extends ChartSeriesType> = (series: DefaultizedSeriesType<SeriesType>,
|
|
11
11
|
/**
|
|
12
12
|
* Either the x-axis or rotation-axis, depending on the coordinate system.
|
|
@@ -6,7 +6,7 @@ import type { ChartSeriesType } from "../../../../../models/seriesType/config.js
|
|
|
6
6
|
* Map data index to a color.
|
|
7
7
|
* If dataIndex is not defined, it falls back to the series color when defined.
|
|
8
8
|
*/
|
|
9
|
-
export type ColorGetter<SeriesType extends ChartSeriesType> = SeriesType extends 'pie' | 'funnel' ? (dataIndex: number) => string : SeriesType extends 'heatmap' ? (value: number | null) => string : SeriesType extends 'mapShape' ? (
|
|
9
|
+
export type ColorGetter<SeriesType extends ChartSeriesType> = SeriesType extends 'pie' | 'funnel' ? (dataIndex: number) => string : SeriesType extends 'heatmap' ? (value: number | null) => string : SeriesType extends 'mapShape' ? (name?: string) => string | null : (dataIndex?: number) => string;
|
|
10
10
|
export type ColorProcessor<SeriesType extends ChartSeriesType> = (series: DefaultizedSeriesType<SeriesType>,
|
|
11
11
|
/**
|
|
12
12
|
* Either the x-axis or rotation-axis, depending on the coordinate system.
|
|
@@ -7,7 +7,7 @@ import type { LegendGetter } from "./legendGetter.types.mjs";
|
|
|
7
7
|
import type { AxisTooltipGetter, TooltipGetter } from "./tooltipGetter.types.mjs";
|
|
8
8
|
import type { PolarExtremumGetter } from "./polarExtremumGetter.types.mjs";
|
|
9
9
|
import type { GetSeriesWithDefaultValues } from "./getSeriesWithDefaultValues.types.mjs";
|
|
10
|
-
import type { TooltipItemPositionGetter } from "./tooltipItemPositionGetter.types.mjs";
|
|
10
|
+
import type { TooltipItemPositionGetter, TooltipItemPositionSelector } from "./tooltipItemPositionGetter.types.mjs";
|
|
11
11
|
import type { SeriesLayoutGetter } from "./seriesLayout.types.mjs";
|
|
12
12
|
import type { KeyboardFocusHandler } from "../../../featurePlugins/useChartKeyboardNavigation/keyboardFocusHandler.types.mjs";
|
|
13
13
|
import type { IdentifierSerializer } from "./identifierSerializer.types.mjs";
|
|
@@ -34,6 +34,12 @@ export type ChartSeriesTypeConfig<SeriesType extends ChartSeriesType> = {
|
|
|
34
34
|
tooltipGetter: TooltipGetter<SeriesType>;
|
|
35
35
|
ItemTooltipContent?: React.ComponentType<ItemTooltipContentProps<SeriesType>>;
|
|
36
36
|
tooltipItemPositionGetter?: TooltipItemPositionGetter<SeriesType>;
|
|
37
|
+
/**
|
|
38
|
+
* Computes the item tooltip position from the chart state, for series types
|
|
39
|
+
* whose position depends on state the core tooltip plugin doesn't track.
|
|
40
|
+
* Takes precedence over `tooltipItemPositionGetter`.
|
|
41
|
+
*/
|
|
42
|
+
selectorTooltipItemPosition?: TooltipItemPositionSelector;
|
|
37
43
|
getSeriesWithDefaultValues: GetSeriesWithDefaultValues<SeriesType>;
|
|
38
44
|
keyboardFocusHandler?: KeyboardFocusHandler<SeriesType>;
|
|
39
45
|
/**
|
|
@@ -7,7 +7,7 @@ import type { LegendGetter } from "./legendGetter.types.js";
|
|
|
7
7
|
import type { AxisTooltipGetter, TooltipGetter } from "./tooltipGetter.types.js";
|
|
8
8
|
import type { PolarExtremumGetter } from "./polarExtremumGetter.types.js";
|
|
9
9
|
import type { GetSeriesWithDefaultValues } from "./getSeriesWithDefaultValues.types.js";
|
|
10
|
-
import type { TooltipItemPositionGetter } from "./tooltipItemPositionGetter.types.js";
|
|
10
|
+
import type { TooltipItemPositionGetter, TooltipItemPositionSelector } from "./tooltipItemPositionGetter.types.js";
|
|
11
11
|
import type { SeriesLayoutGetter } from "./seriesLayout.types.js";
|
|
12
12
|
import type { KeyboardFocusHandler } from "../../../featurePlugins/useChartKeyboardNavigation/keyboardFocusHandler.types.js";
|
|
13
13
|
import type { IdentifierSerializer } from "./identifierSerializer.types.js";
|
|
@@ -34,6 +34,12 @@ export type ChartSeriesTypeConfig<SeriesType extends ChartSeriesType> = {
|
|
|
34
34
|
tooltipGetter: TooltipGetter<SeriesType>;
|
|
35
35
|
ItemTooltipContent?: React.ComponentType<ItemTooltipContentProps<SeriesType>>;
|
|
36
36
|
tooltipItemPositionGetter?: TooltipItemPositionGetter<SeriesType>;
|
|
37
|
+
/**
|
|
38
|
+
* Computes the item tooltip position from the chart state, for series types
|
|
39
|
+
* whose position depends on state the core tooltip plugin doesn't track.
|
|
40
|
+
* Takes precedence over `tooltipItemPositionGetter`.
|
|
41
|
+
*/
|
|
42
|
+
selectorTooltipItemPosition?: TooltipItemPositionSelector;
|
|
37
43
|
getSeriesWithDefaultValues: GetSeriesWithDefaultValues<SeriesType>;
|
|
38
44
|
keyboardFocusHandler?: KeyboardFocusHandler<SeriesType>;
|
|
39
45
|
/**
|
|
@@ -1,21 +1,18 @@
|
|
|
1
|
-
import type { ExtendedFeatureCollection, GeoProjection } from '@mui/x-charts-vendor/d3-geo';
|
|
2
1
|
import type { SeriesItemIdentifierWithType } from "../../../../../models/seriesType/index.mjs";
|
|
3
2
|
import type { ChartSeriesType } from "../../../../../models/seriesType/config.mjs";
|
|
4
3
|
import type { ChartsRotationAxisProps, ChartsRadiusAxisProps, ComputedXAxis, ComputedYAxis } from "../../../../../models/axis.mjs";
|
|
5
4
|
import type { ChartDrawingArea } from "../../../../../hooks/useDrawingArea.mjs";
|
|
6
5
|
import type { ProcessedSeries, SeriesLayout } from "../../useChartSeries/index.mjs";
|
|
7
6
|
import type { ComputeResult } from "../../../featurePlugins/useChartPolarAxis/computeAxisValue.mjs";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
};
|
|
7
|
+
import type { ChartState } from "../../../models/index.mjs";
|
|
8
|
+
import type { UseChartCartesianAxisSignature } from "../../../featurePlugins/useChartCartesianAxis/index.mjs";
|
|
9
|
+
import type { UseChartInteractionSignature } from "../../../featurePlugins/useChartInteraction/index.mjs";
|
|
10
|
+
import type { UseChartTooltipSignature } from "../../../featurePlugins/useChartTooltip/index.mjs";
|
|
13
11
|
export interface TooltipPositionGetterAxesConfig {
|
|
14
12
|
x?: ComputedXAxis;
|
|
15
13
|
y?: ComputedYAxis;
|
|
16
14
|
rotationAxes?: ComputeResult<ChartsRotationAxisProps>;
|
|
17
15
|
radiusAxes?: ComputeResult<ChartsRadiusAxisProps>;
|
|
18
|
-
geo?: GeoTooltipPosition;
|
|
19
16
|
}
|
|
20
17
|
export type TooltipItemPositionGetter<SeriesType extends ChartSeriesType> = (params: {
|
|
21
18
|
series: ProcessedSeries<SeriesType>;
|
|
@@ -31,4 +28,18 @@ export type TooltipItemPositionGetter<SeriesType extends ChartSeriesType> = (par
|
|
|
31
28
|
}) => {
|
|
32
29
|
x: number;
|
|
33
30
|
y: number;
|
|
31
|
+
} | null;
|
|
32
|
+
/**
|
|
33
|
+
* Computes the anchor position of an item tooltip from the chart state. Series
|
|
34
|
+
* types whose position depends on state the core tooltip plugin doesn't track
|
|
35
|
+
* (e.g. the geo projection for map series) provide one of these instead of a
|
|
36
|
+
* `tooltipItemPositionGetter`, so the dependency is memoized correctly and the
|
|
37
|
+
* feature-specific code stays out of the core bundle.
|
|
38
|
+
* @param {ChartState} state The chart state.
|
|
39
|
+
* @param {'top' | 'bottom' | 'left' | 'right' | undefined} position The preferred placement of the tooltip.
|
|
40
|
+
* @returns {{ x: number; y: number } | null} The tooltip anchor position, or `null` when it cannot be computed.
|
|
41
|
+
*/
|
|
42
|
+
export type TooltipItemPositionSelector = (state: ChartState<[UseChartCartesianAxisSignature, UseChartInteractionSignature, UseChartTooltipSignature]>, position: 'top' | 'bottom' | 'left' | 'right' | undefined) => {
|
|
43
|
+
x: number;
|
|
44
|
+
y: number;
|
|
34
45
|
} | null;
|
|
@@ -1,21 +1,18 @@
|
|
|
1
|
-
import type { ExtendedFeatureCollection, GeoProjection } from '@mui/x-charts-vendor/d3-geo';
|
|
2
1
|
import type { SeriesItemIdentifierWithType } from "../../../../../models/seriesType/index.js";
|
|
3
2
|
import type { ChartSeriesType } from "../../../../../models/seriesType/config.js";
|
|
4
3
|
import type { ChartsRotationAxisProps, ChartsRadiusAxisProps, ComputedXAxis, ComputedYAxis } from "../../../../../models/axis.js";
|
|
5
4
|
import type { ChartDrawingArea } from "../../../../../hooks/useDrawingArea.js";
|
|
6
5
|
import type { ProcessedSeries, SeriesLayout } from "../../useChartSeries/index.js";
|
|
7
6
|
import type { ComputeResult } from "../../../featurePlugins/useChartPolarAxis/computeAxisValue.js";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
};
|
|
7
|
+
import type { ChartState } from "../../../models/index.js";
|
|
8
|
+
import type { UseChartCartesianAxisSignature } from "../../../featurePlugins/useChartCartesianAxis/index.js";
|
|
9
|
+
import type { UseChartInteractionSignature } from "../../../featurePlugins/useChartInteraction/index.js";
|
|
10
|
+
import type { UseChartTooltipSignature } from "../../../featurePlugins/useChartTooltip/index.js";
|
|
13
11
|
export interface TooltipPositionGetterAxesConfig {
|
|
14
12
|
x?: ComputedXAxis;
|
|
15
13
|
y?: ComputedYAxis;
|
|
16
14
|
rotationAxes?: ComputeResult<ChartsRotationAxisProps>;
|
|
17
15
|
radiusAxes?: ComputeResult<ChartsRadiusAxisProps>;
|
|
18
|
-
geo?: GeoTooltipPosition;
|
|
19
16
|
}
|
|
20
17
|
export type TooltipItemPositionGetter<SeriesType extends ChartSeriesType> = (params: {
|
|
21
18
|
series: ProcessedSeries<SeriesType>;
|
|
@@ -31,4 +28,18 @@ export type TooltipItemPositionGetter<SeriesType extends ChartSeriesType> = (par
|
|
|
31
28
|
}) => {
|
|
32
29
|
x: number;
|
|
33
30
|
y: number;
|
|
31
|
+
} | null;
|
|
32
|
+
/**
|
|
33
|
+
* Computes the anchor position of an item tooltip from the chart state. Series
|
|
34
|
+
* types whose position depends on state the core tooltip plugin doesn't track
|
|
35
|
+
* (e.g. the geo projection for map series) provide one of these instead of a
|
|
36
|
+
* `tooltipItemPositionGetter`, so the dependency is memoized correctly and the
|
|
37
|
+
* feature-specific code stays out of the core bundle.
|
|
38
|
+
* @param {ChartState} state The chart state.
|
|
39
|
+
* @param {'top' | 'bottom' | 'left' | 'right' | undefined} position The preferred placement of the tooltip.
|
|
40
|
+
* @returns {{ x: number; y: number } | null} The tooltip anchor position, or `null` when it cannot be computed.
|
|
41
|
+
*/
|
|
42
|
+
export type TooltipItemPositionSelector = (state: ChartState<[UseChartCartesianAxisSignature, UseChartInteractionSignature, UseChartTooltipSignature]>, position: 'top' | 'bottom' | 'left' | 'right' | undefined) => {
|
|
43
|
+
x: number;
|
|
44
|
+
y: number;
|
|
34
45
|
} | null;
|
|
@@ -4,4 +4,4 @@ import type { ChartSeriesType, HighlightScope } from "../../../../models/seriesT
|
|
|
4
4
|
/**
|
|
5
5
|
* The isFade logic for main charts (those that are identified by an id and a dataIndex)
|
|
6
6
|
*/
|
|
7
|
-
export declare function createIsFaded<SeriesType extends Exclude<ChartSeriesType, 'sankey' | 'heatmap'>>(highlightScope: HighlightScope<SeriesType> | null | undefined, highlightedItem: HighlightItemIdentifier<SeriesType> | null): <TestedSeriesType extends ComposableChartSeriesType<SeriesType>>(item: HighlightItemIdentifierWithType<TestedSeriesType> | null) => boolean;
|
|
7
|
+
export declare function createIsFaded<SeriesType extends Exclude<ChartSeriesType, 'sankey' | 'heatmap' | 'mapShape'>>(highlightScope: HighlightScope<SeriesType> | null | undefined, highlightedItem: HighlightItemIdentifier<SeriesType> | null): <TestedSeriesType extends ComposableChartSeriesType<SeriesType>>(item: HighlightItemIdentifierWithType<TestedSeriesType> | null) => boolean;
|
|
@@ -4,4 +4,4 @@ import type { ChartSeriesType, HighlightScope } from "../../../../models/seriesT
|
|
|
4
4
|
/**
|
|
5
5
|
* The isFade logic for main charts (those that are identified by an id and a dataIndex)
|
|
6
6
|
*/
|
|
7
|
-
export declare function createIsFaded<SeriesType extends Exclude<ChartSeriesType, 'sankey' | 'heatmap'>>(highlightScope: HighlightScope<SeriesType> | null | undefined, highlightedItem: HighlightItemIdentifier<SeriesType> | null): <TestedSeriesType extends ComposableChartSeriesType<SeriesType>>(item: HighlightItemIdentifierWithType<TestedSeriesType> | null) => boolean;
|
|
7
|
+
export declare function createIsFaded<SeriesType extends Exclude<ChartSeriesType, 'sankey' | 'heatmap' | 'mapShape'>>(highlightScope: HighlightScope<SeriesType> | null | undefined, highlightedItem: HighlightItemIdentifier<SeriesType> | null): <TestedSeriesType extends ComposableChartSeriesType<SeriesType>>(item: HighlightItemIdentifierWithType<TestedSeriesType> | null) => boolean;
|
|
@@ -4,4 +4,4 @@ import type { ChartSeriesType, HighlightScope } from "../../../../models/seriesT
|
|
|
4
4
|
/**
|
|
5
5
|
* The isHighlighted logic for main charts (those that are identified by an id and a dataIndex)
|
|
6
6
|
*/
|
|
7
|
-
export declare function createIsHighlighted<SeriesType extends Exclude<ChartSeriesType, 'sankey' | 'heatmap'>>(highlightScope: HighlightScope<SeriesType> | null | undefined, highlightedItem: HighlightItemIdentifierWithType<SeriesType> | null): <TestedSeriesType extends ComposableChartSeriesType<SeriesType>>(item: HighlightItemIdentifierWithType<TestedSeriesType> | null) => boolean;
|
|
7
|
+
export declare function createIsHighlighted<SeriesType extends Exclude<ChartSeriesType, 'sankey' | 'heatmap' | 'mapShape'>>(highlightScope: HighlightScope<SeriesType> | null | undefined, highlightedItem: HighlightItemIdentifierWithType<SeriesType> | null): <TestedSeriesType extends ComposableChartSeriesType<SeriesType>>(item: HighlightItemIdentifierWithType<TestedSeriesType> | null) => boolean;
|
|
@@ -4,4 +4,4 @@ import type { ChartSeriesType, HighlightScope } from "../../../../models/seriesT
|
|
|
4
4
|
/**
|
|
5
5
|
* The isHighlighted logic for main charts (those that are identified by an id and a dataIndex)
|
|
6
6
|
*/
|
|
7
|
-
export declare function createIsHighlighted<SeriesType extends Exclude<ChartSeriesType, 'sankey' | 'heatmap'>>(highlightScope: HighlightScope<SeriesType> | null | undefined, highlightedItem: HighlightItemIdentifierWithType<SeriesType> | null): <TestedSeriesType extends ComposableChartSeriesType<SeriesType>>(item: HighlightItemIdentifierWithType<TestedSeriesType> | null) => boolean;
|
|
7
|
+
export declare function createIsHighlighted<SeriesType extends Exclude<ChartSeriesType, 'sankey' | 'heatmap' | 'mapShape'>>(highlightScope: HighlightScope<SeriesType> | null | undefined, highlightedItem: HighlightItemIdentifierWithType<SeriesType> | null): <TestedSeriesType extends ComposableChartSeriesType<SeriesType>>(item: HighlightItemIdentifierWithType<TestedSeriesType> | null) => boolean;
|
|
@@ -12,7 +12,7 @@ export declare const selectorChartsTooltipItemIsDefined: (args_0: import("../../
|
|
|
12
12
|
}) => boolean;
|
|
13
13
|
export declare const selectorChartsTooltipItemPosition: (args_0: import("../../corePlugins/useChartId/useChartId.types.mjs").UseChartIdState & import("../../corePlugins/useChartSeriesConfig/useChartSeriesConfig.types.mjs").UseChartSeriesConfigState<keyof import("../../../index.mjs").ChartsSeriesConfig> & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.mjs").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.mjs").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.mjs").UseChartSeriesState<keyof import("../../../index.mjs").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.mjs").UseChartAnimationState & import("../../../index.mjs").UseChartInteractionListenerState & Partial<import("../useChartInteraction/useChartInteraction.types.mjs").UseChartInteractionState> & {
|
|
14
14
|
cacheKey: import("../../models/index.mjs").ChartStateCacheKey;
|
|
15
|
-
}, placement: "bottom" | "left" | "right" | "top") => {
|
|
15
|
+
}, placement: "bottom" | "left" | "right" | "top" | undefined) => {
|
|
16
16
|
x: number;
|
|
17
17
|
y: number;
|
|
18
18
|
} | null;
|
|
@@ -12,7 +12,7 @@ export declare const selectorChartsTooltipItemIsDefined: (args_0: import("../../
|
|
|
12
12
|
}) => boolean;
|
|
13
13
|
export declare const selectorChartsTooltipItemPosition: (args_0: import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & import("../../corePlugins/useChartSeriesConfig/useChartSeriesConfig.types.js").UseChartSeriesConfigState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.js").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../../../index.js").UseChartInteractionListenerState & Partial<import("../useChartInteraction/useChartInteraction.types.js").UseChartInteractionState> & {
|
|
14
14
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
15
|
-
}, placement: "bottom" | "left" | "right" | "top") => {
|
|
15
|
+
}, placement: "bottom" | "left" | "right" | "top" | undefined) => {
|
|
16
16
|
x: number;
|
|
17
17
|
y: number;
|
|
18
18
|
} | null;
|
|
@@ -13,19 +13,18 @@ var _useChartInteraction = require("../useChartInteraction/useChartInteraction.s
|
|
|
13
13
|
var _useChartDimensions = require("../../corePlugins/useChartDimensions/useChartDimensions.selectors");
|
|
14
14
|
var _isCartesian = require("../../../isCartesian");
|
|
15
15
|
var _useChartPolarAxis = require("../useChartPolarAxis/useChartPolarAxis.selectors");
|
|
16
|
-
var _useGeoProjection = require("../useGeoProjection/useGeoProjection.selectors");
|
|
17
16
|
const selectTooltip = state => state.tooltip;
|
|
18
17
|
const selectorChartsTooltipPointerItem = exports.selectorChartsTooltipPointerItem = (0, _store.createSelector)(selectTooltip, tooltip => tooltip?.item ?? null);
|
|
19
18
|
const selectorChartsTooltipPointerItemIsDefined = exports.selectorChartsTooltipPointerItemIsDefined = (0, _store.createSelector)(selectorChartsTooltipPointerItem, item => item !== null);
|
|
20
19
|
const selectorChartsTooltipItem = exports.selectorChartsTooltipItem = (0, _store.createSelector)(_useChartInteraction.selectorChartsLastInteraction, selectorChartsTooltipPointerItem, _useChartKeyboardNavigation.selectorChartsKeyboardItem, (lastInteraction, pointerItem, keyboardItem) => lastInteraction === 'keyboard' ? keyboardItem : pointerItem ?? null);
|
|
21
20
|
const selectorChartsTooltipItemIsDefined = exports.selectorChartsTooltipItemIsDefined = (0, _store.createSelector)(_useChartInteraction.selectorChartsLastInteraction, selectorChartsTooltipPointerItemIsDefined, _useChartKeyboardNavigation.selectorChartsHasFocusedItem, (lastInteraction, pointerItemIsDefined, keyboardItemIsDefined) => lastInteraction === 'keyboard' ? keyboardItemIsDefined : pointerItemIsDefined);
|
|
22
|
-
const selectorChartsTooltipAxisConfig = (0, _store.createSelectorMemoized)(selectorChartsTooltipItem, _useChartCartesianAxisRendering.selectorChartXAxis, _useChartCartesianAxisRendering.selectorChartYAxis, _useChartPolarAxis.selectorChartRotationAxis, _useChartPolarAxis.selectorChartRadiusAxis, _useChartSeries.selectorChartSeriesProcessed,
|
|
21
|
+
const selectorChartsTooltipAxisConfig = (0, _store.createSelectorMemoized)(selectorChartsTooltipItem, _useChartCartesianAxisRendering.selectorChartXAxis, _useChartCartesianAxisRendering.selectorChartYAxis, _useChartPolarAxis.selectorChartRotationAxis, _useChartPolarAxis.selectorChartRadiusAxis, _useChartSeries.selectorChartSeriesProcessed, function selectorChartsTooltipAxisConfig(identifier, {
|
|
23
22
|
axis: xAxis,
|
|
24
23
|
axisIds: xAxisIds
|
|
25
24
|
}, {
|
|
26
25
|
axis: yAxis,
|
|
27
26
|
axisIds: yAxisIds
|
|
28
|
-
}, rotationAxes, radiusAxes, series
|
|
27
|
+
}, rotationAxes, radiusAxes, series) {
|
|
29
28
|
if (!identifier) {
|
|
30
29
|
return {};
|
|
31
30
|
}
|
|
@@ -45,9 +44,6 @@ const selectorChartsTooltipAxisConfig = (0, _store.createSelectorMemoized)(selec
|
|
|
45
44
|
if (yAxisId !== undefined) {
|
|
46
45
|
axesConfig.y = yAxis[yAxisId];
|
|
47
46
|
}
|
|
48
|
-
if (geo) {
|
|
49
|
-
axesConfig.geo = geo;
|
|
50
|
-
}
|
|
51
47
|
return axesConfig;
|
|
52
48
|
});
|
|
53
49
|
const selectorChartsTooltipItemPosition = exports.selectorChartsTooltipItemPosition = (0, _store.createSelectorMemoized)(selectorChartsTooltipItem, _useChartDimensions.selectorChartDrawingArea, _useChartSeriesConfig.selectorChartSeriesConfig, _useChartSeries.selectorChartSeriesProcessed, _useChartSeries.selectorChartSeriesLayout, selectorChartsTooltipAxisConfig, function selectorChartsTooltipItemPosition(identifier, drawingArea, seriesConfig, series, seriesLayout, axesConfig, placement) {
|
|
@@ -64,6 +60,6 @@ const selectorChartsTooltipItemPosition = exports.selectorChartsTooltipItemPosit
|
|
|
64
60
|
drawingArea,
|
|
65
61
|
axesConfig,
|
|
66
62
|
identifier,
|
|
67
|
-
placement
|
|
63
|
+
placement: placement ?? 'top'
|
|
68
64
|
}) ?? null;
|
|
69
65
|
});
|
|
@@ -7,19 +7,18 @@ import { selectorChartsLastInteraction } from "../useChartInteraction/useChartIn
|
|
|
7
7
|
import { selectorChartDrawingArea } from "../../corePlugins/useChartDimensions/useChartDimensions.selectors.mjs";
|
|
8
8
|
import { isCartesianSeries } from "../../../isCartesian.mjs";
|
|
9
9
|
import { selectorChartRadiusAxis, selectorChartRotationAxis } from "../useChartPolarAxis/useChartPolarAxis.selectors.mjs";
|
|
10
|
-
import { selectorGeoTooltipPosition } from "../useGeoProjection/useGeoProjection.selectors.mjs";
|
|
11
10
|
const selectTooltip = state => state.tooltip;
|
|
12
11
|
export const selectorChartsTooltipPointerItem = createSelector(selectTooltip, tooltip => tooltip?.item ?? null);
|
|
13
12
|
export const selectorChartsTooltipPointerItemIsDefined = createSelector(selectorChartsTooltipPointerItem, item => item !== null);
|
|
14
13
|
export const selectorChartsTooltipItem = createSelector(selectorChartsLastInteraction, selectorChartsTooltipPointerItem, selectorChartsKeyboardItem, (lastInteraction, pointerItem, keyboardItem) => lastInteraction === 'keyboard' ? keyboardItem : pointerItem ?? null);
|
|
15
14
|
export const selectorChartsTooltipItemIsDefined = createSelector(selectorChartsLastInteraction, selectorChartsTooltipPointerItemIsDefined, selectorChartsHasFocusedItem, (lastInteraction, pointerItemIsDefined, keyboardItemIsDefined) => lastInteraction === 'keyboard' ? keyboardItemIsDefined : pointerItemIsDefined);
|
|
16
|
-
const selectorChartsTooltipAxisConfig = createSelectorMemoized(selectorChartsTooltipItem, selectorChartXAxis, selectorChartYAxis, selectorChartRotationAxis, selectorChartRadiusAxis, selectorChartSeriesProcessed,
|
|
15
|
+
const selectorChartsTooltipAxisConfig = createSelectorMemoized(selectorChartsTooltipItem, selectorChartXAxis, selectorChartYAxis, selectorChartRotationAxis, selectorChartRadiusAxis, selectorChartSeriesProcessed, function selectorChartsTooltipAxisConfig(identifier, {
|
|
17
16
|
axis: xAxis,
|
|
18
17
|
axisIds: xAxisIds
|
|
19
18
|
}, {
|
|
20
19
|
axis: yAxis,
|
|
21
20
|
axisIds: yAxisIds
|
|
22
|
-
}, rotationAxes, radiusAxes, series
|
|
21
|
+
}, rotationAxes, radiusAxes, series) {
|
|
23
22
|
if (!identifier) {
|
|
24
23
|
return {};
|
|
25
24
|
}
|
|
@@ -39,9 +38,6 @@ const selectorChartsTooltipAxisConfig = createSelectorMemoized(selectorChartsToo
|
|
|
39
38
|
if (yAxisId !== undefined) {
|
|
40
39
|
axesConfig.y = yAxis[yAxisId];
|
|
41
40
|
}
|
|
42
|
-
if (geo) {
|
|
43
|
-
axesConfig.geo = geo;
|
|
44
|
-
}
|
|
45
41
|
return axesConfig;
|
|
46
42
|
});
|
|
47
43
|
export const selectorChartsTooltipItemPosition = createSelectorMemoized(selectorChartsTooltipItem, selectorChartDrawingArea, selectorChartSeriesConfig, selectorChartSeriesProcessed, selectorChartSeriesLayout, selectorChartsTooltipAxisConfig, function selectorChartsTooltipItemPosition(identifier, drawingArea, seriesConfig, series, seriesLayout, axesConfig, placement) {
|
|
@@ -58,6 +54,6 @@ export const selectorChartsTooltipItemPosition = createSelectorMemoized(selector
|
|
|
58
54
|
drawingArea,
|
|
59
55
|
axesConfig,
|
|
60
56
|
identifier,
|
|
61
|
-
placement
|
|
57
|
+
placement: placement ?? 'top'
|
|
62
58
|
}) ?? null;
|
|
63
59
|
});
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { ExtendedFeatureCollection, GeoProjection, GeoPath } from '@mui/x-charts-vendor/d3-geo';
|
|
2
|
-
import type { D3NamedProjection, GeoProjectionInput, UseGeoProjectionSignature, UseGeoProjectionState } from "./useGeoProjection.types.mjs";
|
|
2
|
+
import type { D3NamedProjection, GeoProjectionInput, GeoTooltipPosition, UseGeoProjectionSignature, UseGeoProjectionState } from "./useGeoProjection.types.mjs";
|
|
3
3
|
import type { ChartState } from "../../models/chart.mjs";
|
|
4
|
-
import type { GeoTooltipPosition } from "../../corePlugins/useChartSeriesConfig/index.mjs";
|
|
5
4
|
export declare const selectorChartGeoProjectionState: (state: ChartState<[], [UseGeoProjectionSignature]>) => UseGeoProjectionState["geoProjection"] | undefined;
|
|
6
5
|
export declare const selectorChartGeoData: (state: ChartState<[], [UseGeoProjectionSignature]>) => ExtendedFeatureCollection | null;
|
|
7
6
|
export declare const selectorChartGeoFeatureKey: (args_0: import("../../corePlugins/useChartId/useChartId.types.mjs").UseChartIdState & import("../../corePlugins/useChartSeriesConfig/useChartSeriesConfig.types.mjs").UseChartSeriesConfigState<keyof import("../../../index.mjs").ChartsSeriesConfig> & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.mjs").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.mjs").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.mjs").UseChartSeriesState<keyof import("../../../index.mjs").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.mjs").UseChartAnimationState & import("../../../index.mjs").UseChartInteractionListenerState & Partial<UseGeoProjectionState> & {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { ExtendedFeatureCollection, GeoProjection, GeoPath } from '@mui/x-charts-vendor/d3-geo';
|
|
2
|
-
import type { D3NamedProjection, GeoProjectionInput, UseGeoProjectionSignature, UseGeoProjectionState } from "./useGeoProjection.types.js";
|
|
2
|
+
import type { D3NamedProjection, GeoProjectionInput, GeoTooltipPosition, UseGeoProjectionSignature, UseGeoProjectionState } from "./useGeoProjection.types.js";
|
|
3
3
|
import type { ChartState } from "../../models/chart.js";
|
|
4
|
-
import type { GeoTooltipPosition } from "../../corePlugins/useChartSeriesConfig/index.js";
|
|
5
4
|
export declare const selectorChartGeoProjectionState: (state: ChartState<[], [UseGeoProjectionSignature]>) => UseGeoProjectionState["geoProjection"] | undefined;
|
|
6
5
|
export declare const selectorChartGeoData: (state: ChartState<[], [UseGeoProjectionSignature]>) => ExtendedFeatureCollection | null;
|
|
7
6
|
export declare const selectorChartGeoFeatureKey: (args_0: import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & import("../../corePlugins/useChartSeriesConfig/useChartSeriesConfig.types.js").UseChartSeriesConfigState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.js").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../../../index.js").UseChartInteractionListenerState & Partial<UseGeoProjectionState> & {
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import type { GeoProjection, ExtendedFeatureCollection } from '@mui/x-charts-vendor/d3-geo';
|
|
2
2
|
import type { ChartPluginSignature } from "../../models/plugin.mjs";
|
|
3
|
+
/**
|
|
4
|
+
* Geo data used to position a map series tooltip: the resolved projection, the
|
|
5
|
+
* feature collection, and a feature-name-to-index lookup.
|
|
6
|
+
*/
|
|
7
|
+
export type GeoTooltipPosition = {
|
|
8
|
+
geoData: ExtendedFeatureCollection | null;
|
|
9
|
+
projection: GeoProjection | null;
|
|
10
|
+
featureIndexesByName: ReadonlyMap<string, number[]>;
|
|
11
|
+
};
|
|
3
12
|
export type D3NamedProjection = 'azimuthalEqualArea' | 'azimuthalEquidistant' | 'gnomonic' | 'orthographic' | 'stereographic' | 'conicConformal' | 'conicEqualArea' | 'conicEquidistant' | 'albers' | 'albersUsa' | 'equirectangular' | 'mercator' | 'transverseMercator' | 'equalEarth' | 'naturalEarth1';
|
|
4
13
|
/**
|
|
5
14
|
* A d3-geo projection accepted by `useGeoProjection`.
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import type { GeoProjection, ExtendedFeatureCollection } from '@mui/x-charts-vendor/d3-geo';
|
|
2
2
|
import type { ChartPluginSignature } from "../../models/plugin.js";
|
|
3
|
+
/**
|
|
4
|
+
* Geo data used to position a map series tooltip: the resolved projection, the
|
|
5
|
+
* feature collection, and a feature-name-to-index lookup.
|
|
6
|
+
*/
|
|
7
|
+
export type GeoTooltipPosition = {
|
|
8
|
+
geoData: ExtendedFeatureCollection | null;
|
|
9
|
+
projection: GeoProjection | null;
|
|
10
|
+
featureIndexesByName: ReadonlyMap<string, number[]>;
|
|
11
|
+
};
|
|
3
12
|
export type D3NamedProjection = 'azimuthalEqualArea' | 'azimuthalEquidistant' | 'gnomonic' | 'orthographic' | 'stereographic' | 'conicConformal' | 'conicEqualArea' | 'conicEquidistant' | 'albers' | 'albersUsa' | 'equirectangular' | 'mercator' | 'transverseMercator' | 'equalEarth' | 'naturalEarth1';
|
|
4
13
|
/**
|
|
5
14
|
* A d3-geo projection accepted by `useGeoProjection`.
|
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
* when any key has values which are not strictly equal between the arguments.
|
|
4
4
|
* Returns true when the values of all keys are strictly equal.
|
|
5
5
|
*
|
|
6
|
-
* Source: https://github.com/
|
|
6
|
+
* Source: https://github.com/react/react/blob/c2a196174763e0b4f16ed1c512ed4442b062395e/packages/shared/shallowEqual.js#L18
|
|
7
7
|
*/
|
|
8
8
|
export declare function shallowEqual(objA: unknown, objB: unknown): boolean;
|