@mui/x-charts 9.2.0 → 9.4.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.js +10 -10
- package/BarChart/BarChart.mjs +10 -10
- package/BarChart/BarElement.d.mts +3 -2
- package/BarChart/BarElement.d.ts +3 -2
- package/BarChart/BarLabel/BarLabelItem.d.mts +3 -2
- package/BarChart/BarLabel/BarLabelItem.d.ts +3 -2
- package/BarChart/seriesConfig/bar/extremums.js +7 -2
- package/BarChart/seriesConfig/bar/extremums.mjs +7 -2
- package/BarChart/seriesConfig/bar/getColor.js +7 -53
- package/BarChart/seriesConfig/bar/getColor.mjs +7 -53
- package/BarChart/seriesConfig/bar/seriesProcessor.js +3 -1
- package/BarChart/seriesConfig/bar/seriesProcessor.mjs +3 -1
- package/BarChart/seriesConfig/bar/tooltip.js +4 -27
- package/BarChart/seriesConfig/bar/tooltip.mjs +4 -27
- package/CHANGELOG.md +314 -0
- package/ChartsContainer/ChartsContainer.js +30 -9
- package/ChartsContainer/ChartsContainer.mjs +30 -9
- package/ChartsLabel/ChartsLabelMark.js +1 -23
- package/ChartsLabel/ChartsLabelMark.mjs +0 -22
- package/ChartsLabel/labelMarkClasses.d.mts +0 -1
- package/ChartsLabel/labelMarkClasses.d.ts +0 -1
- package/ChartsLabel/labelMarkClasses.js +1 -2
- package/ChartsLabel/labelMarkClasses.mjs +2 -2
- package/ChartsLayerContainer/ChartsLayerContainer.js +36 -30
- package/ChartsLayerContainer/ChartsLayerContainer.mjs +36 -30
- package/ChartsLegend/chartsLegend.types.d.mts +3 -2
- package/ChartsLegend/chartsLegend.types.d.ts +3 -2
- package/ChartsLegend/piecewiseColorLegendClasses.js +8 -2
- package/ChartsLegend/piecewiseColorLegendClasses.mjs +8 -2
- package/ChartsOverlay/ChartsOverlay.d.mts +5 -4
- package/ChartsOverlay/ChartsOverlay.d.ts +5 -4
- package/ChartsReferenceLine/ChartsXReferenceLine.js +6 -1
- package/ChartsReferenceLine/ChartsXReferenceLine.mjs +6 -1
- package/ChartsReferenceLine/ChartsYReferenceLine.js +5 -0
- package/ChartsReferenceLine/ChartsYReferenceLine.mjs +5 -0
- package/ChartsTooltip/ChartTooltip.types.d.mts +3 -2
- package/ChartsTooltip/ChartTooltip.types.d.ts +3 -2
- package/ChartsTooltip/useAxesTooltip.js +2 -2
- package/ChartsTooltip/useAxesTooltip.mjs +2 -2
- package/ChartsTooltip/useItemTooltip.js +2 -2
- package/ChartsTooltip/useItemTooltip.mjs +2 -2
- package/ChartsXAxis/ChartsXAxis.js +3 -1
- package/ChartsXAxis/ChartsXAxis.mjs +3 -1
- package/ChartsXAxis/useAxisTicksProps.d.mts +84 -3
- package/ChartsXAxis/useAxisTicksProps.d.ts +84 -3
- package/ChartsYAxis/ChartsYAxis.js +3 -1
- package/ChartsYAxis/ChartsYAxis.mjs +3 -1
- package/ChartsYAxis/useAxisTicksProps.d.mts +84 -3
- package/ChartsYAxis/useAxisTicksProps.d.ts +84 -3
- package/LineChart/AreaElement.d.mts +3 -2
- package/LineChart/AreaElement.d.ts +3 -2
- package/LineChart/LineChart.js +6 -6
- package/LineChart/LineChart.mjs +6 -6
- package/LineChart/LineElement.d.mts +3 -2
- package/LineChart/LineElement.d.ts +3 -2
- package/LineChart/LineHighlightPlot.d.mts +3 -2
- package/LineChart/LineHighlightPlot.d.ts +3 -2
- package/LineChart/LineHighlightPlot.js +65 -45
- package/LineChart/LineHighlightPlot.mjs +65 -45
- package/LineChart/MarkPlot.d.mts +3 -2
- package/LineChart/MarkPlot.d.ts +3 -2
- package/LineChart/seriesConfig/curveEvaluation.js +40 -15
- package/LineChart/seriesConfig/curveEvaluation.mjs +39 -15
- package/LineChart/seriesConfig/extremums.js +5 -1
- package/LineChart/seriesConfig/extremums.mjs +5 -1
- package/LineChart/seriesConfig/getColor.js +7 -54
- package/LineChart/seriesConfig/getColor.mjs +7 -54
- package/LineChart/seriesConfig/seriesProcessor.d.mts +2 -4
- package/LineChart/seriesConfig/seriesProcessor.d.ts +2 -4
- package/LineChart/seriesConfig/seriesProcessor.js +2 -139
- package/LineChart/seriesConfig/seriesProcessor.mjs +2 -138
- package/LineChart/seriesConfig/tooltip.js +4 -25
- package/LineChart/seriesConfig/tooltip.mjs +4 -25
- package/LineChart/useMarkPlotData.js +3 -1
- package/LineChart/useMarkPlotData.mjs +3 -1
- package/PieChart/PieArcLabelPlot.d.mts +3 -2
- package/PieChart/PieArcLabelPlot.d.ts +3 -2
- package/PieChart/PieArcPlot.d.mts +3 -2
- package/PieChart/PieArcPlot.d.ts +3 -2
- package/PieChart/PieChart.js +6 -6
- package/PieChart/PieChart.mjs +6 -6
- package/RadarChart/RadarAxis/RadarAxis.utils.d.mts +2 -2
- package/RadarChart/RadarAxis/RadarAxis.utils.d.ts +2 -2
- package/RadarChart/RadarAxis/useRadarAxis.js +1 -1
- package/RadarChart/RadarAxis/useRadarAxis.mjs +1 -1
- package/RadarChart/RadarChart.js +8 -8
- package/RadarChart/RadarChart.mjs +8 -8
- package/RadarChart/RadarSeriesPlot/RadarSeriesArea.js +3 -1
- package/RadarChart/RadarSeriesPlot/RadarSeriesArea.mjs +3 -1
- package/RadarChart/RadarSeriesPlot/RadarSeriesMarks.js +1 -0
- package/RadarChart/RadarSeriesPlot/RadarSeriesMarks.mjs +1 -0
- package/RadarChart/RadarSeriesPlot/RadarSeriesPlot.js +1 -0
- package/RadarChart/RadarSeriesPlot/RadarSeriesPlot.mjs +1 -0
- package/ScatterChart/BatchScatter.d.mts +2 -8
- package/ScatterChart/BatchScatter.d.ts +2 -8
- package/ScatterChart/BatchScatter.js +17 -12
- package/ScatterChart/BatchScatter.mjs +17 -12
- package/ScatterChart/FocusedScatterMark.js +2 -2
- package/ScatterChart/FocusedScatterMark.mjs +2 -2
- package/ScatterChart/HighlightedScatterMark.js +3 -3
- package/ScatterChart/HighlightedScatterMark.mjs +3 -3
- package/ScatterChart/Scatter.d.mts +5 -0
- package/ScatterChart/Scatter.d.ts +5 -0
- package/ScatterChart/Scatter.js +7 -2
- package/ScatterChart/Scatter.mjs +7 -2
- package/ScatterChart/ScatterChart.d.mts +2 -1
- package/ScatterChart/ScatterChart.d.ts +2 -1
- package/ScatterChart/ScatterChart.js +32 -11
- package/ScatterChart/ScatterChart.mjs +32 -11
- package/ScatterChart/ScatterMarker.types.d.mts +3 -2
- package/ScatterChart/ScatterMarker.types.d.ts +3 -2
- package/ScatterChart/ScatterPlot.d.mts +3 -2
- package/ScatterChart/ScatterPlot.d.ts +3 -2
- package/ScatterChart/ScatterPlot.js +6 -1
- package/ScatterChart/ScatterPlot.mjs +6 -1
- package/ScatterChart/seriesConfig/extremums.js +6 -0
- package/ScatterChart/seriesConfig/extremums.mjs +6 -0
- package/ScatterChart/seriesConfig/getColor.js +1 -1
- package/ScatterChart/seriesConfig/getColor.mjs +1 -1
- package/ScatterChart/seriesConfig/getMarkerSize.d.mts +18 -0
- package/ScatterChart/seriesConfig/getMarkerSize.d.ts +18 -0
- package/ScatterChart/seriesConfig/getMarkerSize.js +43 -0
- package/ScatterChart/seriesConfig/getMarkerSize.mjs +37 -0
- package/ScatterChart/seriesConfig/seriesProcessor.js +23 -8
- package/ScatterChart/seriesConfig/seriesProcessor.mjs +23 -8
- package/ScatterChart/seriesConfig/tooltip.js +2 -24
- package/ScatterChart/seriesConfig/tooltip.mjs +2 -24
- package/ScatterChart/useScatterItemPosition.d.mts +4 -0
- package/ScatterChart/useScatterItemPosition.d.ts +4 -0
- package/ScatterChart/useScatterItemPosition.js +9 -0
- package/ScatterChart/useScatterItemPosition.mjs +8 -0
- package/SparkLineChart/SparkLineChart.js +27 -27
- package/SparkLineChart/SparkLineChart.mjs +27 -27
- package/Toolbar/Toolbar.types.d.mts +3 -2
- package/Toolbar/Toolbar.types.d.ts +3 -2
- package/index.js +1 -1
- package/index.mjs +1 -1
- package/internals/animation/animation.d.mts +1 -2
- package/internals/animation/animation.d.ts +1 -2
- package/internals/commonNextFocusItem.d.mts +10 -2
- package/internals/commonNextFocusItem.d.ts +10 -2
- package/internals/commonNextFocusItem.js +12 -4
- package/internals/commonNextFocusItem.mjs +12 -4
- package/internals/components/ChartsAccessibilityProxy/ChartsAccessibilityProxy.js +1 -1
- package/internals/components/ChartsAccessibilityProxy/ChartsAccessibilityProxy.mjs +1 -1
- package/internals/createCommonKeyboardFocusHandler.d.mts +1 -1
- package/internals/createCommonKeyboardFocusHandler.d.ts +1 -1
- package/internals/createCommonKeyboardFocusHandler.js +3 -3
- package/internals/createCommonKeyboardFocusHandler.mjs +3 -3
- package/internals/getLineLikeTooltip.d.mts +9 -0
- package/internals/getLineLikeTooltip.d.ts +9 -0
- package/internals/getLineLikeTooltip.js +38 -0
- package/internals/getLineLikeTooltip.mjs +31 -0
- package/internals/incompleteDatasetKeysError.d.mts +1 -0
- package/internals/incompleteDatasetKeysError.d.ts +1 -0
- package/internals/incompleteDatasetKeysError.js +11 -0
- package/internals/incompleteDatasetKeysError.mjs +4 -0
- package/internals/index.d.mts +5 -0
- package/internals/index.d.ts +5 -0
- package/internals/index.js +48 -0
- package/internals/index.mjs +5 -0
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/tooltipGetter.types.d.mts +4 -2
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/tooltipGetter.types.d.ts +4 -2
- package/internals/plugins/featurePlugins/useChartCartesianAxis/createZoomLookup.js +3 -2
- package/internals/plugins/featurePlugins/useChartCartesianAxis/createZoomLookup.mjs +4 -3
- package/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeAxis.js +2 -2
- package/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeAxis.mjs +3 -3
- package/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeZoom.d.mts +10 -1
- package/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeZoom.d.ts +10 -1
- package/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeZoom.js +18 -1
- package/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeZoom.mjs +16 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.mts +11 -3
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +11 -3
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.js +24 -5
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.mjs +24 -5
- package/internals/plugins/featurePlugins/useChartClosestPoint/findClosestPoints.d.mts +1 -1
- package/internals/plugins/featurePlugins/useChartClosestPoint/findClosestPoints.d.ts +1 -1
- package/internals/plugins/featurePlugins/useChartClosestPoint/findClosestPoints.js +46 -2
- package/internals/plugins/featurePlugins/useChartClosestPoint/findClosestPoints.mjs +47 -2
- package/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.js +46 -11
- package/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.mjs +46 -11
- package/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.types.d.mts +2 -1
- package/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.types.d.ts +2 -1
- package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.js +6 -2
- package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.mjs +6 -2
- package/internals/plugins/featurePlugins/useChartPolarAxis/coordinateTransformation.d.mts +4 -0
- package/internals/plugins/featurePlugins/useChartPolarAxis/coordinateTransformation.d.ts +4 -0
- package/internals/plugins/featurePlugins/useChartPolarAxis/coordinateTransformation.js +3 -1
- package/internals/plugins/featurePlugins/useChartPolarAxis/coordinateTransformation.mjs +1 -0
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.js +5 -3
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.mjs +7 -5
- package/internals/plugins/featurePlugins/useChartZAxis/useChartZAxis.js +17 -3
- package/internals/plugins/featurePlugins/useChartZAxis/useChartZAxis.mjs +17 -3
- package/internals/processLineLikeSeries.d.mts +6 -0
- package/internals/processLineLikeSeries.d.ts +6 -0
- package/internals/processLineLikeSeries.js +145 -0
- package/internals/processLineLikeSeries.mjs +138 -0
- package/internals/resolveColorProcessor.d.mts +11 -0
- package/internals/resolveColorProcessor.d.ts +11 -0
- package/internals/resolveColorProcessor.js +62 -0
- package/internals/resolveColorProcessor.mjs +56 -0
- package/internals/sizeScale.d.mts +6 -0
- package/internals/sizeScale.d.ts +6 -0
- package/internals/sizeScale.js +46 -0
- package/internals/sizeScale.mjs +38 -0
- package/models/axis.d.mts +18 -12
- package/models/axis.d.ts +18 -12
- package/models/chartsSlotsComponentsProps.d.mts +25 -0
- package/models/chartsSlotsComponentsProps.d.ts +25 -0
- package/models/chartsSlotsComponentsProps.js +5 -0
- package/models/chartsSlotsComponentsProps.mjs +1 -0
- package/models/index.d.mts +1 -0
- package/models/index.d.ts +1 -0
- package/models/index.js +11 -0
- package/models/index.mjs +1 -0
- package/models/seriesType/line.d.mts +5 -2
- package/models/seriesType/line.d.ts +5 -2
- package/models/seriesType/scatter.d.mts +34 -2
- package/models/seriesType/scatter.d.ts +34 -2
- package/models/sizeMapping.d.mts +64 -0
- package/models/sizeMapping.d.ts +64 -0
- package/models/sizeMapping.js +5 -0
- package/models/sizeMapping.mjs +1 -0
- package/models/slots/chartsBaseSlots.d.mts +6 -5
- package/models/slots/chartsBaseSlots.d.ts +6 -5
- package/models/z-axis.d.mts +10 -1
- package/models/z-axis.d.ts +10 -1
- package/package.json +6 -6
|
@@ -2,7 +2,7 @@ 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): (event: KeyboardEvent) => ((currentItem: import("../index.mjs").FocusedItemIdentifier<TInputSeriesType> | null, state: {
|
|
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: import("../index.mjs").FocusedItemIdentifier<TInputSeriesType> | null, state: {
|
|
6
6
|
series: {
|
|
7
7
|
defaultizedSeries: import("./plugins/corePlugins/useChartSeries/useChartSeries.types.mjs").DefaultizedSeriesGroups<TInputSeriesType>;
|
|
8
8
|
idToType: import("./index.mjs").SeriesIdToType;
|
|
@@ -2,7 +2,7 @@ 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): (event: KeyboardEvent) => ((currentItem: import("../index.js").FocusedItemIdentifier<TInputSeriesType> | null, state: {
|
|
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: import("../index.js").FocusedItemIdentifier<TInputSeriesType> | null, state: {
|
|
6
6
|
series: {
|
|
7
7
|
defaultizedSeries: import("./plugins/corePlugins/useChartSeries/useChartSeries.types.js").DefaultizedSeriesGroups<TInputSeriesType>;
|
|
8
8
|
idToType: import("./index.js").SeriesIdToType;
|
|
@@ -8,13 +8,13 @@ var _commonNextFocusItem = require("./commonNextFocusItem");
|
|
|
8
8
|
/**
|
|
9
9
|
* Create a keyboard focus handler for common use cases where focused item are defined by the series is and data index.
|
|
10
10
|
*/
|
|
11
|
-
function createCommonKeyboardFocusHandler(outSeriesTypes, allowCycles) {
|
|
11
|
+
function createCommonKeyboardFocusHandler(outSeriesTypes, allowCycles, useCurrentSeriesMaxLength) {
|
|
12
12
|
const keyboardFocusHandler = event => {
|
|
13
13
|
switch (event.key) {
|
|
14
14
|
case 'ArrowRight':
|
|
15
|
-
return (0, _commonNextFocusItem.createGetNextIndexFocusedItem)(outSeriesTypes, allowCycles);
|
|
15
|
+
return (0, _commonNextFocusItem.createGetNextIndexFocusedItem)(outSeriesTypes, allowCycles, useCurrentSeriesMaxLength);
|
|
16
16
|
case 'ArrowLeft':
|
|
17
|
-
return (0, _commonNextFocusItem.createGetPreviousIndexFocusedItem)(outSeriesTypes, allowCycles);
|
|
17
|
+
return (0, _commonNextFocusItem.createGetPreviousIndexFocusedItem)(outSeriesTypes, allowCycles, useCurrentSeriesMaxLength);
|
|
18
18
|
case 'ArrowDown':
|
|
19
19
|
return (0, _commonNextFocusItem.createGetPreviousSeriesFocusedItem)(outSeriesTypes);
|
|
20
20
|
case 'ArrowUp':
|
|
@@ -3,13 +3,13 @@ import { createGetNextIndexFocusedItem, createGetPreviousIndexFocusedItem, creat
|
|
|
3
3
|
/**
|
|
4
4
|
* Create a keyboard focus handler for common use cases where focused item are defined by the series is and data index.
|
|
5
5
|
*/
|
|
6
|
-
export function createCommonKeyboardFocusHandler(outSeriesTypes, allowCycles) {
|
|
6
|
+
export function createCommonKeyboardFocusHandler(outSeriesTypes, allowCycles, useCurrentSeriesMaxLength) {
|
|
7
7
|
const keyboardFocusHandler = event => {
|
|
8
8
|
switch (event.key) {
|
|
9
9
|
case 'ArrowRight':
|
|
10
|
-
return createGetNextIndexFocusedItem(outSeriesTypes, allowCycles);
|
|
10
|
+
return createGetNextIndexFocusedItem(outSeriesTypes, allowCycles, useCurrentSeriesMaxLength);
|
|
11
11
|
case 'ArrowLeft':
|
|
12
|
-
return createGetPreviousIndexFocusedItem(outSeriesTypes, allowCycles);
|
|
12
|
+
return createGetPreviousIndexFocusedItem(outSeriesTypes, allowCycles, useCurrentSeriesMaxLength);
|
|
13
13
|
case 'ArrowDown':
|
|
14
14
|
return createGetPreviousSeriesFocusedItem(outSeriesTypes);
|
|
15
15
|
case 'ArrowUp':
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ChartSeriesType } from "../models/seriesType/config.mjs";
|
|
2
|
+
import type { TooltipGetterParams, TooltipGetterResult } from "./plugins/corePlugins/useChartSeriesConfig/index.mjs";
|
|
3
|
+
type LineLikeTooltipChartType = Extract<ChartSeriesType, 'line' | 'radialLine' | 'bar' | 'radialBar' | 'scatter'>;
|
|
4
|
+
export interface LineLikeTooltipOptions {
|
|
5
|
+
skipNullValues?: boolean;
|
|
6
|
+
includeMarkShape?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare function getLineLikeTooltip<SeriesType extends LineLikeTooltipChartType>(params: TooltipGetterParams<SeriesType>, options?: LineLikeTooltipOptions): TooltipGetterResult<SeriesType>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ChartSeriesType } from "../models/seriesType/config.js";
|
|
2
|
+
import type { TooltipGetterParams, TooltipGetterResult } from "./plugins/corePlugins/useChartSeriesConfig/index.js";
|
|
3
|
+
type LineLikeTooltipChartType = Extract<ChartSeriesType, 'line' | 'radialLine' | 'bar' | 'radialBar' | 'scatter'>;
|
|
4
|
+
export interface LineLikeTooltipOptions {
|
|
5
|
+
skipNullValues?: boolean;
|
|
6
|
+
includeMarkShape?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare function getLineLikeTooltip<SeriesType extends LineLikeTooltipChartType>(params: TooltipGetterParams<SeriesType>, options?: LineLikeTooltipOptions): TooltipGetterResult<SeriesType>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.getLineLikeTooltip = getLineLikeTooltip;
|
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
+
var _getLabel = require("./getLabel");
|
|
10
|
+
function getLineLikeTooltip(params, options = {}) {
|
|
11
|
+
const {
|
|
12
|
+
series,
|
|
13
|
+
getColor,
|
|
14
|
+
identifier
|
|
15
|
+
} = params;
|
|
16
|
+
if (!identifier || identifier.dataIndex === undefined) {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
const label = (0, _getLabel.getLabel)(series.label, 'tooltip');
|
|
20
|
+
const value = series.data[identifier.dataIndex];
|
|
21
|
+
if (options.skipNullValues && value == null) {
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
const formattedValue = series.valueFormatter(value, {
|
|
25
|
+
dataIndex: identifier.dataIndex
|
|
26
|
+
});
|
|
27
|
+
const result = (0, _extends2.default)({
|
|
28
|
+
identifier,
|
|
29
|
+
color: getColor(identifier.dataIndex),
|
|
30
|
+
label,
|
|
31
|
+
value,
|
|
32
|
+
formattedValue,
|
|
33
|
+
markType: series.labelMarkType
|
|
34
|
+
}, options.includeMarkShape && 'showMark' in series && {
|
|
35
|
+
markShape: series.showMark ? series.shape : undefined
|
|
36
|
+
});
|
|
37
|
+
return result;
|
|
38
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import { getLabel } from "./getLabel.mjs";
|
|
3
|
+
export function getLineLikeTooltip(params, options = {}) {
|
|
4
|
+
const {
|
|
5
|
+
series,
|
|
6
|
+
getColor,
|
|
7
|
+
identifier
|
|
8
|
+
} = params;
|
|
9
|
+
if (!identifier || identifier.dataIndex === undefined) {
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
12
|
+
const label = getLabel(series.label, 'tooltip');
|
|
13
|
+
const value = series.data[identifier.dataIndex];
|
|
14
|
+
if (options.skipNullValues && value == null) {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
const formattedValue = series.valueFormatter(value, {
|
|
18
|
+
dataIndex: identifier.dataIndex
|
|
19
|
+
});
|
|
20
|
+
const result = _extends({
|
|
21
|
+
identifier,
|
|
22
|
+
color: getColor(identifier.dataIndex),
|
|
23
|
+
label,
|
|
24
|
+
value,
|
|
25
|
+
formattedValue,
|
|
26
|
+
markType: series.labelMarkType
|
|
27
|
+
}, options.includeMarkShape && 'showMark' in series && {
|
|
28
|
+
markShape: series.showMark ? series.shape : undefined
|
|
29
|
+
});
|
|
30
|
+
return result;
|
|
31
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function incompleteDatasetKeysError(seriesType: string, seriesId: string, missingKeys: string[]): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function incompleteDatasetKeysError(seriesType: string, seriesId: string, missingKeys: string[]): void;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.incompleteDatasetKeysError = incompleteDatasetKeysError;
|
|
8
|
+
var _formatErrorMessage2 = _interopRequireDefault(require("@mui/x-internals/formatErrorMessage"));
|
|
9
|
+
function incompleteDatasetKeysError(seriesType, seriesId, missingKeys) {
|
|
10
|
+
throw new Error(process.env.NODE_ENV !== "production" ? `MUI X Charts: ${seriesType} series with id="${seriesId}" has incomplete datasetKeys.` + `Properties ${missingKeys.map(key => `"${key}"`).join(', ')} are missing.` : (0, _formatErrorMessage2.default)(279, seriesType, seriesId, missingKeys.map(key => `"${key}"`).join(', ')));
|
|
11
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import _formatErrorMessage from "@mui/x-internals/formatErrorMessage";
|
|
2
|
+
export function incompleteDatasetKeysError(seriesType, seriesId, missingKeys) {
|
|
3
|
+
throw new Error(process.env.NODE_ENV !== "production" ? `MUI X Charts: ${seriesType} series with id="${seriesId}" has incomplete datasetKeys.` + `Properties ${missingKeys.map(key => `"${key}"`).join(', ')} are missing.` : _formatErrorMessage(279, seriesType, seriesId, missingKeys.map(key => `"${key}"`).join(', ')));
|
|
4
|
+
}
|
package/internals/index.d.mts
CHANGED
|
@@ -65,6 +65,8 @@ export * from "./consumeSlots.mjs";
|
|
|
65
65
|
export * from "./consumeThemeProps.mjs";
|
|
66
66
|
export * from "./defaultizeMargin.mjs";
|
|
67
67
|
export * from "./colorScale.mjs";
|
|
68
|
+
export * from "./sizeScale.mjs";
|
|
69
|
+
export * from "./incompleteDatasetKeysError.mjs";
|
|
68
70
|
export * from "./ticks.mjs";
|
|
69
71
|
export * from "./dateHelpers.mjs";
|
|
70
72
|
export * from "./invertScale.mjs";
|
|
@@ -73,6 +75,9 @@ export * from "./findMinMax.mjs";
|
|
|
73
75
|
export * from "./commonNextFocusItem.mjs";
|
|
74
76
|
export { createCommonKeyboardFocusHandler } from "./createCommonKeyboardFocusHandler.mjs";
|
|
75
77
|
export { getSeriesColorFn } from "./getSeriesColorFn.mjs";
|
|
78
|
+
export { resolveColorProcessor } from "./resolveColorProcessor.mjs";
|
|
79
|
+
export { processLineLikeSeries } from "./processLineLikeSeries.mjs";
|
|
80
|
+
export { getLineLikeTooltip } from "./getLineLikeTooltip.mjs";
|
|
76
81
|
export { checkBarChartScaleErrors } from "../BarChart/checkBarChartScaleErrors.mjs";
|
|
77
82
|
export { getBandSize } from "./getBandSize.mjs";
|
|
78
83
|
export * from "./plugins/utils/defaultSeriesConfig.mjs";
|
package/internals/index.d.ts
CHANGED
|
@@ -65,6 +65,8 @@ export * from "./consumeSlots.js";
|
|
|
65
65
|
export * from "./consumeThemeProps.js";
|
|
66
66
|
export * from "./defaultizeMargin.js";
|
|
67
67
|
export * from "./colorScale.js";
|
|
68
|
+
export * from "./sizeScale.js";
|
|
69
|
+
export * from "./incompleteDatasetKeysError.js";
|
|
68
70
|
export * from "./ticks.js";
|
|
69
71
|
export * from "./dateHelpers.js";
|
|
70
72
|
export * from "./invertScale.js";
|
|
@@ -73,6 +75,9 @@ export * from "./findMinMax.js";
|
|
|
73
75
|
export * from "./commonNextFocusItem.js";
|
|
74
76
|
export { createCommonKeyboardFocusHandler } from "./createCommonKeyboardFocusHandler.js";
|
|
75
77
|
export { getSeriesColorFn } from "./getSeriesColorFn.js";
|
|
78
|
+
export { resolveColorProcessor } from "./resolveColorProcessor.js";
|
|
79
|
+
export { processLineLikeSeries } from "./processLineLikeSeries.js";
|
|
80
|
+
export { getLineLikeTooltip } from "./getLineLikeTooltip.js";
|
|
76
81
|
export { checkBarChartScaleErrors } from "../BarChart/checkBarChartScaleErrors.js";
|
|
77
82
|
export { getBandSize } from "./getBandSize.js";
|
|
78
83
|
export * from "./plugins/utils/defaultSeriesConfig.js";
|
package/internals/index.js
CHANGED
|
@@ -24,6 +24,9 @@ var _exportNames = {
|
|
|
24
24
|
getRotationAxisIndex: true,
|
|
25
25
|
createCommonKeyboardFocusHandler: true,
|
|
26
26
|
getSeriesColorFn: true,
|
|
27
|
+
resolveColorProcessor: true,
|
|
28
|
+
processLineLikeSeries: true,
|
|
29
|
+
getLineLikeTooltip: true,
|
|
27
30
|
checkBarChartScaleErrors: true,
|
|
28
31
|
getBandSize: true,
|
|
29
32
|
EPSILON: true,
|
|
@@ -93,6 +96,12 @@ Object.defineProperty(exports, "getLineItemAtPosition", {
|
|
|
93
96
|
return _getItemAtPosition.default;
|
|
94
97
|
}
|
|
95
98
|
});
|
|
99
|
+
Object.defineProperty(exports, "getLineLikeTooltip", {
|
|
100
|
+
enumerable: true,
|
|
101
|
+
get: function () {
|
|
102
|
+
return _getLineLikeTooltip.getLineLikeTooltip;
|
|
103
|
+
}
|
|
104
|
+
});
|
|
96
105
|
Object.defineProperty(exports, "getRotationAxisIndex", {
|
|
97
106
|
enumerable: true,
|
|
98
107
|
get: function () {
|
|
@@ -111,6 +120,18 @@ Object.defineProperty(exports, "processBarDataForPlot", {
|
|
|
111
120
|
return _useBarPlotData.processBarDataForPlot;
|
|
112
121
|
}
|
|
113
122
|
});
|
|
123
|
+
Object.defineProperty(exports, "processLineLikeSeries", {
|
|
124
|
+
enumerable: true,
|
|
125
|
+
get: function () {
|
|
126
|
+
return _processLineLikeSeries.processLineLikeSeries;
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
Object.defineProperty(exports, "resolveColorProcessor", {
|
|
130
|
+
enumerable: true,
|
|
131
|
+
get: function () {
|
|
132
|
+
return _resolveColorProcessor.resolveColorProcessor;
|
|
133
|
+
}
|
|
134
|
+
});
|
|
114
135
|
Object.defineProperty(exports, "scatterSeriesConfig", {
|
|
115
136
|
enumerable: true,
|
|
116
137
|
get: function () {
|
|
@@ -811,6 +832,30 @@ Object.keys(_colorScale).forEach(function (key) {
|
|
|
811
832
|
}
|
|
812
833
|
});
|
|
813
834
|
});
|
|
835
|
+
var _sizeScale = require("./sizeScale");
|
|
836
|
+
Object.keys(_sizeScale).forEach(function (key) {
|
|
837
|
+
if (key === "default" || key === "__esModule") return;
|
|
838
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
839
|
+
if (key in exports && exports[key] === _sizeScale[key]) return;
|
|
840
|
+
Object.defineProperty(exports, key, {
|
|
841
|
+
enumerable: true,
|
|
842
|
+
get: function () {
|
|
843
|
+
return _sizeScale[key];
|
|
844
|
+
}
|
|
845
|
+
});
|
|
846
|
+
});
|
|
847
|
+
var _incompleteDatasetKeysError = require("./incompleteDatasetKeysError");
|
|
848
|
+
Object.keys(_incompleteDatasetKeysError).forEach(function (key) {
|
|
849
|
+
if (key === "default" || key === "__esModule") return;
|
|
850
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
851
|
+
if (key in exports && exports[key] === _incompleteDatasetKeysError[key]) return;
|
|
852
|
+
Object.defineProperty(exports, key, {
|
|
853
|
+
enumerable: true,
|
|
854
|
+
get: function () {
|
|
855
|
+
return _incompleteDatasetKeysError[key];
|
|
856
|
+
}
|
|
857
|
+
});
|
|
858
|
+
});
|
|
814
859
|
var _ticks = require("./ticks");
|
|
815
860
|
Object.keys(_ticks).forEach(function (key) {
|
|
816
861
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -885,6 +930,9 @@ Object.keys(_commonNextFocusItem).forEach(function (key) {
|
|
|
885
930
|
});
|
|
886
931
|
var _createCommonKeyboardFocusHandler = require("./createCommonKeyboardFocusHandler");
|
|
887
932
|
var _getSeriesColorFn = require("./getSeriesColorFn");
|
|
933
|
+
var _resolveColorProcessor = require("./resolveColorProcessor");
|
|
934
|
+
var _processLineLikeSeries = require("./processLineLikeSeries");
|
|
935
|
+
var _getLineLikeTooltip = require("./getLineLikeTooltip");
|
|
888
936
|
var _checkBarChartScaleErrors = require("../BarChart/checkBarChartScaleErrors");
|
|
889
937
|
var _getBandSize = require("./getBandSize");
|
|
890
938
|
var _defaultSeriesConfig = require("./plugins/utils/defaultSeriesConfig");
|
package/internals/index.mjs
CHANGED
|
@@ -73,6 +73,8 @@ export * from "./consumeSlots.mjs";
|
|
|
73
73
|
export * from "./consumeThemeProps.mjs";
|
|
74
74
|
export * from "./defaultizeMargin.mjs";
|
|
75
75
|
export * from "./colorScale.mjs";
|
|
76
|
+
export * from "./sizeScale.mjs";
|
|
77
|
+
export * from "./incompleteDatasetKeysError.mjs";
|
|
76
78
|
export * from "./ticks.mjs";
|
|
77
79
|
export * from "./dateHelpers.mjs";
|
|
78
80
|
export * from "./invertScale.mjs";
|
|
@@ -81,6 +83,9 @@ export * from "./findMinMax.mjs";
|
|
|
81
83
|
export * from "./commonNextFocusItem.mjs";
|
|
82
84
|
export { createCommonKeyboardFocusHandler } from "./createCommonKeyboardFocusHandler.mjs";
|
|
83
85
|
export { getSeriesColorFn } from "./getSeriesColorFn.mjs";
|
|
86
|
+
export { resolveColorProcessor } from "./resolveColorProcessor.mjs";
|
|
87
|
+
export { processLineLikeSeries } from "./processLineLikeSeries.mjs";
|
|
88
|
+
export { getLineLikeTooltip } from "./getLineLikeTooltip.mjs";
|
|
84
89
|
export { checkBarChartScaleErrors } from "../BarChart/checkBarChartScaleErrors.mjs";
|
|
85
90
|
export { getBandSize } from "./getBandSize.mjs";
|
|
86
91
|
export * from "./plugins/utils/defaultSeriesConfig.mjs";
|
|
@@ -55,12 +55,14 @@ export interface TooltipGetterAxesConfig {
|
|
|
55
55
|
rotation?: PolarAxisDefaultized<any, any, ChartsRotationAxisProps>;
|
|
56
56
|
radius?: PolarAxisDefaultized<any, any, ChartsRadiusAxisProps>;
|
|
57
57
|
}
|
|
58
|
-
export
|
|
58
|
+
export interface TooltipGetterParams<SeriesType extends ChartSeriesType> {
|
|
59
59
|
series: ChartSeriesDefaultized<SeriesType>;
|
|
60
60
|
axesConfig: TooltipGetterAxesConfig;
|
|
61
61
|
getColor: ColorGetter<SeriesType>;
|
|
62
62
|
identifier: SeriesItemIdentifierWithType<SeriesType> | null;
|
|
63
|
-
}
|
|
63
|
+
}
|
|
64
|
+
export type TooltipGetterResult<SeriesType extends ChartSeriesType> = (SeriesType extends 'radar' ? ItemTooltipWithMultipleValues<SeriesType> : ItemTooltip<SeriesType>) | null;
|
|
65
|
+
export type TooltipGetter<SeriesType extends ChartSeriesType> = (params: TooltipGetterParams<SeriesType>) => TooltipGetterResult<SeriesType>;
|
|
64
66
|
/**
|
|
65
67
|
* If `axisId` is set to undefined, the default axis will be used.
|
|
66
68
|
*
|
|
@@ -55,12 +55,14 @@ export interface TooltipGetterAxesConfig {
|
|
|
55
55
|
rotation?: PolarAxisDefaultized<any, any, ChartsRotationAxisProps>;
|
|
56
56
|
radius?: PolarAxisDefaultized<any, any, ChartsRadiusAxisProps>;
|
|
57
57
|
}
|
|
58
|
-
export
|
|
58
|
+
export interface TooltipGetterParams<SeriesType extends ChartSeriesType> {
|
|
59
59
|
series: ChartSeriesDefaultized<SeriesType>;
|
|
60
60
|
axesConfig: TooltipGetterAxesConfig;
|
|
61
61
|
getColor: ColorGetter<SeriesType>;
|
|
62
62
|
identifier: SeriesItemIdentifierWithType<SeriesType> | null;
|
|
63
|
-
}
|
|
63
|
+
}
|
|
64
|
+
export type TooltipGetterResult<SeriesType extends ChartSeriesType> = (SeriesType extends 'radar' ? ItemTooltipWithMultipleValues<SeriesType> : ItemTooltip<SeriesType>) | null;
|
|
65
|
+
export type TooltipGetter<SeriesType extends ChartSeriesType> = (params: TooltipGetterParams<SeriesType>) => TooltipGetterResult<SeriesType>;
|
|
64
66
|
/**
|
|
65
67
|
* If `axisId` is set to undefined, the default axis will be used.
|
|
66
68
|
*
|
|
@@ -10,9 +10,10 @@ const createZoomLookup = axisDirection => (axes = []) => axes.reduce((acc, v) =>
|
|
|
10
10
|
const {
|
|
11
11
|
zoom,
|
|
12
12
|
id: axisId,
|
|
13
|
-
reverse
|
|
13
|
+
reverse,
|
|
14
|
+
scaleType
|
|
14
15
|
} = v;
|
|
15
|
-
const defaultizedZoom = (0, _defaultizeZoom.defaultizeZoom)(zoom, axisId, axisDirection, reverse);
|
|
16
|
+
const defaultizedZoom = (0, _defaultizeZoom.defaultizeZoom)(zoom, axisId, axisDirection, (0, _defaultizeZoom.getEffectiveZoomReverse)(axisDirection, scaleType, reverse));
|
|
16
17
|
if (defaultizedZoom) {
|
|
17
18
|
acc[axisId] = defaultizedZoom;
|
|
18
19
|
}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { defaultizeZoom } from "./defaultizeZoom.mjs";
|
|
1
|
+
import { defaultizeZoom, getEffectiveZoomReverse } from "./defaultizeZoom.mjs";
|
|
2
2
|
export const createZoomLookup = axisDirection => (axes = []) => axes.reduce((acc, v) => {
|
|
3
3
|
// @ts-ignore
|
|
4
4
|
const {
|
|
5
5
|
zoom,
|
|
6
6
|
id: axisId,
|
|
7
|
-
reverse
|
|
7
|
+
reverse,
|
|
8
|
+
scaleType
|
|
8
9
|
} = v;
|
|
9
|
-
const defaultizedZoom = defaultizeZoom(zoom, axisId, axisDirection, reverse);
|
|
10
|
+
const defaultizedZoom = defaultizeZoom(zoom, axisId, axisDirection, getEffectiveZoomReverse(axisDirection, scaleType, reverse));
|
|
10
11
|
if (defaultizedZoom) {
|
|
11
12
|
acc[axisId] = defaultizedZoom;
|
|
12
13
|
}
|
|
@@ -35,7 +35,7 @@ function defaultizeXAxis(inAxes, dataset, axesGap) {
|
|
|
35
35
|
id,
|
|
36
36
|
position,
|
|
37
37
|
height,
|
|
38
|
-
zoom: (0, _defaultizeZoom.defaultizeZoom)(axisConfig.zoom, id, 'x', axisConfig.reverse)
|
|
38
|
+
zoom: (0, _defaultizeZoom.defaultizeZoom)(axisConfig.zoom, id, 'x', (0, _defaultizeZoom.getEffectiveZoomReverse)('x', axisConfig.scaleType, axisConfig.reverse))
|
|
39
39
|
});
|
|
40
40
|
|
|
41
41
|
// Increment the offset for the next axis
|
|
@@ -87,7 +87,7 @@ function defaultizeYAxis(inAxes, dataset, axesGap) {
|
|
|
87
87
|
id,
|
|
88
88
|
position,
|
|
89
89
|
width,
|
|
90
|
-
zoom: (0, _defaultizeZoom.defaultizeZoom)(axisConfig.zoom, id, 'y', axisConfig.reverse)
|
|
90
|
+
zoom: (0, _defaultizeZoom.defaultizeZoom)(axisConfig.zoom, id, 'y', (0, _defaultizeZoom.getEffectiveZoomReverse)('y', axisConfig.scaleType, axisConfig.reverse))
|
|
91
91
|
});
|
|
92
92
|
|
|
93
93
|
// Increment the offset for the next axis
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _formatErrorMessage from "@mui/x-internals/formatErrorMessage";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
import { defaultizeZoom } from "./defaultizeZoom.mjs";
|
|
3
|
+
import { defaultizeZoom, getEffectiveZoomReverse } from "./defaultizeZoom.mjs";
|
|
4
4
|
import { DEFAULT_X_AXIS_KEY, DEFAULT_Y_AXIS_KEY, DEFAULT_AXIS_SIZE_HEIGHT, DEFAULT_AXIS_SIZE_WIDTH, AXIS_LABEL_DEFAULT_HEIGHT } from "../../../../constants/index.mjs";
|
|
5
5
|
export function defaultizeXAxis(inAxes, dataset, axesGap) {
|
|
6
6
|
const offsets = {
|
|
@@ -27,7 +27,7 @@ export function defaultizeXAxis(inAxes, dataset, axesGap) {
|
|
|
27
27
|
id,
|
|
28
28
|
position,
|
|
29
29
|
height,
|
|
30
|
-
zoom: defaultizeZoom(axisConfig.zoom, id, 'x', axisConfig.reverse)
|
|
30
|
+
zoom: defaultizeZoom(axisConfig.zoom, id, 'x', getEffectiveZoomReverse('x', axisConfig.scaleType, axisConfig.reverse))
|
|
31
31
|
});
|
|
32
32
|
|
|
33
33
|
// Increment the offset for the next axis
|
|
@@ -79,7 +79,7 @@ export function defaultizeYAxis(inAxes, dataset, axesGap) {
|
|
|
79
79
|
id,
|
|
80
80
|
position,
|
|
81
81
|
width,
|
|
82
|
-
zoom: defaultizeZoom(axisConfig.zoom, id, 'y', axisConfig.reverse)
|
|
82
|
+
zoom: defaultizeZoom(axisConfig.zoom, id, 'y', getEffectiveZoomReverse('y', axisConfig.scaleType, axisConfig.reverse))
|
|
83
83
|
});
|
|
84
84
|
|
|
85
85
|
// Increment the offset for the next axis
|
|
@@ -1,6 +1,15 @@
|
|
|
1
|
-
import { type AxisId } from "../../../../models/axis.mjs";
|
|
1
|
+
import { type AxisId, type ScaleName } from "../../../../models/axis.mjs";
|
|
2
2
|
import { type DefaultizedZoomOptions } from "./useChartCartesianAxis.types.mjs";
|
|
3
3
|
import { type ZoomOptions } from "./zoom.types.mjs";
|
|
4
|
+
/**
|
|
5
|
+
* Ordinal Y axes (band/point) render with `domain[0]` at the top of the chart
|
|
6
|
+
* (see the `range.reverse()` applied in `selectorChartYScales`), which is the
|
|
7
|
+
* opposite of the cartesian convention assumed by the zoom/pan math.
|
|
8
|
+
*
|
|
9
|
+
* Returns the `reverse` flag the zoom handlers should use so that pan/wheel
|
|
10
|
+
* gestures follow the visual direction of the axis.
|
|
11
|
+
*/
|
|
12
|
+
export declare const getEffectiveZoomReverse: (axisDirection: "x" | "y", scaleType: ScaleName | undefined, reverse: boolean | undefined) => boolean;
|
|
4
13
|
export declare const defaultZoomOptions: {
|
|
5
14
|
minStart: number;
|
|
6
15
|
maxEnd: number;
|
|
@@ -1,6 +1,15 @@
|
|
|
1
|
-
import { type AxisId } from "../../../../models/axis.js";
|
|
1
|
+
import { type AxisId, type ScaleName } from "../../../../models/axis.js";
|
|
2
2
|
import { type DefaultizedZoomOptions } from "./useChartCartesianAxis.types.js";
|
|
3
3
|
import { type ZoomOptions } from "./zoom.types.js";
|
|
4
|
+
/**
|
|
5
|
+
* Ordinal Y axes (band/point) render with `domain[0]` at the top of the chart
|
|
6
|
+
* (see the `range.reverse()` applied in `selectorChartYScales`), which is the
|
|
7
|
+
* opposite of the cartesian convention assumed by the zoom/pan math.
|
|
8
|
+
*
|
|
9
|
+
* Returns the `reverse` flag the zoom handlers should use so that pan/wheel
|
|
10
|
+
* gestures follow the visual direction of the axis.
|
|
11
|
+
*/
|
|
12
|
+
export declare const getEffectiveZoomReverse: (axisDirection: "x" | "y", scaleType: ScaleName | undefined, reverse: boolean | undefined) => boolean;
|
|
4
13
|
export declare const defaultZoomOptions: {
|
|
5
14
|
minStart: number;
|
|
6
15
|
maxEnd: number;
|
|
@@ -4,9 +4,26 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.defaultizeZoom = exports.defaultZoomOptions = void 0;
|
|
7
|
+
exports.getEffectiveZoomReverse = exports.defaultizeZoom = exports.defaultZoomOptions = void 0;
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
9
|
var _constants = require("../../../constants");
|
|
10
|
+
/**
|
|
11
|
+
* Ordinal Y axes (band/point) render with `domain[0]` at the top of the chart
|
|
12
|
+
* (see the `range.reverse()` applied in `selectorChartYScales`), which is the
|
|
13
|
+
* opposite of the cartesian convention assumed by the zoom/pan math.
|
|
14
|
+
*
|
|
15
|
+
* Returns the `reverse` flag the zoom handlers should use so that pan/wheel
|
|
16
|
+
* gestures follow the visual direction of the axis.
|
|
17
|
+
*/
|
|
18
|
+
const getEffectiveZoomReverse = (axisDirection, scaleType, reverse) => {
|
|
19
|
+
const resolvedReverse = reverse ?? false;
|
|
20
|
+
const isOrdinal = scaleType === 'band' || scaleType === 'point';
|
|
21
|
+
if (axisDirection === 'y' && isOrdinal) {
|
|
22
|
+
return !resolvedReverse;
|
|
23
|
+
}
|
|
24
|
+
return resolvedReverse;
|
|
25
|
+
};
|
|
26
|
+
exports.getEffectiveZoomReverse = getEffectiveZoomReverse;
|
|
10
27
|
const defaultZoomOptions = exports.defaultZoomOptions = {
|
|
11
28
|
minStart: 0,
|
|
12
29
|
maxEnd: 100,
|
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import { DEFAULT_ZOOM_SLIDER_PREVIEW_SIZE, DEFAULT_ZOOM_SLIDER_SHOW_TOOLTIP, DEFAULT_ZOOM_SLIDER_SIZE } from "../../../constants.mjs";
|
|
3
|
+
/**
|
|
4
|
+
* Ordinal Y axes (band/point) render with `domain[0]` at the top of the chart
|
|
5
|
+
* (see the `range.reverse()` applied in `selectorChartYScales`), which is the
|
|
6
|
+
* opposite of the cartesian convention assumed by the zoom/pan math.
|
|
7
|
+
*
|
|
8
|
+
* Returns the `reverse` flag the zoom handlers should use so that pan/wheel
|
|
9
|
+
* gestures follow the visual direction of the axis.
|
|
10
|
+
*/
|
|
11
|
+
export const getEffectiveZoomReverse = (axisDirection, scaleType, reverse) => {
|
|
12
|
+
const resolvedReverse = reverse ?? false;
|
|
13
|
+
const isOrdinal = scaleType === 'band' || scaleType === 'point';
|
|
14
|
+
if (axisDirection === 'y' && isOrdinal) {
|
|
15
|
+
return !resolvedReverse;
|
|
16
|
+
}
|
|
17
|
+
return resolvedReverse;
|
|
18
|
+
};
|
|
3
19
|
export const defaultZoomOptions = {
|
|
4
20
|
minStart: 0,
|
|
5
21
|
maxEnd: 100,
|
|
@@ -164,6 +164,7 @@ export declare const selectorChartRawAxis: (args_0: import("../../corePlugins/us
|
|
|
164
164
|
min: NumberValue;
|
|
165
165
|
max: NumberValue;
|
|
166
166
|
});
|
|
167
|
+
domainSeries?: "all" | "visible";
|
|
167
168
|
ignoreTooltip?: boolean;
|
|
168
169
|
} & Omit<Partial<import("../../../index.mjs").ChartsYAxisProps>, "axisId"> & Partial<Omit<{
|
|
169
170
|
scaleType: "linear";
|
|
@@ -223,7 +224,14 @@ export declare const selectorChartDefaultXAxisId: (args_0: import("../../corePlu
|
|
|
223
224
|
export declare const selectorChartDefaultYAxisId: (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("./useChartCartesianAxis.types.mjs").UseChartCartesianAxisState> & {
|
|
224
225
|
cacheKey: import("../../models/index.mjs").ChartStateCacheKey;
|
|
225
226
|
}) => AxisId;
|
|
226
|
-
export
|
|
227
|
-
|
|
227
|
+
export type ScatterFlatbushEntry = {
|
|
228
|
+
flatbush: Flatbush;
|
|
229
|
+
/** Per-point marker radius, in pixels. */
|
|
230
|
+
getItemRadius: number | ((dataIndex: number) => number);
|
|
231
|
+
/** Largest radius across all points in this series, in pixels. */
|
|
232
|
+
maxItemRadius: number;
|
|
233
|
+
};
|
|
234
|
+
export declare const selectorChartSeriesEmptyFlatbushMap: () => Map<string, ScatterFlatbushEntry>;
|
|
235
|
+
export declare const selectorChartSeriesFlatbushMap: (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 & import("../useChartZAxis/index.mjs").UseChartZAxisState & Partial<{}> & {
|
|
228
236
|
cacheKey: import("../../models/index.mjs").ChartStateCacheKey;
|
|
229
|
-
}) => Map<string,
|
|
237
|
+
}) => Map<string, ScatterFlatbushEntry>;
|
|
@@ -164,6 +164,7 @@ export declare const selectorChartRawAxis: (args_0: import("../../corePlugins/us
|
|
|
164
164
|
min: NumberValue;
|
|
165
165
|
max: NumberValue;
|
|
166
166
|
});
|
|
167
|
+
domainSeries?: "all" | "visible";
|
|
167
168
|
ignoreTooltip?: boolean;
|
|
168
169
|
} & Omit<Partial<import("../../../index.js").ChartsYAxisProps>, "axisId"> & Partial<Omit<{
|
|
169
170
|
scaleType: "linear";
|
|
@@ -223,7 +224,14 @@ export declare const selectorChartDefaultXAxisId: (args_0: import("../../corePlu
|
|
|
223
224
|
export declare const selectorChartDefaultYAxisId: (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("./useChartCartesianAxis.types.js").UseChartCartesianAxisState> & {
|
|
224
225
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
225
226
|
}) => AxisId;
|
|
226
|
-
export
|
|
227
|
-
|
|
227
|
+
export type ScatterFlatbushEntry = {
|
|
228
|
+
flatbush: Flatbush;
|
|
229
|
+
/** Per-point marker radius, in pixels. */
|
|
230
|
+
getItemRadius: number | ((dataIndex: number) => number);
|
|
231
|
+
/** Largest radius across all points in this series, in pixels. */
|
|
232
|
+
maxItemRadius: number;
|
|
233
|
+
};
|
|
234
|
+
export declare const selectorChartSeriesEmptyFlatbushMap: () => Map<string, ScatterFlatbushEntry>;
|
|
235
|
+
export declare const selectorChartSeriesFlatbushMap: (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 & import("../useChartZAxis/index.js").UseChartZAxisState & Partial<{}> & {
|
|
228
236
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
229
|
-
}) => Map<string,
|
|
237
|
+
}) => Map<string, ScatterFlatbushEntry>;
|