@mui/x-charts 8.13.0 → 8.14.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.
Files changed (92) hide show
  1. package/BarChart/BarChart.js +44 -36
  2. package/CHANGELOG.md +171 -1
  3. package/ChartContainer/ChartContainer.js +68 -56
  4. package/ChartsTooltip/ChartsTooltipContainer.js +2 -0
  5. package/ChartsXAxis/useAxisTicksProps.d.ts +197 -355
  6. package/ChartsYAxis/useAxisTicksProps.d.ts +197 -355
  7. package/LineChart/LineChart.js +44 -36
  8. package/PieChart/PieArc.d.ts +18 -4
  9. package/PieChart/PieArc.js +11 -5
  10. package/PieChart/PieArcPlot.js +3 -1
  11. package/ScatterChart/ScatterChart.js +44 -36
  12. package/SparkLineChart/SparkLineChart.js +44 -36
  13. package/esm/BarChart/BarChart.js +44 -36
  14. package/esm/ChartContainer/ChartContainer.js +68 -56
  15. package/esm/ChartsTooltip/ChartsTooltipContainer.js +2 -0
  16. package/esm/ChartsXAxis/useAxisTicksProps.d.ts +197 -355
  17. package/esm/ChartsYAxis/useAxisTicksProps.d.ts +197 -355
  18. package/esm/LineChart/LineChart.js +44 -36
  19. package/esm/PieChart/PieArc.d.ts +18 -4
  20. package/esm/PieChart/PieArc.js +11 -5
  21. package/esm/PieChart/PieArcPlot.js +3 -1
  22. package/esm/ScatterChart/ScatterChart.js +44 -36
  23. package/esm/SparkLineChart/SparkLineChart.js +44 -36
  24. package/esm/hooks/animation/useAnimate.js +5 -3
  25. package/esm/hooks/useScale.d.ts +5 -1
  26. package/esm/index.js +1 -1
  27. package/esm/internals/animation/useAnimateInternal.d.ts +1 -1
  28. package/esm/internals/animation/useAnimateInternal.js +1 -1
  29. package/esm/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.js +8 -8
  30. package/esm/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.types.d.ts +4 -2
  31. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.d.ts +9 -11
  32. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.js +4 -28
  33. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/createAxisFilterMapper.d.ts +4 -5
  34. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/createAxisFilterMapper.js +3 -24
  35. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/domain.d.ts +20 -0
  36. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/domain.js +77 -0
  37. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisScale.d.ts +4 -65
  38. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisScale.js +7 -104
  39. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPreview.selectors.d.ts +3 -3
  40. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPreview.selectors.js +31 -39
  41. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +166 -6
  42. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.js +158 -47
  43. package/esm/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.js +10 -3
  44. package/esm/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.d.ts +4 -4
  45. package/esm/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.js +3 -2
  46. package/esm/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.types.d.ts +6 -0
  47. package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.js +5 -1
  48. package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.d.ts +9 -1
  49. package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.js +10 -1
  50. package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.types.d.ts +2 -1
  51. package/esm/internals/plugins/featurePlugins/useChartPolarAxis/computeAxisValue.js +2 -2
  52. package/esm/internals/scaleGuards.d.ts +12 -6
  53. package/esm/internals/symlogScale.js +5 -0
  54. package/esm/locales/enUS.js +4 -4
  55. package/esm/locales/ptBR.js +97 -99
  56. package/esm/models/axis.d.ts +39 -17
  57. package/esm/models/axis.js +3 -0
  58. package/hooks/animation/useAnimate.js +4 -3
  59. package/hooks/useScale.d.ts +5 -1
  60. package/index.js +1 -1
  61. package/internals/animation/useAnimateInternal.d.ts +1 -1
  62. package/internals/animation/useAnimateInternal.js +1 -1
  63. package/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.js +7 -7
  64. package/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.types.d.ts +4 -2
  65. package/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.d.ts +9 -11
  66. package/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.js +4 -28
  67. package/internals/plugins/featurePlugins/useChartCartesianAxis/createAxisFilterMapper.d.ts +4 -5
  68. package/internals/plugins/featurePlugins/useChartCartesianAxis/createAxisFilterMapper.js +3 -25
  69. package/internals/plugins/featurePlugins/useChartCartesianAxis/domain.d.ts +20 -0
  70. package/internals/plugins/featurePlugins/useChartCartesianAxis/domain.js +84 -0
  71. package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisScale.d.ts +4 -65
  72. package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisScale.js +8 -108
  73. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPreview.selectors.d.ts +3 -3
  74. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPreview.selectors.js +29 -37
  75. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +166 -6
  76. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.js +158 -47
  77. package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.js +10 -3
  78. package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.d.ts +4 -4
  79. package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.js +3 -2
  80. package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.types.d.ts +6 -0
  81. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.js +5 -1
  82. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.d.ts +9 -1
  83. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.js +11 -2
  84. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.types.d.ts +2 -1
  85. package/internals/plugins/featurePlugins/useChartPolarAxis/computeAxisValue.js +1 -1
  86. package/internals/scaleGuards.d.ts +12 -6
  87. package/internals/symlogScale.js +5 -0
  88. package/locales/enUS.js +4 -4
  89. package/locales/ptBR.js +97 -99
  90. package/models/axis.d.ts +39 -17
  91. package/models/axis.js +4 -0
  92. package/package.json +6 -6
