@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.
- package/BarChart/BarChart.js +44 -36
- package/CHANGELOG.md +171 -1
- package/ChartContainer/ChartContainer.js +68 -56
- package/ChartsTooltip/ChartsTooltipContainer.js +2 -0
- package/ChartsXAxis/useAxisTicksProps.d.ts +197 -355
- package/ChartsYAxis/useAxisTicksProps.d.ts +197 -355
- package/LineChart/LineChart.js +44 -36
- package/PieChart/PieArc.d.ts +18 -4
- package/PieChart/PieArc.js +11 -5
- package/PieChart/PieArcPlot.js +3 -1
- package/ScatterChart/ScatterChart.js +44 -36
- package/SparkLineChart/SparkLineChart.js +44 -36
- package/esm/BarChart/BarChart.js +44 -36
- package/esm/ChartContainer/ChartContainer.js +68 -56
- package/esm/ChartsTooltip/ChartsTooltipContainer.js +2 -0
- package/esm/ChartsXAxis/useAxisTicksProps.d.ts +197 -355
- package/esm/ChartsYAxis/useAxisTicksProps.d.ts +197 -355
- package/esm/LineChart/LineChart.js +44 -36
- package/esm/PieChart/PieArc.d.ts +18 -4
- package/esm/PieChart/PieArc.js +11 -5
- package/esm/PieChart/PieArcPlot.js +3 -1
- package/esm/ScatterChart/ScatterChart.js +44 -36
- package/esm/SparkLineChart/SparkLineChart.js +44 -36
- package/esm/hooks/animation/useAnimate.js +5 -3
- package/esm/hooks/useScale.d.ts +5 -1
- package/esm/index.js +1 -1
- package/esm/internals/animation/useAnimateInternal.d.ts +1 -1
- package/esm/internals/animation/useAnimateInternal.js +1 -1
- package/esm/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.js +8 -8
- package/esm/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.types.d.ts +4 -2
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.d.ts +9 -11
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.js +4 -28
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/createAxisFilterMapper.d.ts +4 -5
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/createAxisFilterMapper.js +3 -24
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/domain.d.ts +20 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/domain.js +77 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisScale.d.ts +4 -65
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisScale.js +7 -104
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPreview.selectors.d.ts +3 -3
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPreview.selectors.js +31 -39
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +166 -6
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.js +158 -47
- package/esm/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.js +10 -3
- package/esm/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.d.ts +4 -4
- package/esm/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.js +3 -2
- package/esm/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.types.d.ts +6 -0
- package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.js +5 -1
- package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.d.ts +9 -1
- package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.js +10 -1
- package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.types.d.ts +2 -1
- package/esm/internals/plugins/featurePlugins/useChartPolarAxis/computeAxisValue.js +2 -2
- package/esm/internals/scaleGuards.d.ts +12 -6
- package/esm/internals/symlogScale.js +5 -0
- package/esm/locales/enUS.js +4 -4
- package/esm/locales/ptBR.js +97 -99
- package/esm/models/axis.d.ts +39 -17
- package/esm/models/axis.js +3 -0
- package/hooks/animation/useAnimate.js +4 -3
- package/hooks/useScale.d.ts +5 -1
- package/index.js +1 -1
- package/internals/animation/useAnimateInternal.d.ts +1 -1
- package/internals/animation/useAnimateInternal.js +1 -1
- package/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.js +7 -7
- package/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.types.d.ts +4 -2
- package/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.d.ts +9 -11
- package/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.js +4 -28
- package/internals/plugins/featurePlugins/useChartCartesianAxis/createAxisFilterMapper.d.ts +4 -5
- package/internals/plugins/featurePlugins/useChartCartesianAxis/createAxisFilterMapper.js +3 -25
- package/internals/plugins/featurePlugins/useChartCartesianAxis/domain.d.ts +20 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/domain.js +84 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisScale.d.ts +4 -65
- package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisScale.js +8 -108
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPreview.selectors.d.ts +3 -3
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPreview.selectors.js +29 -37
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +166 -6
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.js +158 -47
- package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.js +10 -3
- package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.d.ts +4 -4
- package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.js +3 -2
- package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.types.d.ts +6 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.js +5 -1
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.d.ts +9 -1
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.js +11 -2
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.types.d.ts +2 -1
- package/internals/plugins/featurePlugins/useChartPolarAxis/computeAxisValue.js +1 -1
- package/internals/scaleGuards.d.ts +12 -6
- package/internals/symlogScale.js +5 -0
- package/locales/enUS.js +4 -4
- package/locales/ptBR.js +97 -99
- package/models/axis.d.ts +39 -17
- package/models/axis.js +4 -0
- package/package.json +6 -6
package/esm/locales/ptBR.js
CHANGED
|
@@ -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
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
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
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
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);
|
package/esm/models/axis.d.ts
CHANGED
|
@@ -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
|
-
} =
|
|
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
|
-
} =
|
|
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<
|
|
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<
|
|
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
|
-
*
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
};
|
package/esm/models/axis.js
CHANGED
|
@@ -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 :
|
|
51
|
-
return (0, _extends2.default)({},
|
|
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
|
}
|
package/hooks/useScale.d.ts
CHANGED
|
@@ -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
|
|
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
|
@@ -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];
|
package/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.js
CHANGED
|
@@ -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
|
-
|
|
51
|
+
dragThreshold: 10
|
|
52
|
+
}), new _core.PressAndDragGesture({
|
|
53
|
+
name: 'zoomPressAndDrag',
|
|
54
54
|
dragThreshold: 10,
|
|
55
|
-
|
|
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' | '
|
|
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 {
|
|
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
|
|
6
|
+
import { ComputedAxisConfig } from "./useChartCartesianAxis.types.js";
|
|
6
7
|
import { ProcessedSeries } from "../../corePlugins/useChartSeries/useChartSeries.types.js";
|
|
7
|
-
import {
|
|
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,
|
|
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
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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
|
-
|
|
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(
|
|
43
|
+
allAxis.forEach(eachAxis => {
|
|
48
44
|
const axis = eachAxis;
|
|
49
|
-
const
|
|
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 =
|
|
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 {
|
|
1
|
+
import { NumberValue } from '@mui/x-charts-vendor/d3-scale';
|
|
2
2
|
import { AxisConfig } from "../../../../models/index.js";
|
|
3
|
-
import {
|
|
4
|
-
import { GetZoomAxisFilters, ZoomAxisFilters
|
|
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(
|
|
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(
|
|
43
|
-
|
|
44
|
-
|
|
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) {
|