@@ -10,106 +10,104 @@ export const ptBRLocaleText = {
10
10
  toolbarExport: 'Exportar',
11
11
  // Toolbar Export Menu
12
12
  toolbarExportPrint: 'Imprimir',
13
- toolbarExportImage: mimeType => `Exportar como ${imageMimeTypes[mimeType] ?? mimeType}`
14
-
13
+ toolbarExportImage: mimeType => `Exportar como ${imageMimeTypes[mimeType] ?? mimeType}`,
15
14
  // Charts renderer configuration
16
- // chartTypeBar: 'Bar',
17
- // chartTypeColumn: 'Column',
18
- // chartTypeLine: 'Line',
19
- // chartTypeArea: 'Area',
20
- // chartTypePie: 'Pie',
21
- // chartPaletteLabel: 'Color palette',
22
- // chartPaletteNameRainbowSurge: 'Rainbow Surge',
23
- // chartPaletteNameBlueberryTwilight: 'Blueberry Twilight',
24
- // chartPaletteNameMangoFusion: 'Mango Fusion',
25
- // chartPaletteNameCheerfulFiesta: 'Cheerful Fiesta',
26
- // chartPaletteNameStrawberrySky: 'Strawberry Sky',
27
- // chartPaletteNameBlue: 'Blue',
28
- // chartPaletteNameGreen: 'Green',
29
- // chartPaletteNamePurple: 'Purple',
30
- // chartPaletteNameRed: 'Red',
31
- // chartPaletteNameOrange: 'Orange',
32
- // chartPaletteNameYellow: 'Yellow',
33
- // chartPaletteNameCyan: 'Cyan',
34
- // chartPaletteNamePink: 'Pink',
35
- // chartConfigurationSectionChart: 'Chart',
36
- // chartConfigurationSectionColumns: 'Columns',
37
- // chartConfigurationSectionBars: 'Bars',
38
- // chartConfigurationSectionAxes: 'Axes',
39
- // chartConfigurationGrid: 'Grid',
40
- // chartConfigurationBorderRadius: 'Border radius',
41
- // chartConfigurationCategoryGapRatio: 'Category gap ratio',
42
- // chartConfigurationBarGapRatio: 'Series gap ratio',
43
- // chartConfigurationStacked: 'Stacked',
44
- // chartConfigurationShowToolbar: 'Show toolbar',
45
- // chartConfigurationSkipAnimation: 'Skip animation',
46
- // chartConfigurationInnerRadius: 'Inner radius',
47
- // chartConfigurationOuterRadius: 'Outer radius',
48
- // chartConfigurationColors: 'Colors',
49
- // chartConfigurationHideLegend: 'Hide legend',
50
- // chartConfigurationShowMark: 'Show mark',
51
- // chartConfigurationHeight: 'Height',
52
- // chartConfigurationWidth: 'Width',
53
- // chartConfigurationSeriesGap: 'Series gap',
54
- // chartConfigurationTickPlacement: 'Tick placement',
55
- // chartConfigurationTickLabelPlacement: 'Tick label placement',
56
- // chartConfigurationCategoriesAxisLabel: 'Categories axis label',
57
- // chartConfigurationSeriesAxisLabel: 'Series axis label',
58
- // chartConfigurationXAxisPosition: 'X-axis position',
59
- // chartConfigurationYAxisPosition: 'Y-axis position',
60
- // chartConfigurationSeriesAxisReverse: 'Reverse series axis',
61
- // chartConfigurationTooltipPlacement: 'Placement',
62
- // chartConfigurationTooltipTrigger: 'Trigger',
63
- // chartConfigurationLegendPosition: 'Position',
64
- // chartConfigurationLegendDirection: 'Direction',
65
- // chartConfigurationBarLabels: 'Bar labels',
66
- // chartConfigurationColumnLabels: 'Column labels',
67
- // chartConfigurationInterpolation: 'Interpolation',
68
- // chartConfigurationSectionTooltip: 'Tooltip',
69
- // chartConfigurationSectionLegend: 'Legend',
70
- // chartConfigurationSectionLines: 'Lines',
71
- // chartConfigurationSectionAreas: 'Areas',
72
- // chartConfigurationSectionArcs: 'Arcs',
73
- // chartConfigurationPaddingAngle: 'Padding angle',
74
- // chartConfigurationCornerRadius: 'Corner radius',
75
- // chartConfigurationArcLabels: 'Arc labels',
76
- // chartConfigurationStartAngle: 'Start angle',
77
- // chartConfigurationEndAngle: 'End angle',
78
- // chartConfigurationPieTooltipTrigger: 'Trigger',
79
- // chartConfigurationPieLegendPosition: 'Position',
80
- // chartConfigurationPieLegendDirection: 'Direction',
81
-
15
+ chartTypeBar: 'Barra',
16
+ chartTypeColumn: 'Coluna',
17
+ chartTypeLine: 'Linha',
18
+ chartTypeArea: 'Área',
19
+ chartTypePie: 'Pizza',
20
+ chartPaletteLabel: 'Paleta de cores',
21
+ chartPaletteNameRainbowSurge: 'Onda de Arco-íris',
22
+ chartPaletteNameBlueberryTwilight: 'Crepúsculo de Blueberry',
23
+ chartPaletteNameMangoFusion: 'Fusão de Manga',
24
+ chartPaletteNameCheerfulFiesta: 'Festa Alegre',
25
+ chartPaletteNameStrawberrySky: 'Céu de Morango',
26
+ chartPaletteNameBlue: 'Azul',
27
+ chartPaletteNameGreen: 'Verde',
28
+ chartPaletteNamePurple: 'Roxo',
29
+ chartPaletteNameRed: 'Vermelho',
30
+ chartPaletteNameOrange: 'Laranja',
31
+ chartPaletteNameYellow: 'Amarelo',
32
+ chartPaletteNameCyan: 'Ciano',
33
+ chartPaletteNamePink: 'Rosa',
34
+ chartConfigurationSectionChart: 'Gráfico',
35
+ chartConfigurationSectionColumns: 'Colunas',
36
+ chartConfigurationSectionBars: 'Barras',
37
+ chartConfigurationSectionAxes: 'Eixos',
38
+ chartConfigurationGrid: 'Grade',
39
+ chartConfigurationBorderRadius: 'Arredondamento da borda',
40
+ chartConfigurationCategoryGapRatio: 'Proporção de espaço entre categorias',
41
+ chartConfigurationBarGapRatio: 'Proporção de espaço entre séries',
42
+ chartConfigurationStacked: 'Empilhado',
43
+ chartConfigurationShowToolbar: 'Mostrar barra de ferramentas',
44
+ chartConfigurationSkipAnimation: 'Ignorar animação',
45
+ chartConfigurationInnerRadius: 'Raio interno',
46
+ chartConfigurationOuterRadius: 'Raio externo',
47
+ chartConfigurationColors: 'Cores',
48
+ chartConfigurationHideLegend: 'Ocultar legenda',
49
+ chartConfigurationShowMark: 'Mostrar marcação',
50
+ chartConfigurationHeight: 'Altura',
51
+ chartConfigurationWidth: 'Largura',
52
+ chartConfigurationSeriesGap: 'Espaçamento entre séries',
53
+ chartConfigurationTickPlacement: 'Posição da marcação',
54
+ chartConfigurationTickLabelPlacement: 'Posição do título da marcação',
55
+ chartConfigurationCategoriesAxisLabel: 'Título do eixo de categorias',
56
+ chartConfigurationSeriesAxisLabel: 'Título do eixo de séries',
57
+ chartConfigurationXAxisPosition: 'Posição do eixo X',
58
+ chartConfigurationYAxisPosition: 'Posição do eixo Y',
59
+ chartConfigurationSeriesAxisReverse: 'Inverter eixo de séries',
60
+ chartConfigurationTooltipPlacement: 'Posição',
61
+ chartConfigurationTooltipTrigger: 'Gatilho',
62
+ chartConfigurationLegendPosition: 'Posição',
63
+ chartConfigurationLegendDirection: 'Direção',
64
+ chartConfigurationBarLabels: 'Títulos das barras',
65
+ chartConfigurationColumnLabels: 'Títulos das colunas',
66
+ chartConfigurationInterpolation: 'Interpolação',
67
+ chartConfigurationSectionTooltip: 'Tooltip',
68
+ chartConfigurationSectionLegend: 'Legenda',
69
+ chartConfigurationSectionLines: 'Linhas',
70
+ chartConfigurationSectionAreas: 'Áreas',
71
+ chartConfigurationSectionArcs: 'Arcos',
72
+ chartConfigurationPaddingAngle: 'Ângulo de preenchimento',
73
+ chartConfigurationCornerRadius: 'Raio do canto',
74
+ chartConfigurationArcLabels: 'Títulos dos arcos',
75
+ chartConfigurationStartAngle: 'Ângulo inicial',
76
+ chartConfigurationEndAngle: 'Ângulo final',
77
+ chartConfigurationPieTooltipTrigger: 'Gatilho',
78
+ chartConfigurationPieLegendPosition: 'Posição',
79
+ chartConfigurationPieLegendDirection: 'Direção',
82
80
  // Common option labels
83
- // chartConfigurationOptionNone: 'None',
84
- // chartConfigurationOptionValue: 'Value',
85
- // chartConfigurationOptionAuto: 'Auto',
86
- // chartConfigurationOptionTop: 'Top',
87
- // chartConfigurationOptionTopLeft: 'Top Left',
88
- // chartConfigurationOptionTopRight: 'Top Right',
89
- // chartConfigurationOptionBottom: 'Bottom',
90
- // chartConfigurationOptionBottomLeft: 'Bottom Left',
91
- // chartConfigurationOptionBottomRight: 'Bottom Right',
92
- // chartConfigurationOptionLeft: 'Left',
93
- // chartConfigurationOptionRight: 'Right',
94
- // chartConfigurationOptionAxis: 'Axis',
95
- // chartConfigurationOptionItem: 'Item',
96
- // chartConfigurationOptionHorizontal: 'Horizontal',
97
- // chartConfigurationOptionVertical: 'Vertical',
98
- // chartConfigurationOptionBoth: 'Both',
99
- // chartConfigurationOptionStart: 'Start',
100
- // chartConfigurationOptionMiddle: 'Middle',
101
- // chartConfigurationOptionEnd: 'End',
102
- // chartConfigurationOptionExtremities: 'Extremities',
103
- // chartConfigurationOptionTick: 'Tick',
104
- // chartConfigurationOptionMonotoneX: 'Monotone X',
105
- // chartConfigurationOptionMonotoneY: 'Monotone Y',
106
- // chartConfigurationOptionCatmullRom: 'Catmull-Rom',
107
- // chartConfigurationOptionLinear: 'Linear',
108
- // chartConfigurationOptionNatural: 'Natural',
109
- // chartConfigurationOptionStep: 'Step',
110
- // chartConfigurationOptionStepBefore: 'Step Before',
111
- // chartConfigurationOptionStepAfter: 'Step After',
112
- // chartConfigurationOptionBumpX: 'Bump X',
113
- // chartConfigurationOptionBumpY: 'Bump Y',
81
+ chartConfigurationOptionNone: 'Nenhum',
82
+ chartConfigurationOptionValue: 'Valor',
83
+ chartConfigurationOptionAuto: 'Automático',
84
+ chartConfigurationOptionTop: 'Topo',
85
+ chartConfigurationOptionTopLeft: 'Topo Esquerdo',
86
+ chartConfigurationOptionTopRight: 'Topo Direito',
87
+ chartConfigurationOptionBottom: 'Inferior',
88
+ chartConfigurationOptionBottomLeft: 'Inferior Esquerdo',
89
+ chartConfigurationOptionBottomRight: 'Inferior Direito',
90
+ chartConfigurationOptionLeft: 'Esquerda',
91
+ chartConfigurationOptionRight: 'Direita',
92
+ chartConfigurationOptionAxis: 'Eixo',
93
+ chartConfigurationOptionItem: 'Item',
94
+ chartConfigurationOptionHorizontal: 'Horizontal',
95
+ chartConfigurationOptionVertical: 'Vertical',
96
+ chartConfigurationOptionBoth: 'Ambos',
97
+ chartConfigurationOptionStart: 'Início',
98
+ chartConfigurationOptionMiddle: 'Meio',
99
+ chartConfigurationOptionEnd: 'Fim',
100
+ chartConfigurationOptionExtremities: 'Extremidades',
101
+ chartConfigurationOptionTick: 'Marcação',
102
+ chartConfigurationOptionMonotoneX: 'Monótono X',
103
+ chartConfigurationOptionMonotoneY: 'Monótono Y',
104
+ chartConfigurationOptionCatmullRom: 'Catmull-Rom',
105
+ chartConfigurationOptionLinear: 'Linear',
106
+ chartConfigurationOptionNatural: 'Natural',
107
+ chartConfigurationOptionStep: 'Passo',
108
+ chartConfigurationOptionStepBefore: 'Passo Anterior',
109
+ chartConfigurationOptionStepAfter: 'Passo Posterior',
110
+ chartConfigurationOptionBumpX: 'Colisão X',
111
+ chartConfigurationOptionBumpY: 'Colisão Y'
114
112
  };
115
113
  export const ptBR = getChartsLocalization(ptBRLocaleText);
@@ -1,4 +1,4 @@
1
- import type { ScaleBand, ScaleLinear, ScaleLogarithmic, ScaleOrdinal, ScalePoint, ScalePower, ScaleSequential, ScaleThreshold, ScaleTime, ScaleSymLog } from '@mui/x-charts-vendor/d3-scale';
1
+ import type { ScaleBand, ScaleLinear, ScaleLogarithmic, ScaleOrdinal, ScalePoint, ScalePower, ScaleSequential, ScaleThreshold, ScaleTime, ScaleSymLog, NumberValue } from '@mui/x-charts-vendor/d3-scale';
2
2
  import { SxProps } from '@mui/system/styleFunctionSx';
3
3
  import { type MakeOptional, MakeRequired } from '@mui/x-internals/types';
4
4
  import type { DefaultizedZoomOptions } from "../internals/plugins/featurePlugins/useChartCartesianAxis/index.js";
@@ -9,11 +9,15 @@ import { ContinuousColorConfig, OrdinalColorConfig, PiecewiseColorConfig } from
9
9
  export type AxisId = string | number;
10
10
  export type D3Scale<Domain extends {
11
11
  toString(): string;
12
- } = number | Date | string, Range = number, Output = number> = ScaleBand<Domain> | ScaleSymLog<Range, Output> | ScaleLogarithmic<Range, Output> | ScalePoint<Domain> | ScalePower<Range, Output> | ScaleTime<Range, Output> | ScaleLinear<Range, Output>;
12
+ } = {
13
+ toString(): string;
14
+ }, Range = number, Output = number> = ScaleBand<Domain> | ScaleSymLog<Range, Output> | ScaleLogarithmic<Range, Output> | ScalePoint<Domain> | ScalePower<Range, Output> | ScaleTime<Range, Output> | ScaleLinear<Range, Output>;
13
15
  export type D3ContinuousScale<Range = number, Output = number> = ScaleSymLog<Range, Output> | ScaleLogarithmic<Range, Output> | ScalePower<Range, Output> | ScaleTime<Range, Output> | ScaleLinear<Range, Output>;
14
16
  export type D3OrdinalScale<Domain extends {
15
17
  toString(): string;
16
- } = number | Date | string> = ScaleBand<Domain> | ScalePoint<Domain>;
18
+ } = {
19
+ toString(): string;
20
+ }> = ScaleBand<Domain> | ScalePoint<Domain>;
17
21
  export interface ChartsAxisSlots {
18
22
  /**
19
23
  * Custom component for the axis main line.
@@ -220,7 +224,9 @@ export type AxisGroups = {
220
224
  export interface AxisScaleConfig {
221
225
  band: {
222
226
  scaleType: 'band';
223
- scale: ScaleBand<number | Date | string>;
227
+ scale: ScaleBand<{
228
+ toString(): string;
229
+ }>;
224
230
  /**
225
231
  * The ratio between the space allocated for padding between two categories and the category width.
226
232
  * 0 means no gap, and 1 no data.
@@ -237,7 +243,9 @@ export interface AxisScaleConfig {
237
243
  } & AxisGroups & Pick<TickParams, 'tickPlacement' | 'tickLabelPlacement'>;
238
244
  point: {
239
245
  scaleType: 'point';
240
- scale: ScalePoint<number | Date | string>;
246
+ scale: ScalePoint<{
247
+ toString(): string;
248
+ }>;
241
249
  colorMap?: OrdinalColorConfig | ContinuousColorConfig | PiecewiseColorConfig;
242
250
  } & AxisGroups;
243
251
  log: {
@@ -363,26 +371,39 @@ export type AxisValueFormatterContext<S extends ScaleName = ScaleName> = {
363
371
  */
364
372
  tickNumber?: number;
365
373
  };
366
- /**
367
- * Config that is shared between cartesian and polar axes.
368
- */
369
- type CommonAxisConfig<S extends ScaleName = ScaleName, V = any> = {
374
+ type MinMaxConfig<S extends ScaleName = ScaleName> = S extends ContinuousScaleName ? S extends 'utc' | 'time' ? {
370
375
  /**
371
- * ID used to identify the axis.
372
- *
373
- * The ID must be unique across all axes in this chart.
376
+ * The minimal value of the domain.
377
+ * If not provided, it gets computed to display the entire chart data.
374
378
  */
375
- id: AxisId;
379
+ min?: NumberValue;
380
+ /**
381
+ * The maximal value of the domain.
382
+ * If not provided, it gets computed to display the entire chart data.
383
+ */
384
+ max?: NumberValue;
385
+ } : {
376
386
  /**
377
387
  * The minimal value of the domain.
378
388
  * If not provided, it gets computed to display the entire chart data.
379
389
  */
380
- min?: number | Date;
390
+ min?: number;
381
391
  /**
382
392
  * The maximal value of the domain.
383
393
  * If not provided, it gets computed to display the entire chart data.
384
394
  */
385
- max?: number | Date;
395
+ max?: number;
396
+ } : {};
397
+ /**
398
+ * Config that is shared between cartesian and polar axes.
399
+ */
400
+ type CommonAxisConfig<S extends ScaleName = ScaleName, V = any> = {
401
+ /**
402
+ * ID used to identify the axis.
403
+ *
404
+ * The ID must be unique across all axes in this chart.
405
+ */
406
+ id: AxisId;
386
407
  /**
387
408
  * The data used by `'band'` and `'point'` scales.
388
409
  */
@@ -429,7 +450,7 @@ export type PolarAxisConfig<S extends ScaleName = ScaleName, V = any, AxisProps
429
450
  * @default 0
430
451
  */
431
452
  offset?: number;
432
- } & CommonAxisConfig<S, V> & Omit<Partial<AxisProps>, 'axisId'> & Partial<Omit<AxisScaleConfig[S], 'scale'>> & AxisConfigExtension;
453
+ } & CommonAxisConfig<S, V> & MinMaxConfig<S> & Omit<Partial<AxisProps>, 'axisId'> & Partial<Omit<AxisScaleConfig[S], 'scale'>> & AxisConfigExtension;
433
454
  /**
434
455
  * Use this type for advanced typing. For basic usage, use `XAxis`, `YAxis`, `RotationAxis` or `RadiusAxis`.
435
456
  */
@@ -441,7 +462,7 @@ export type AxisConfig<S extends ScaleName = ScaleName, V = any, AxisProps exten
441
462
  * @default 0
442
463
  */
443
464
  offset?: number;
444
- } & CommonAxisConfig<S, V> & Omit<Partial<AxisProps>, 'axisId'> & Partial<Omit<AxisScaleConfig[S], 'scale'>> & AxisSideConfig<AxisProps> & TickParams & AxisConfigExtension;
465
+ } & CommonAxisConfig<S, V> & MinMaxConfig<S> & Omit<Partial<AxisProps>, 'axisId'> & Partial<Omit<AxisScaleConfig[S], 'scale'>> & AxisSideConfig<AxisProps> & TickParams & AxisConfigExtension;
445
466
  export interface AxisConfigExtension {}
446
467
  export type PolarAxisDefaultized<S extends ScaleName = ScaleName, V = any, AxisProps extends ChartsAxisProps = ChartsRotationAxisProps | ChartsRadiusAxisProps> = Omit<PolarAxisConfig<S, V, AxisProps>, 'scaleType'> & AxisScaleConfig[S] & AxisScaleComputedConfig[S] & {
447
468
  /**
@@ -467,6 +488,7 @@ export declare function isBandScaleConfig(scaleConfig: AxisConfig<ScaleName>): s
467
488
  export declare function isPointScaleConfig(scaleConfig: AxisConfig<ScaleName>): scaleConfig is AxisConfig<'point'> & {
468
489
  scaleType: 'point';
469
490
  };
491
+ export declare function isContinuousScaleConfig(scaleConfig: AxisConfig<ScaleName>): scaleConfig is AxisConfig<ContinuousScaleName>;
470
492
  export declare function isSymlogScaleConfig(scaleConfig: AxisConfig<ScaleName>): scaleConfig is AxisConfig<'symlog'> & {
471
493
  scaleType: 'symlog';
472
494
  };
@@ -17,6 +17,9 @@ export function isBandScaleConfig(scaleConfig) {
17
17
  export function isPointScaleConfig(scaleConfig) {
18
18
  return scaleConfig.scaleType === 'point';
19
19
  }
20
+ export function isContinuousScaleConfig(scaleConfig) {
21
+ return scaleConfig.scaleType !== 'point' && scaleConfig.scaleType !== 'band';
22
+ }
20
23
  export function isSymlogScaleConfig(scaleConfig) {
21
24
  return scaleConfig.scaleType === 'symlog';
22
25
  }
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ 'use client';
2
3
 
3
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
5
  Object.defineProperty(exports, "__esModule", {
@@ -41,14 +42,14 @@ function useAnimate(props, {
41
42
  ref
42
43
  }) {
43
44
  const transform = transformProps ?? (p => p);
44
- const animateRef = (0, _useAnimateInternal.useAnimateInternal)(props, {
45
+ const [animateRef, lastInterpolatedProps] = (0, _useAnimateInternal.useAnimateInternal)(props, {
45
46
  initialProps,
46
47
  createInterpolator,
47
48
  applyProps: (element, animatedProps) => applyProps(element, transform(animatedProps)),
48
49
  skip
49
50
  });
50
- const usedProps = skip ? props : initialProps;
51
- return (0, _extends2.default)({}, transformProps(usedProps), {
51
+ const usedProps = skip ? transformProps(props) : transformProps(lastInterpolatedProps);
52
+ return (0, _extends2.default)({}, usedProps, {
52
53
  ref: (0, _useForkRef.default)(animateRef, ref)
53
54
  });
54
55
  }
@@ -5,7 +5,11 @@ import { AxisId, AxisScaleConfig, D3Scale, ScaleName } from "../models/axis.js";
5
5
  * @param {D3Scale} scale The scale to use
6
6
  * @returns {(value: any) => number} A function that map value to their position
7
7
  */
8
- export declare function getValueToPositionMapper(scale: D3Scale): (value: any) => number;
8
+ export declare function getValueToPositionMapper<Domain extends {
9
+ toString(): string;
10
+ } = {
11
+ toString(): string;
12
+ }, Range = number>(scale: D3Scale<Domain, Range>): (value: any) => number;
9
13
  /**
10
14
  * Get the X scale.
11
15
  *
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-charts v8.13.0
2
+ * @mui/x-charts v8.14.0
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -18,4 +18,4 @@ export declare function useAnimateInternal<Props extends {}, Elem extends Elemen
18
18
  applyProps: (element: Elem, props: Props) => void;
19
19
  skip?: boolean;
20
20
  initialProps?: Props;
21
- }): (element: Elem | null) => void;
21
+ }): readonly [(element: Elem | null) => void, Props];
@@ -78,5 +78,5 @@ function useAnimateInternal(props, {
78
78
  animate(element);
79
79
  }
80
80
  }, [animate, props, skip]);
81
- return setRef;
81
+ return [setRef, lastInterpolatedPropsRef.current];
82
82
  }
@@ -28,7 +28,7 @@ const useChartInteractionListener = ({
28
28
  name: 'zoomPan',
29
29
  threshold: 0,
30
30
  maxPointers: 1,
31
- preventIf: ['zoomTapAndDrag']
31
+ preventIf: ['zoomTapAndDrag', 'zoomPressAndDrag']
32
32
  }), new _core.MoveGesture({
33
33
  name: 'move',
34
34
  preventIf: ['pan', 'zoomPinch', 'zoomPan'] // Prevent move gesture when pan is active
@@ -42,17 +42,17 @@ const useChartInteractionListener = ({
42
42
  initialDelta: 1
43
43
  }), new _core.TapGesture({
44
44
  name: 'tap',
45
- maxDistance: 10,
46
45
  preventIf: ['pan', 'zoomPan', 'zoomPinch']
47
46
  }), new _core.PressGesture({
48
47
  name: 'quickPress',
49
- duration: 50,
50
- maxDistance: 10
48
+ duration: 50
51
49
  }), new _core.TapAndDragGesture({
52
50
  name: 'zoomTapAndDrag',
53
- tapMaxDistance: 10,
51
+ dragThreshold: 10
52
+ }), new _core.PressAndDragGesture({
53
+ name: 'zoomPressAndDrag',
54
54
  dragThreshold: 10,
55
- dragTimeout: 1000
55
+ preventIf: ['zoomPinch']
56
56
  })]
57
57
  });
58
58
  }
@@ -62,7 +62,7 @@ const useChartInteractionListener = ({
62
62
  if (!svg || !gestureManager) {
63
63
  return undefined;
64
64
  }
65
- gestureManager.registerElement(['pan', 'move', 'zoomPinch', 'zoomPan', 'zoomTurnWheel', 'tap', 'quickPress', 'zoomTapAndDrag'], svg);
65
+ gestureManager.registerElement(['pan', 'move', 'zoomPinch', 'zoomPan', 'zoomTurnWheel', 'tap', 'quickPress', 'zoomTapAndDrag', 'zoomPressAndDrag'], svg);
66
66
  return () => {
67
67
  // Cleanup gesture manager
68
68
  gestureManager.unregisterAllGestures(svg);
@@ -1,6 +1,6 @@
1
- import { MoveEvent, PanEvent, PanGestureOptions, PinchEvent, PinchGestureOptions, PressEvent, TapEvent, TurnWheelEvent, type TapAndDragEvent, type TapAndDragGestureOptions, type TurnWheelGestureOptions } from '@mui/x-internal-gestures/core';
1
+ import { MoveEvent, PanEvent, PanGestureOptions, PinchEvent, PinchGestureOptions, PressEvent, TapEvent, TurnWheelEvent, type PressAndDragEvent, type PressAndDragGestureOptions, type TapAndDragEvent, type TapAndDragGestureOptions, type TurnWheelGestureOptions } from '@mui/x-internal-gestures/core';
2
2
  import { ChartPluginSignature } from "../../models/index.js";
3
- export type ChartInteraction = 'pan' | 'panStart' | 'panEnd' | 'zoomPan' | 'zoomPanStart' | 'zoomPanEnd' | 'zoomPinch' | 'zoomPinchStart' | 'zoomPinchEnd' | 'move' | 'moveStart' | 'moveEnd' | 'quickPress' | 'quickPressEnd' | 'zoomTurnWheel' | 'tap';
3
+ export type ChartInteraction = 'pan' | 'panStart' | 'panEnd' | 'zoomPan' | 'zoomPanStart' | 'zoomPanEnd' | 'zoomPinch' | 'zoomPinchStart' | 'zoomPinchEnd' | 'zoomTurnWheel' | 'zoomTapAndDrag' | 'zoomTapAndDragStart' | 'zoomTapAndDragEnd' | 'zoomPressAndDrag' | 'zoomPressAndDragStart' | 'zoomPressAndDragEnd' | 'move' | 'moveStart' | 'moveEnd' | 'tap' | 'quickPress' | 'quickPressEnd';
4
4
  export type InteractionListenerResult = {
5
5
  cleanup: () => void;
6
6
  };
@@ -12,12 +12,14 @@ export type AddInteractionListener = {
12
12
  <CustomData extends Record<string, unknown> = Record<string, unknown>>(interaction: 'tap', callback: (event: TapEvent<CustomData>) => void, options?: boolean | AddEventListenerOptions): InteractionListenerResult;
13
13
  <CustomData extends Record<string, unknown> = Record<string, unknown>>(interaction: 'quickPress' | 'quickPressEnd', callback: (event: PressEvent<CustomData>) => void, options?: boolean | AddEventListenerOptions): InteractionListenerResult;
14
14
  <CustomData extends Record<string, unknown> = Record<string, unknown>>(interaction: 'zoomTapAndDrag' | 'zoomTapAndDragStart' | 'zoomTapAndDragEnd', callback: (event: TapAndDragEvent<CustomData>) => void, options?: boolean | AddEventListenerOptions): InteractionListenerResult;
15
+ <CustomData extends Record<string, unknown> = Record<string, unknown>>(interaction: 'zoomPressAndDrag' | 'zoomPressAndDragStart' | 'zoomPressAndDragEnd', callback: (event: PressAndDragEvent<CustomData>) => void, options?: boolean | AddEventListenerOptions): InteractionListenerResult;
15
16
  };
16
17
  export type UpdateZoomInteractionListeners = {
17
18
  (interaction: 'zoomPan', options?: Omit<PanGestureOptions<'zoomPan'>, 'name'>): void;
18
19
  (interaction: 'zoomPinch', options?: Omit<PinchGestureOptions<'zoomPinch'>, 'name'>): void;
19
20
  (interaction: 'zoomTurnWheel', options?: Omit<TurnWheelGestureOptions<'zoomTurnWheel'>, 'name'>): void;
20
21
  (interaction: 'zoomTapAndDrag', options?: Omit<TapAndDragGestureOptions<'zoomTapAndDrag'>, 'name'>): void;
22
+ (interaction: 'zoomPressAndDrag', options?: Omit<PressAndDragGestureOptions<'zoomPressAndDrag'>, 'name'>): void;
21
23
  };
22
24
  export interface UseChartInteractionListenerParameters {}
23
25
  export interface UseChartInteractionListenerState {}
@@ -1,27 +1,25 @@
1
- import { ChartsXAxisProps, ChartsAxisProps, ChartsYAxisProps, AxisId, DefaultedXAxis, DefaultedYAxis } from "../../../../models/axis.js";
1
+ import { NumberValue } from '@mui/x-charts-vendor/d3-scale';
2
+ import { ChartsXAxisProps, ChartsAxisProps, ChartsYAxisProps, AxisId, DefaultedXAxis, DefaultedYAxis, D3Scale } from "../../../../models/axis.js";
2
3
  import { ChartSeriesType } from "../../../../models/seriesType/config.js";
3
4
  import type { ChartDrawingArea } from "../../../../hooks/index.js";
4
5
  import { ChartSeriesConfig } from "../../models/seriesConfig/index.js";
5
- import { ComputedAxisConfig, DefaultizedZoomOptions } from "./useChartCartesianAxis.types.js";
6
+ import { ComputedAxisConfig } from "./useChartCartesianAxis.types.js";
6
7
  import { ProcessedSeries } from "../../corePlugins/useChartSeries/useChartSeries.types.js";
7
- import { GetZoomAxisFilters, ZoomData } from "./zoom.types.js";
8
- import { ScaleDefinition } from "./getAxisScale.js";
8
+ import { ZoomData } from "./zoom.types.js";
9
9
  export type ComputeResult<T extends ChartsAxisProps> = {
10
10
  axis: ComputedAxisConfig<T>;
11
11
  axisIds: AxisId[];
12
12
  };
13
13
  type ComputeCommonParams<T extends ChartSeriesType = ChartSeriesType> = {
14
- scales: Record<AxisId, ScaleDefinition>;
14
+ scales: Record<AxisId, D3Scale>;
15
15
  drawingArea: ChartDrawingArea;
16
16
  formattedSeries: ProcessedSeries<T>;
17
17
  seriesConfig: ChartSeriesConfig<T>;
18
18
  zoomMap?: Map<AxisId, ZoomData>;
19
- zoomOptions?: Record<AxisId, DefaultizedZoomOptions>;
20
- getFilters?: GetZoomAxisFilters;
21
- /**
22
- * @deprecated To remove in v9. This is an experimental feature to avoid breaking change.
23
- */
24
- preferStrictDomainInLineCharts?: boolean;
19
+ domains: Record<AxisId, {
20
+ domain: ReadonlyArray<string | NumberValue>;
21
+ tickNumber?: number;
22
+ }>;
25
23
  };
26
24
  export declare function computeAxisValue<T extends ChartSeriesType>(options: ComputeCommonParams<T> & {
27
25
  axis?: DefaultedYAxis[];
@@ -12,9 +12,7 @@ var _colorScale = require("../../../colorScale");
12
12
  var _ticks = require("../../../ticks");
13
13
  var _getScale = require("../../../getScale");
14
14
  var _dateHelpers = require("../../../dateHelpers");
15
- var _getAxisExtrema = require("./getAxisExtrema");
16
15
  var _getAxisTriggerTooltip = require("./getAxisTriggerTooltip");
17
- var _getAxisScale = require("./getAxisScale");
18
16
  var _scaleGuards = require("../../../scaleGuards");
19
17
  function getRange(drawingArea, axisDirection,
20
18
  // | 'rotation' | 'radius',
@@ -32,9 +30,7 @@ function computeAxisValue({
32
30
  seriesConfig,
33
31
  axisDirection,
34
32
  zoomMap,
35
- zoomOptions,
36
- getFilters,
37
- preferStrictDomainInLineCharts
33
+ domains
38
34
  }) {
39
35
  if (allAxis === undefined) {
40
36
  return {
@@ -44,11 +40,9 @@ function computeAxisValue({
44
40
  }
45
41
  const axisIdsTriggeringTooltip = (0, _getAxisTriggerTooltip.getAxisTriggerTooltip)(axisDirection, seriesConfig, formattedSeries, allAxis[0].id);
46
42
  const completeAxis = {};
47
- allAxis.forEach((eachAxis, axisIndex) => {
43
+ allAxis.forEach(eachAxis => {
48
44
  const axis = eachAxis;
49
- const scaleDefinition = scales[axis.id];
50
- let scale = scaleDefinition.scale;
51
- const zoomOption = zoomOptions?.[axis.id];
45
+ const scale = scales[axis.id];
52
46
  const zoom = zoomMap?.get(axis.id);
53
47
  const zoomRange = zoom ? [zoom.start, zoom.end] : [0, 100];
54
48
  const range = getRange(drawingArea, axisDirection, axis.reverse ?? false);
@@ -99,28 +93,10 @@ function computeAxisValue({
99
93
  // Could be merged with the two previous "if conditions" but then TS does not get that `axis.scaleType` can't be `band` or `point`.
100
94
  return;
101
95
  }
102
- const rawTickNumber = scaleDefinition.tickNumber;
96
+ const rawTickNumber = domains[axis.id].tickNumber;
103
97
  const continuousAxis = axis;
104
98
  const scaleType = continuousAxis.scaleType ?? 'linear';
105
99
  const tickNumber = (0, _ticks.scaleTickNumberByRange)(rawTickNumber, zoomRange);
106
- const filter = zoom === undefined && !zoomOption ? getFilters : undefined; // Do not apply filtering if zoom is already defined.
107
- if (filter) {
108
- const [minData, maxData] = (0, _getAxisExtrema.getAxisExtrema)(axis, axisDirection, seriesConfig, axisIndex, formattedSeries, filter);
109
- scale = scale.copy();
110
- scale.domain([minData, maxData]);
111
- const domainLimit = (0, _getAxisScale.getDomainLimit)(axis, axisDirection, axisIndex, formattedSeries, preferStrictDomainInLineCharts);
112
- const axisExtrema = (0, _getAxisScale.getActualAxisExtrema)(axis, minData, maxData);
113
- if (typeof domainLimit === 'function') {
114
- const {
115
- min,
116
- max
117
- } = domainLimit(minData, maxData);
118
- axisExtrema[0] = min;
119
- axisExtrema[1] = max;
120
- }
121
- scale.domain(axisExtrema);
122
- (0, _getAxisScale.applyDomainLimit)(scale, axis, domainLimit, rawTickNumber);
123
- }
124
100
  completeAxis[axis.id] = (0, _extends2.default)({
125
101
  offset: 0,
126
102
  height: 0,
@@ -1,8 +1,7 @@
1
- import { AxisId, D3ContinuousScale, D3Scale } from "../../../../models/axis.js";
1
+ import { NumberValue } from '@mui/x-charts-vendor/d3-scale';
2
2
  import { AxisConfig } from "../../../../models/index.js";
3
- import { DefaultizedZoomOptions, ExtremumFilter } from "./useChartCartesianAxis.types.js";
4
- import { GetZoomAxisFilters, ZoomAxisFilters, ZoomData } from "./zoom.types.js";
5
- export declare function createAxisFilterMapper(zoomMap: Map<AxisId, ZoomData>, zoomOptions: Record<AxisId, DefaultizedZoomOptions>, direction: 'x' | 'y'): (axisId: AxisId, axisData: AxisConfig['data'], scale: D3Scale) => ExtremumFilter | null;
3
+ import { ExtremumFilter } from "./useChartCartesianAxis.types.js";
4
+ import { GetZoomAxisFilters, ZoomAxisFilters } from "./zoom.types.js";
6
5
  export declare function createDiscreteScaleGetAxisFilter(axisData: AxisConfig['data'], zoomStart: number, zoomEnd: number, direction: 'x' | 'y'): ExtremumFilter;
7
- export declare function createContinuousScaleGetAxisFilter(scale: D3ContinuousScale, zoomStart: number, zoomEnd: number, direction: 'x' | 'y', axisData: AxisConfig['data']): ExtremumFilter;
6
+ export declare function createContinuousScaleGetAxisFilter(domain: readonly NumberValue[], zoomStart: number, zoomEnd: number, direction: 'x' | 'y', axisData: AxisConfig['data']): ExtremumFilter;
8
7
  export declare const createGetAxisFilters: (filters: ZoomAxisFilters) => GetZoomAxisFilters;
@@ -3,29 +3,10 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.createAxisFilterMapper = createAxisFilterMapper;
7
6
  exports.createContinuousScaleGetAxisFilter = createContinuousScaleGetAxisFilter;
8
7
  exports.createDiscreteScaleGetAxisFilter = createDiscreteScaleGetAxisFilter;
9
8
  exports.createGetAxisFilters = void 0;
10
9
  var _isDefined = require("../../../isDefined");
11
- var _scaleGuards = require("../../../scaleGuards");
12
- function createAxisFilterMapper(zoomMap, zoomOptions, direction) {
13
- return (axisId, axisData, scale) => {
14
- const zoomOption = zoomOptions[axisId];
15
- if (!zoomOption || zoomOption.filterMode !== 'discard') {
16
- return null;
17
- }
18
- const zoom = zoomMap?.get(axisId);
19
- if (zoom === undefined || zoom.start <= 0 && zoom.end >= 100) {
20
- // No zoom, or zoom with all data visible
21
- return null;
22
- }
23
- if ((0, _scaleGuards.isOrdinalScale)(scale)) {
24
- return createDiscreteScaleGetAxisFilter(axisData, zoom.start, zoom.end, direction);
25
- }
26
- return createContinuousScaleGetAxisFilter(scale, zoom.start, zoom.end, direction, axisData);
27
- };
28
- }
29
10
  function createDiscreteScaleGetAxisFilter(axisData, zoomStart, zoomEnd, direction) {
30
11
  const maxIndex = axisData?.length ?? 0;
31
12
  const minVal = Math.floor(zoomStart * maxIndex / 100);
@@ -39,12 +20,9 @@ function createDiscreteScaleGetAxisFilter(axisData, zoomStart, zoomEnd, directio
39
20
  return dataIndex >= minVal && dataIndex < maxVal;
40
21
  };
41
22
  }
42
- function createContinuousScaleGetAxisFilter(scale, zoomStart, zoomEnd, direction, axisData) {
43
- let min;
44
- let max;
45
- [min, max] = scale.domain();
46
- min = min instanceof Date ? min.getTime() : min;
47
- max = max instanceof Date ? max.getTime() : max;
23
+ function createContinuousScaleGetAxisFilter(domain, zoomStart, zoomEnd, direction, axisData) {
24
+ const min = domain[0].valueOf();
25
+ const max = domain[1].valueOf();
48
26
  const minVal = min + zoomStart * (max - min) / 100;
49
27
  const maxVal = min + zoomEnd * (max - min) / 100;
50
28
  return function filterAxis(value, dataIndex) {