@mui/x-charts 9.4.0 → 9.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +100 -0
- package/ChartsRadialAxisHighlight/index.d.mts +6 -1
- package/ChartsRadialAxisHighlight/index.d.ts +6 -1
- package/ChartsRadialAxisHighlight/index.js +9 -2
- package/ChartsRadialAxisHighlight/index.mjs +8 -1
- package/ChartsRadialDataProvider/ChartsRadialDataProvider.d.mts +1 -1
- package/ChartsRadialDataProvider/ChartsRadialDataProvider.d.ts +1 -1
- package/ChartsRadialDataProvider/ChartsRadialDataProvider.js +1 -1
- package/ChartsRadialDataProvider/ChartsRadialDataProvider.mjs +1 -1
- package/ChartsRadialDataProvider/index.d.mts +5 -0
- package/ChartsRadialDataProvider/index.d.ts +5 -0
- package/ChartsRadialDataProvider/index.js +12 -1
- package/ChartsRadialDataProvider/index.mjs +7 -0
- package/ChartsRadialGrid/index.d.mts +6 -1
- package/ChartsRadialGrid/index.d.ts +6 -1
- package/ChartsRadialGrid/index.js +8 -2
- package/ChartsRadialGrid/index.mjs +8 -1
- package/ChartsRadiusAxis/index.d.mts +6 -1
- package/ChartsRadiusAxis/index.d.ts +6 -1
- package/ChartsRadiusAxis/index.js +10 -2
- package/ChartsRadiusAxis/index.mjs +7 -1
- package/ChartsRotationAxis/index.d.mts +6 -1
- package/ChartsRotationAxis/index.d.ts +6 -1
- package/ChartsRotationAxis/index.js +10 -2
- package/ChartsRotationAxis/index.mjs +7 -1
- package/ChartsTooltip/ChartsTooltipContainer.js +11 -4
- package/ChartsTooltip/ChartsTooltipContainer.mjs +11 -4
- package/LineChart/AreaElement.js +1 -1
- package/LineChart/AreaElement.mjs +1 -1
- package/LineChart/CircleMarkElement.js +1 -1
- package/LineChart/CircleMarkElement.mjs +1 -1
- package/LineChart/LineElement.js +1 -1
- package/LineChart/LineElement.mjs +1 -1
- package/LineChart/MarkElement.js +1 -1
- package/LineChart/MarkElement.mjs +1 -1
- package/ScatterChart/ScatterChart.js +7 -3
- package/ScatterChart/ScatterChart.mjs +7 -3
- package/ScatterChart/ScatterChart.plugins.d.mts +2 -1
- package/ScatterChart/ScatterChart.plugins.d.ts +2 -1
- package/ScatterChart/ScatterChart.plugins.js +2 -1
- package/ScatterChart/ScatterChart.plugins.mjs +2 -1
- package/ScatterChart/ScatterPlot.d.mts +4 -2
- package/ScatterChart/ScatterPlot.d.ts +4 -2
- package/ScatterChart/ScatterPlot.js +25 -3
- package/ScatterChart/ScatterPlot.mjs +25 -3
- package/ScatterChart/async/ScatterAsync.d.mts +9 -0
- package/ScatterChart/async/ScatterAsync.d.ts +9 -0
- package/ScatterChart/async/ScatterAsync.js +71 -0
- package/ScatterChart/async/ScatterAsync.mjs +67 -0
- package/ScatterChart/async/ScatterAsyncBatch.d.mts +24 -0
- package/ScatterChart/async/ScatterAsyncBatch.d.ts +24 -0
- package/ScatterChart/async/ScatterAsyncBatch.js +112 -0
- package/ScatterChart/async/ScatterAsyncBatch.mjs +106 -0
- package/ScatterChart/async/scatterRenderData.selectors.d.mts +38 -0
- package/ScatterChart/async/scatterRenderData.selectors.d.ts +38 -0
- package/ScatterChart/async/scatterRenderData.selectors.js +93 -0
- package/ScatterChart/async/scatterRenderData.selectors.mjs +87 -0
- package/SparkLineChart/SparkLineChart.js +2 -1
- package/SparkLineChart/SparkLineChart.mjs +2 -1
- package/index.js +1 -1
- package/index.mjs +1 -1
- package/internals/getSeriesColorFn.d.mts +5 -5
- package/internals/getSeriesColorFn.d.ts +5 -5
- package/internals/index.d.mts +1 -0
- package/internals/index.d.ts +1 -0
- package/internals/index.js +12 -0
- package/internals/index.mjs +1 -0
- package/internals/plugins/allPlugins.d.mts +4 -3
- package/internals/plugins/allPlugins.d.ts +4 -3
- package/internals/plugins/allPlugins.js +2 -1
- package/internals/plugins/allPlugins.mjs +2 -1
- package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.selectors.d.mts +12 -3
- package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.selectors.d.ts +12 -3
- package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.selectors.js +10 -1
- package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.selectors.mjs +10 -1
- package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.d.mts +15 -1
- package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.d.ts +15 -1
- package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisScale.js +27 -2
- package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisScale.mjs +27 -2
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +1 -3
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.mjs +1 -3
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.js +1 -1
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.mjs +1 -1
- package/internals/plugins/featurePlugins/useProgressiveRendering/index.d.mts +3 -0
- package/internals/plugins/featurePlugins/useProgressiveRendering/index.d.ts +3 -0
- package/internals/plugins/featurePlugins/useProgressiveRendering/index.js +27 -0
- package/internals/plugins/featurePlugins/useProgressiveRendering/index.mjs +2 -0
- package/internals/plugins/featurePlugins/useProgressiveRendering/useProgressiveRendering.d.mts +13 -0
- package/internals/plugins/featurePlugins/useProgressiveRendering/useProgressiveRendering.d.ts +13 -0
- package/internals/plugins/featurePlugins/useProgressiveRendering/useProgressiveRendering.js +136 -0
- package/internals/plugins/featurePlugins/useProgressiveRendering/useProgressiveRendering.mjs +128 -0
- package/internals/plugins/featurePlugins/useProgressiveRendering/useProgressiveRendering.selectors.d.mts +42 -0
- package/internals/plugins/featurePlugins/useProgressiveRendering/useProgressiveRendering.selectors.d.ts +42 -0
- package/internals/plugins/featurePlugins/useProgressiveRendering/useProgressiveRendering.selectors.js +166 -0
- package/internals/plugins/featurePlugins/useProgressiveRendering/useProgressiveRendering.selectors.mjs +159 -0
- package/internals/plugins/featurePlugins/useProgressiveRendering/useProgressiveRendering.types.d.mts +34 -0
- package/internals/plugins/featurePlugins/useProgressiveRendering/useProgressiveRendering.types.d.ts +34 -0
- package/internals/plugins/featurePlugins/useProgressiveRendering/useProgressiveRendering.types.js +5 -0
- package/internals/plugins/featurePlugins/useProgressiveRendering/useProgressiveRendering.types.mjs +1 -0
- package/internals/scales/scaleBand.js +70 -43
- package/internals/scales/scaleBand.mjs +71 -44
- package/models/seriesType/bar.d.mts +1 -1
- package/models/seriesType/bar.d.ts +1 -1
- package/models/seriesType/common.d.mts +4 -4
- package/models/seriesType/common.d.ts +4 -4
- package/models/seriesType/config.d.mts +3 -3
- package/models/seriesType/config.d.ts +3 -3
- package/models/seriesType/line.d.mts +1 -1
- package/models/seriesType/line.d.ts +1 -1
- package/models/seriesType/pie.d.mts +1 -1
- package/models/seriesType/pie.d.ts +1 -1
- package/models/seriesType/radar.d.mts +1 -1
- package/models/seriesType/radar.d.ts +1 -1
- package/models/seriesType/scatter.d.mts +1 -1
- package/models/seriesType/scatter.d.ts +1 -1
- package/package.json +3 -3
|
@@ -13,7 +13,21 @@ interface LineExperimentalFeatures {
|
|
|
13
13
|
*/
|
|
14
14
|
enablePositionBasedPointerInteraction?: boolean;
|
|
15
15
|
}
|
|
16
|
-
|
|
16
|
+
interface ScatterExperimentalFeatures {
|
|
17
|
+
/**
|
|
18
|
+
* Enables automatic progressive (batched) rendering for scatter series.
|
|
19
|
+
*
|
|
20
|
+
* When enabled and the `renderer` prop is left unset, the chart switches to
|
|
21
|
+
* the `svg-progressive` renderer above an internal point-count threshold,
|
|
22
|
+
* painting points over several animation frames to keep the main thread
|
|
23
|
+
* responsive. When disabled, the unset `renderer` keeps the synchronous
|
|
24
|
+
* `svg-single` renderer. Setting `renderer` explicitly is unaffected.
|
|
25
|
+
*
|
|
26
|
+
* This behavior will become the default in the next major version.
|
|
27
|
+
*/
|
|
28
|
+
progressiveRendering?: boolean;
|
|
29
|
+
}
|
|
30
|
+
export type ChartExperimentalFeatures<SeriesType extends ChartSeriesType = ChartSeriesType> = ('line' extends SeriesType ? LineExperimentalFeatures : {}) & ('scatter' extends SeriesType ? ScatterExperimentalFeatures : {});
|
|
17
31
|
export interface UseChartExperimentalFeaturesParameters<SeriesType extends ChartSeriesType = ChartSeriesType> {
|
|
18
32
|
/**
|
|
19
33
|
* Options to enable features planned for the next major.
|
|
@@ -13,14 +13,39 @@ function getRange(drawingArea, axisDirection, axis) {
|
|
|
13
13
|
const range = axisDirection === 'x' ? [drawingArea.left, drawingArea.left + drawingArea.width] : [drawingArea.top + drawingArea.height, drawingArea.top];
|
|
14
14
|
return axis.reverse ? [range[1], range[0]] : range;
|
|
15
15
|
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Caches the normalized ordinal scale so it is not rebuilt on every pan/zoom frame. Building a
|
|
19
|
+
* band/point scale is `O(domain)` — it interns the whole domain — which is prohibitive for large
|
|
20
|
+
* category axes when zooming. The domain array (the axis `data`) is referentially stable across
|
|
21
|
+
* zoom, so it is the outer key; a `WeakMap` lets unused domains be collected. The inner key is the
|
|
22
|
+
* scale variant (type + padding), because the same domain array can back several axes (e.g. a `band`
|
|
23
|
+
* and a `point` axis sharing one `data` array), which must not share a scale. Continuous scales are
|
|
24
|
+
* not cached: they are cheap to build and their domain reference changes with zoom anyway, so a
|
|
25
|
+
* cache would only ever miss.
|
|
26
|
+
*/
|
|
27
|
+
const normalizedScaleCache = new WeakMap();
|
|
28
|
+
function getCachedOrdinalScale(domain, variant, build) {
|
|
29
|
+
let variants = normalizedScaleCache.get(domain);
|
|
30
|
+
if (!variants) {
|
|
31
|
+
variants = new Map();
|
|
32
|
+
normalizedScaleCache.set(domain, variants);
|
|
33
|
+
}
|
|
34
|
+
let scale = variants.get(variant);
|
|
35
|
+
if (!scale) {
|
|
36
|
+
scale = build();
|
|
37
|
+
variants.set(variant, scale);
|
|
38
|
+
}
|
|
39
|
+
return scale;
|
|
40
|
+
}
|
|
16
41
|
function getNormalizedAxisScale(axis, domain) {
|
|
17
42
|
const range = [0, 1];
|
|
18
43
|
if ((0, _axis.isBandScaleConfig)(axis)) {
|
|
19
44
|
const categoryGapRatio = axis.categoryGapRatio ?? DEFAULT_CATEGORY_GAP_RATIO;
|
|
20
|
-
return (0, _scales.scaleBand)(domain, range).paddingInner(categoryGapRatio).paddingOuter(categoryGapRatio / 2);
|
|
45
|
+
return getCachedOrdinalScale(domain, `band:${categoryGapRatio}`, () => (0, _scales.scaleBand)(domain, range).paddingInner(categoryGapRatio).paddingOuter(categoryGapRatio / 2));
|
|
21
46
|
}
|
|
22
47
|
if ((0, _axis.isPointScaleConfig)(axis)) {
|
|
23
|
-
return (0, _scales.scalePoint)(domain, range);
|
|
48
|
+
return getCachedOrdinalScale(domain, 'point', () => (0, _scales.scalePoint)(domain, range));
|
|
24
49
|
}
|
|
25
50
|
const scaleType = axis.scaleType ?? 'linear';
|
|
26
51
|
const scale = (0, _getScale.getScale)(scaleType, domain, range);
|
|
@@ -6,14 +6,39 @@ export function getRange(drawingArea, axisDirection, axis) {
|
|
|
6
6
|
const range = axisDirection === 'x' ? [drawingArea.left, drawingArea.left + drawingArea.width] : [drawingArea.top + drawingArea.height, drawingArea.top];
|
|
7
7
|
return axis.reverse ? [range[1], range[0]] : range;
|
|
8
8
|
}
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Caches the normalized ordinal scale so it is not rebuilt on every pan/zoom frame. Building a
|
|
12
|
+
* band/point scale is `O(domain)` — it interns the whole domain — which is prohibitive for large
|
|
13
|
+
* category axes when zooming. The domain array (the axis `data`) is referentially stable across
|
|
14
|
+
* zoom, so it is the outer key; a `WeakMap` lets unused domains be collected. The inner key is the
|
|
15
|
+
* scale variant (type + padding), because the same domain array can back several axes (e.g. a `band`
|
|
16
|
+
* and a `point` axis sharing one `data` array), which must not share a scale. Continuous scales are
|
|
17
|
+
* not cached: they are cheap to build and their domain reference changes with zoom anyway, so a
|
|
18
|
+
* cache would only ever miss.
|
|
19
|
+
*/
|
|
20
|
+
const normalizedScaleCache = new WeakMap();
|
|
21
|
+
function getCachedOrdinalScale(domain, variant, build) {
|
|
22
|
+
let variants = normalizedScaleCache.get(domain);
|
|
23
|
+
if (!variants) {
|
|
24
|
+
variants = new Map();
|
|
25
|
+
normalizedScaleCache.set(domain, variants);
|
|
26
|
+
}
|
|
27
|
+
let scale = variants.get(variant);
|
|
28
|
+
if (!scale) {
|
|
29
|
+
scale = build();
|
|
30
|
+
variants.set(variant, scale);
|
|
31
|
+
}
|
|
32
|
+
return scale;
|
|
33
|
+
}
|
|
9
34
|
export function getNormalizedAxisScale(axis, domain) {
|
|
10
35
|
const range = [0, 1];
|
|
11
36
|
if (isBandScaleConfig(axis)) {
|
|
12
37
|
const categoryGapRatio = axis.categoryGapRatio ?? DEFAULT_CATEGORY_GAP_RATIO;
|
|
13
|
-
return scaleBand(domain, range).paddingInner(categoryGapRatio).paddingOuter(categoryGapRatio / 2);
|
|
38
|
+
return getCachedOrdinalScale(domain, `band:${categoryGapRatio}`, () => scaleBand(domain, range).paddingInner(categoryGapRatio).paddingOuter(categoryGapRatio / 2));
|
|
14
39
|
}
|
|
15
40
|
if (isPointScaleConfig(axis)) {
|
|
16
|
-
return scalePoint(domain, range);
|
|
41
|
+
return getCachedOrdinalScale(domain, 'point', () => scalePoint(domain, range));
|
|
17
42
|
}
|
|
18
43
|
const scaleType = axis.scaleType ?? 'linear';
|
|
19
44
|
const scale = getScale(scaleType, domain, range);
|
|
@@ -14,7 +14,6 @@ var _store = require("@mui/x-internals/store");
|
|
|
14
14
|
var _useAssertModelConsistency = require("@mui/x-internals/useAssertModelConsistency");
|
|
15
15
|
var _warning = require("@mui/x-internals/warning");
|
|
16
16
|
var _colorPalettes = require("../../../../colorPalettes");
|
|
17
|
-
var _useChartDimensions = require("../../corePlugins/useChartDimensions/useChartDimensions.selectors");
|
|
18
17
|
var _useChartSeries = require("../../corePlugins/useChartSeries/useChartSeries.selectors");
|
|
19
18
|
var _defaultizeAxis = require("./defaultizeAxis");
|
|
20
19
|
var _useChartCartesianAxisRendering = require("./useChartCartesianAxisRendering.selectors");
|
|
@@ -47,7 +46,6 @@ const useChartCartesianAxis = ({
|
|
|
47
46
|
(0, _warning.warnOnce)([`MUI X Charts: The following axis ids are duplicated: ${Array.from(duplicates).join(', ')}.`, `Please make sure that each axis has a unique id.`].join('\n'), 'error');
|
|
48
47
|
}
|
|
49
48
|
}
|
|
50
|
-
const drawingArea = store.use(_useChartDimensions.selectorChartDrawingArea);
|
|
51
49
|
const processedSeries = store.use(_useChartSeries.selectorChartSeriesProcessed);
|
|
52
50
|
const isInteractionEnabled = store.use(_useChartInteraction.selectorChartsInteractionIsInitialized);
|
|
53
51
|
const {
|
|
@@ -96,7 +94,7 @@ const useChartCartesianAxis = ({
|
|
|
96
94
|
x: (0, _defaultizeAxis.defaultizeXAxis)(xAxis, dataset, axesGap),
|
|
97
95
|
y: (0, _defaultizeAxis.defaultizeYAxis)(yAxis, dataset, axesGap)
|
|
98
96
|
});
|
|
99
|
-
}, [
|
|
97
|
+
}, [xAxis, yAxis, dataset, axesGap, store]);
|
|
100
98
|
const usedXAxis = xAxisIds[0];
|
|
101
99
|
const usedYAxis = yAxisIds[0];
|
|
102
100
|
(0, _store.useStoreEffect)(store, _useChartCartesianInteraction.selectorChartAxisInteraction, (prevAxisInteraction, nextAxisInteraction) => {
|
|
@@ -7,7 +7,6 @@ import { useStoreEffect } from '@mui/x-internals/store';
|
|
|
7
7
|
import { useAssertModelConsistency } from '@mui/x-internals/useAssertModelConsistency';
|
|
8
8
|
import { warnOnce } from '@mui/x-internals/warning';
|
|
9
9
|
import { rainbowSurgePalette } from "../../../../colorPalettes/index.mjs";
|
|
10
|
-
import { selectorChartDrawingArea } from "../../corePlugins/useChartDimensions/useChartDimensions.selectors.mjs";
|
|
11
10
|
import { selectorChartSeriesProcessed } from "../../corePlugins/useChartSeries/useChartSeries.selectors.mjs";
|
|
12
11
|
import { defaultizeXAxis, defaultizeYAxis } from "./defaultizeAxis.mjs";
|
|
13
12
|
import { selectorChartXAxis, selectorChartYAxis } from "./useChartCartesianAxisRendering.selectors.mjs";
|
|
@@ -40,7 +39,6 @@ export const useChartCartesianAxis = ({
|
|
|
40
39
|
warnOnce([`MUI X Charts: The following axis ids are duplicated: ${Array.from(duplicates).join(', ')}.`, `Please make sure that each axis has a unique id.`].join('\n'), 'error');
|
|
41
40
|
}
|
|
42
41
|
}
|
|
43
|
-
const drawingArea = store.use(selectorChartDrawingArea);
|
|
44
42
|
const processedSeries = store.use(selectorChartSeriesProcessed);
|
|
45
43
|
const isInteractionEnabled = store.use(selectorChartsInteractionIsInitialized);
|
|
46
44
|
const {
|
|
@@ -89,7 +87,7 @@ export const useChartCartesianAxis = ({
|
|
|
89
87
|
x: defaultizeXAxis(xAxis, dataset, axesGap),
|
|
90
88
|
y: defaultizeYAxis(yAxis, dataset, axesGap)
|
|
91
89
|
});
|
|
92
|
-
}, [
|
|
90
|
+
}, [xAxis, yAxis, dataset, axesGap, store]);
|
|
93
91
|
const usedXAxis = xAxisIds[0];
|
|
94
92
|
const usedYAxis = yAxisIds[0];
|
|
95
93
|
useStoreEffect(store, selectorChartAxisInteraction, (prevAxisInteraction, nextAxisInteraction) => {
|
|
@@ -259,7 +259,7 @@ const selectorChartDefaultYAxisId = exports.selectorChartDefaultYAxisId = (0, _s
|
|
|
259
259
|
const EMPTY_MAP = new Map();
|
|
260
260
|
const selectorChartSeriesEmptyFlatbushMap = () => EMPTY_MAP;
|
|
261
261
|
exports.selectorChartSeriesEmptyFlatbushMap = selectorChartSeriesEmptyFlatbushMap;
|
|
262
|
-
const selectorChartSeriesFlatbushMap = exports.selectorChartSeriesFlatbushMap = (0, _store.createSelectorMemoized)(_useChartSeries.selectorChartSeriesProcessed, selectorChartNormalizedXScales, selectorChartNormalizedYScales, selectorChartDefaultXAxisId, selectorChartDefaultYAxisId, _useChartZAxis.selectorChartZAxis,
|
|
262
|
+
const selectorChartSeriesFlatbushMap = exports.selectorChartSeriesFlatbushMap = (0, _store.createSelectorMemoized)(_useChartSeries.selectorChartSeriesProcessed, selectorChartNormalizedXScales, selectorChartNormalizedYScales, selectorChartDefaultXAxisId, selectorChartDefaultYAxisId, _useChartZAxis.selectorChartZAxis, function selectChartSeriesFlatbushMap(allSeries, xAxesScaleMap, yAxesScaleMap, defaultXAxisId, defaultYAxisId, zAxisState) {
|
|
263
263
|
// FIXME: Do we want to support non-scatter series here?
|
|
264
264
|
const validSeries = allSeries.scatter;
|
|
265
265
|
const flatbushMap = new Map();
|
|
@@ -250,7 +250,7 @@ export const selectorChartDefaultXAxisId = createSelector(selectorChartRawXAxis,
|
|
|
250
250
|
export const selectorChartDefaultYAxisId = createSelector(selectorChartRawYAxis, yAxes => yAxes[0].id);
|
|
251
251
|
const EMPTY_MAP = new Map();
|
|
252
252
|
export const selectorChartSeriesEmptyFlatbushMap = () => EMPTY_MAP;
|
|
253
|
-
export const selectorChartSeriesFlatbushMap = createSelectorMemoized(selectorChartSeriesProcessed, selectorChartNormalizedXScales, selectorChartNormalizedYScales, selectorChartDefaultXAxisId, selectorChartDefaultYAxisId, selectorChartZAxis,
|
|
253
|
+
export const selectorChartSeriesFlatbushMap = createSelectorMemoized(selectorChartSeriesProcessed, selectorChartNormalizedXScales, selectorChartNormalizedYScales, selectorChartDefaultXAxisId, selectorChartDefaultYAxisId, selectorChartZAxis, function selectChartSeriesFlatbushMap(allSeries, xAxesScaleMap, yAxesScaleMap, defaultXAxisId, defaultYAxisId, zAxisState) {
|
|
254
254
|
// FIXME: Do we want to support non-scatter series here?
|
|
255
255
|
const validSeries = allSeries.scatter;
|
|
256
256
|
const flatbushMap = new Map();
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { useProgressiveRendering } from "./useProgressiveRendering.mjs";
|
|
2
|
+
export type { UseProgressiveRenderingSignature, UseProgressiveRenderingInstance, UseProgressiveRenderingState } from "./useProgressiveRendering.types.mjs";
|
|
3
|
+
export * from "./useProgressiveRendering.selectors.mjs";
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { useProgressiveRendering } from "./useProgressiveRendering.js";
|
|
2
|
+
export type { UseProgressiveRenderingSignature, UseProgressiveRenderingInstance, UseProgressiveRenderingState } from "./useProgressiveRendering.types.js";
|
|
3
|
+
export * from "./useProgressiveRendering.selectors.js";
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _exportNames = {
|
|
7
|
+
useProgressiveRendering: true
|
|
8
|
+
};
|
|
9
|
+
Object.defineProperty(exports, "useProgressiveRendering", {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function () {
|
|
12
|
+
return _useProgressiveRendering.useProgressiveRendering;
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
var _useProgressiveRendering = require("./useProgressiveRendering");
|
|
16
|
+
var _useProgressiveRendering2 = require("./useProgressiveRendering.selectors");
|
|
17
|
+
Object.keys(_useProgressiveRendering2).forEach(function (key) {
|
|
18
|
+
if (key === "default" || key === "__esModule") return;
|
|
19
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
20
|
+
if (key in exports && exports[key] === _useProgressiveRendering2[key]) return;
|
|
21
|
+
Object.defineProperty(exports, key, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () {
|
|
24
|
+
return _useProgressiveRendering2[key];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
package/internals/plugins/featurePlugins/useProgressiveRendering/useProgressiveRendering.d.mts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type ChartPlugin } from "../../models/index.mjs";
|
|
2
|
+
import { type UseProgressiveRenderingSignature } from "./useProgressiveRendering.types.mjs";
|
|
3
|
+
/**
|
|
4
|
+
* Chart-wide progressive rendering coordinator.
|
|
5
|
+
*
|
|
6
|
+
* Lives on the chart store, so every renderer composed into the same chart
|
|
7
|
+
* (e.g. several `ScatterPlot` instances under one `ChartsContainer`) shares
|
|
8
|
+
* the same scheduler. Each renderer registers a plan via
|
|
9
|
+
* `setProgressivePlan(plotId, plan)`; the plugin aggregates them, computes a
|
|
10
|
+
* single per-tick budget, and ramps a global "rounds" counter — one round
|
|
11
|
+
* adds one batch in every registered series at once.
|
|
12
|
+
*/
|
|
13
|
+
export declare const useProgressiveRendering: ChartPlugin<UseProgressiveRenderingSignature>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type ChartPlugin } from "../../models/index.js";
|
|
2
|
+
import { type UseProgressiveRenderingSignature } from "./useProgressiveRendering.types.js";
|
|
3
|
+
/**
|
|
4
|
+
* Chart-wide progressive rendering coordinator.
|
|
5
|
+
*
|
|
6
|
+
* Lives on the chart store, so every renderer composed into the same chart
|
|
7
|
+
* (e.g. several `ScatterPlot` instances under one `ChartsContainer`) shares
|
|
8
|
+
* the same scheduler. Each renderer registers a plan via
|
|
9
|
+
* `setProgressivePlan(plotId, plan)`; the plugin aggregates them, computes a
|
|
10
|
+
* single per-tick budget, and ramps a global "rounds" counter — one round
|
|
11
|
+
* adds one batch in every registered series at once.
|
|
12
|
+
*/
|
|
13
|
+
export declare const useProgressiveRendering: ChartPlugin<UseProgressiveRenderingSignature>;
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
6
|
+
Object.defineProperty(exports, "__esModule", {
|
|
7
|
+
value: true
|
|
8
|
+
});
|
|
9
|
+
exports.useProgressiveRendering = void 0;
|
|
10
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
+
var React = _interopRequireWildcard(require("react"));
|
|
12
|
+
var _useEventCallback = _interopRequireDefault(require("@mui/utils/useEventCallback"));
|
|
13
|
+
var _useProgressiveRendering = require("./useProgressiveRendering.selectors");
|
|
14
|
+
const EMPTY_PLANS = new Map();
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* How many *rounds* are revealed per reveal tick once the render data is ready.
|
|
18
|
+
* A round reveals one batch in every series simultaneously, so the chart looks
|
|
19
|
+
* complete from the first paint rather than appearing series-by-series. Lower
|
|
20
|
+
* spreads the paint over more ticks (smoother, more visibly progressive);
|
|
21
|
+
* higher finishes sooner.
|
|
22
|
+
*/
|
|
23
|
+
const REVEAL_ROUNDS_PER_FRAME = 1;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* How many animation frames are skipped between two reveal ticks. `0` reveals
|
|
27
|
+
* on every frame; `1` reveals every other frame, leaving the browser an idle
|
|
28
|
+
* frame for layout, paint and input handling between commits. Higher values
|
|
29
|
+
* give the browser more CPU headroom at the cost of a slower paint.
|
|
30
|
+
*/
|
|
31
|
+
const REVEAL_FRAMES_SKIPPED = 0;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Chart-wide progressive rendering coordinator.
|
|
35
|
+
*
|
|
36
|
+
* Lives on the chart store, so every renderer composed into the same chart
|
|
37
|
+
* (e.g. several `ScatterPlot` instances under one `ChartsContainer`) shares
|
|
38
|
+
* the same scheduler. Each renderer registers a plan via
|
|
39
|
+
* `setProgressivePlan(plotId, plan)`; the plugin aggregates them, computes a
|
|
40
|
+
* single per-tick budget, and ramps a global "rounds" counter — one round
|
|
41
|
+
* adds one batch in every registered series at once.
|
|
42
|
+
*/
|
|
43
|
+
const useProgressiveRendering = ({
|
|
44
|
+
store
|
|
45
|
+
}) => {
|
|
46
|
+
const registerProgressivePlan = (0, _useEventCallback.default)((plotId, seriesIds, renderer) => {
|
|
47
|
+
if (!(0, _useProgressiveRendering.selectorShouldUseProgressiveRenderer)(store.state, seriesIds, renderer)) {
|
|
48
|
+
return undefined;
|
|
49
|
+
}
|
|
50
|
+
const current = store.state.progressiveRendering.plans.get(plotId);
|
|
51
|
+
if (!(0, _useProgressiveRendering.sameSeriesIds)(current, seriesIds)) {
|
|
52
|
+
const nextPlans = new Map(store.state.progressiveRendering.plans);
|
|
53
|
+
nextPlans.set(plotId, seriesIds);
|
|
54
|
+
// A real plan change restarts the progressive paint.
|
|
55
|
+
store.set('progressiveRendering', {
|
|
56
|
+
plans: nextPlans,
|
|
57
|
+
revealedRounds: 0
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
return () => {
|
|
61
|
+
if (!store.state.progressiveRendering.plans.has(plotId)) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
const nextPlans = new Map(store.state.progressiveRendering.plans);
|
|
65
|
+
nextPlans.delete(plotId);
|
|
66
|
+
store.set('progressiveRendering', (0, _extends2.default)({}, store.state.progressiveRendering, {
|
|
67
|
+
plans: nextPlans
|
|
68
|
+
}));
|
|
69
|
+
};
|
|
70
|
+
});
|
|
71
|
+
const plans = store.use(_useProgressiveRendering.selectorProgressivePlans) ?? EMPTY_PLANS;
|
|
72
|
+
React.useEffect(() => {
|
|
73
|
+
const startTotal = (0, _useProgressiveRendering.selectorProgressiveTotalRounds)(store.state);
|
|
74
|
+
if (startTotal === 0) {
|
|
75
|
+
return undefined;
|
|
76
|
+
}
|
|
77
|
+
if (typeof requestAnimationFrame !== 'function') {
|
|
78
|
+
store.set('progressiveRendering', (0, _extends2.default)({}, store.state.progressiveRendering, {
|
|
79
|
+
revealedRounds: startTotal
|
|
80
|
+
}));
|
|
81
|
+
return undefined;
|
|
82
|
+
}
|
|
83
|
+
let frame = 0;
|
|
84
|
+
let cancelled = false;
|
|
85
|
+
// Tracked in a closure variable, not derived inside a state updater (those
|
|
86
|
+
// must be pure and StrictMode double-invokes them, which would schedule
|
|
87
|
+
// the animation-frame chain twice).
|
|
88
|
+
let revealed = 0;
|
|
89
|
+
function scheduleNext() {
|
|
90
|
+
let remaining = REVEAL_FRAMES_SKIPPED;
|
|
91
|
+
const tick = () => {
|
|
92
|
+
if (cancelled) {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
if (remaining > 0) {
|
|
96
|
+
remaining -= 1;
|
|
97
|
+
frame = requestAnimationFrame(tick);
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
step();
|
|
101
|
+
};
|
|
102
|
+
frame = requestAnimationFrame(tick);
|
|
103
|
+
}
|
|
104
|
+
function step() {
|
|
105
|
+
if (cancelled) {
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
const total = (0, _useProgressiveRendering.selectorProgressiveTotalRounds)(store.state);
|
|
109
|
+
revealed = Math.min(total, revealed + REVEAL_ROUNDS_PER_FRAME);
|
|
110
|
+
store.set('progressiveRendering', (0, _extends2.default)({}, store.state.progressiveRendering, {
|
|
111
|
+
revealedRounds: revealed
|
|
112
|
+
}));
|
|
113
|
+
if (revealed < total) {
|
|
114
|
+
scheduleNext();
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
frame = requestAnimationFrame(step);
|
|
118
|
+
return () => {
|
|
119
|
+
cancelled = true;
|
|
120
|
+
cancelAnimationFrame(frame);
|
|
121
|
+
};
|
|
122
|
+
}, [plans, store]);
|
|
123
|
+
return {
|
|
124
|
+
instance: {
|
|
125
|
+
registerProgressivePlan
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
};
|
|
129
|
+
exports.useProgressiveRendering = useProgressiveRendering;
|
|
130
|
+
useProgressiveRendering.params = {};
|
|
131
|
+
useProgressiveRendering.getInitialState = () => ({
|
|
132
|
+
progressiveRendering: {
|
|
133
|
+
plans: EMPTY_PLANS,
|
|
134
|
+
revealedRounds: 0
|
|
135
|
+
}
|
|
136
|
+
});
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import useEventCallback from '@mui/utils/useEventCallback';
|
|
6
|
+
import { sameSeriesIds, selectorProgressivePlans, selectorProgressiveTotalRounds, selectorShouldUseProgressiveRenderer } from "./useProgressiveRendering.selectors.mjs";
|
|
7
|
+
const EMPTY_PLANS = new Map();
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* How many *rounds* are revealed per reveal tick once the render data is ready.
|
|
11
|
+
* A round reveals one batch in every series simultaneously, so the chart looks
|
|
12
|
+
* complete from the first paint rather than appearing series-by-series. Lower
|
|
13
|
+
* spreads the paint over more ticks (smoother, more visibly progressive);
|
|
14
|
+
* higher finishes sooner.
|
|
15
|
+
*/
|
|
16
|
+
const REVEAL_ROUNDS_PER_FRAME = 1;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* How many animation frames are skipped between two reveal ticks. `0` reveals
|
|
20
|
+
* on every frame; `1` reveals every other frame, leaving the browser an idle
|
|
21
|
+
* frame for layout, paint and input handling between commits. Higher values
|
|
22
|
+
* give the browser more CPU headroom at the cost of a slower paint.
|
|
23
|
+
*/
|
|
24
|
+
const REVEAL_FRAMES_SKIPPED = 0;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Chart-wide progressive rendering coordinator.
|
|
28
|
+
*
|
|
29
|
+
* Lives on the chart store, so every renderer composed into the same chart
|
|
30
|
+
* (e.g. several `ScatterPlot` instances under one `ChartsContainer`) shares
|
|
31
|
+
* the same scheduler. Each renderer registers a plan via
|
|
32
|
+
* `setProgressivePlan(plotId, plan)`; the plugin aggregates them, computes a
|
|
33
|
+
* single per-tick budget, and ramps a global "rounds" counter — one round
|
|
34
|
+
* adds one batch in every registered series at once.
|
|
35
|
+
*/
|
|
36
|
+
export const useProgressiveRendering = ({
|
|
37
|
+
store
|
|
38
|
+
}) => {
|
|
39
|
+
const registerProgressivePlan = useEventCallback((plotId, seriesIds, renderer) => {
|
|
40
|
+
if (!selectorShouldUseProgressiveRenderer(store.state, seriesIds, renderer)) {
|
|
41
|
+
return undefined;
|
|
42
|
+
}
|
|
43
|
+
const current = store.state.progressiveRendering.plans.get(plotId);
|
|
44
|
+
if (!sameSeriesIds(current, seriesIds)) {
|
|
45
|
+
const nextPlans = new Map(store.state.progressiveRendering.plans);
|
|
46
|
+
nextPlans.set(plotId, seriesIds);
|
|
47
|
+
// A real plan change restarts the progressive paint.
|
|
48
|
+
store.set('progressiveRendering', {
|
|
49
|
+
plans: nextPlans,
|
|
50
|
+
revealedRounds: 0
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
return () => {
|
|
54
|
+
if (!store.state.progressiveRendering.plans.has(plotId)) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
const nextPlans = new Map(store.state.progressiveRendering.plans);
|
|
58
|
+
nextPlans.delete(plotId);
|
|
59
|
+
store.set('progressiveRendering', _extends({}, store.state.progressiveRendering, {
|
|
60
|
+
plans: nextPlans
|
|
61
|
+
}));
|
|
62
|
+
};
|
|
63
|
+
});
|
|
64
|
+
const plans = store.use(selectorProgressivePlans) ?? EMPTY_PLANS;
|
|
65
|
+
React.useEffect(() => {
|
|
66
|
+
const startTotal = selectorProgressiveTotalRounds(store.state);
|
|
67
|
+
if (startTotal === 0) {
|
|
68
|
+
return undefined;
|
|
69
|
+
}
|
|
70
|
+
if (typeof requestAnimationFrame !== 'function') {
|
|
71
|
+
store.set('progressiveRendering', _extends({}, store.state.progressiveRendering, {
|
|
72
|
+
revealedRounds: startTotal
|
|
73
|
+
}));
|
|
74
|
+
return undefined;
|
|
75
|
+
}
|
|
76
|
+
let frame = 0;
|
|
77
|
+
let cancelled = false;
|
|
78
|
+
// Tracked in a closure variable, not derived inside a state updater (those
|
|
79
|
+
// must be pure and StrictMode double-invokes them, which would schedule
|
|
80
|
+
// the animation-frame chain twice).
|
|
81
|
+
let revealed = 0;
|
|
82
|
+
function scheduleNext() {
|
|
83
|
+
let remaining = REVEAL_FRAMES_SKIPPED;
|
|
84
|
+
const tick = () => {
|
|
85
|
+
if (cancelled) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
if (remaining > 0) {
|
|
89
|
+
remaining -= 1;
|
|
90
|
+
frame = requestAnimationFrame(tick);
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
step();
|
|
94
|
+
};
|
|
95
|
+
frame = requestAnimationFrame(tick);
|
|
96
|
+
}
|
|
97
|
+
function step() {
|
|
98
|
+
if (cancelled) {
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
const total = selectorProgressiveTotalRounds(store.state);
|
|
102
|
+
revealed = Math.min(total, revealed + REVEAL_ROUNDS_PER_FRAME);
|
|
103
|
+
store.set('progressiveRendering', _extends({}, store.state.progressiveRendering, {
|
|
104
|
+
revealedRounds: revealed
|
|
105
|
+
}));
|
|
106
|
+
if (revealed < total) {
|
|
107
|
+
scheduleNext();
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
frame = requestAnimationFrame(step);
|
|
111
|
+
return () => {
|
|
112
|
+
cancelled = true;
|
|
113
|
+
cancelAnimationFrame(frame);
|
|
114
|
+
};
|
|
115
|
+
}, [plans, store]);
|
|
116
|
+
return {
|
|
117
|
+
instance: {
|
|
118
|
+
registerProgressivePlan
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
useProgressiveRendering.params = {};
|
|
123
|
+
useProgressiveRendering.getInitialState = () => ({
|
|
124
|
+
progressiveRendering: {
|
|
125
|
+
plans: EMPTY_PLANS,
|
|
126
|
+
revealedRounds: 0
|
|
127
|
+
}
|
|
128
|
+
});
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { type SeriesId } from "../../../../models/seriesType/common.mjs";
|
|
2
|
+
import type { RendererType } from "../../../../ScatterChart/index.mjs";
|
|
3
|
+
/** Map of registered plots → their set of series ids. */
|
|
4
|
+
export declare const selectorProgressivePlans: (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("./useProgressiveRendering.types.mjs").UseProgressiveRenderingState> & {
|
|
5
|
+
cacheKey: import("../../models/index.mjs").ChartStateCacheKey;
|
|
6
|
+
}) => ReadonlyMap<string, readonly string[]> | undefined;
|
|
7
|
+
/** Total number of rounds revealed across all plots so far. */
|
|
8
|
+
export declare const selectorProgressiveRevealedRounds: (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("./useProgressiveRendering.types.mjs").UseProgressiveRenderingState> & {
|
|
9
|
+
cacheKey: import("../../models/index.mjs").ChartStateCacheKey;
|
|
10
|
+
}) => number;
|
|
11
|
+
/**
|
|
12
|
+
* Aggregated view of every registered plan: the per-series batch counts, the
|
|
13
|
+
* total number of rounds, and the per-series batch size (so every consumer
|
|
14
|
+
* sizes its batches the same way). Point counts are read straight from the
|
|
15
|
+
* processed series rather than carried by the registration.
|
|
16
|
+
*/
|
|
17
|
+
export declare const selectorProgressiveAggregate: (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("./useProgressiveRendering.types.mjs").UseProgressiveRenderingState> & {
|
|
18
|
+
cacheKey: import("../../models/index.mjs").ChartStateCacheKey;
|
|
19
|
+
}) => {
|
|
20
|
+
nBatchesBySeries: Map<string, number>;
|
|
21
|
+
totalRounds: number;
|
|
22
|
+
batchSize: number;
|
|
23
|
+
};
|
|
24
|
+
export declare const selectorProgressiveBatchSize: (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("./useProgressiveRendering.types.mjs").UseProgressiveRenderingState> & {
|
|
25
|
+
cacheKey: import("../../models/index.mjs").ChartStateCacheKey;
|
|
26
|
+
}) => number;
|
|
27
|
+
export declare const selectorProgressiveTotalRounds: (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("./useProgressiveRendering.types.mjs").UseProgressiveRenderingState> & {
|
|
28
|
+
cacheKey: import("../../models/index.mjs").ChartStateCacheKey;
|
|
29
|
+
}) => number;
|
|
30
|
+
/**
|
|
31
|
+
* How many of `seriesId`'s own batches are revealed so far. Capped at that
|
|
32
|
+
* series' total batch count, so series with fewer batches simply stop
|
|
33
|
+
* progressing while longer ones keep filling in.
|
|
34
|
+
*/
|
|
35
|
+
export declare const selectorProgressiveSeriesRevealedBatches: (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("./useProgressiveRendering.types.mjs").UseProgressiveRenderingState> & {
|
|
36
|
+
cacheKey: import("../../models/index.mjs").ChartStateCacheKey;
|
|
37
|
+
}, seriesId: string) => number;
|
|
38
|
+
export declare const selectorShouldUseProgressiveRenderer: (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<{}> & {
|
|
39
|
+
cacheKey: import("../../models/index.mjs").ChartStateCacheKey;
|
|
40
|
+
}, seriesIds: readonly string[], renderer: RendererType | "svg-progressive" | undefined) => boolean;
|
|
41
|
+
/** Order-sensitive equality between two registered series-id sets. */
|
|
42
|
+
export declare function sameSeriesIds(a: readonly SeriesId[] | undefined, b: readonly SeriesId[]): boolean;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { type SeriesId } from "../../../../models/seriesType/common.js";
|
|
2
|
+
import type { RendererType } from "../../../../ScatterChart/index.js";
|
|
3
|
+
/** Map of registered plots → their set of series ids. */
|
|
4
|
+
export declare const selectorProgressivePlans: (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("./useProgressiveRendering.types.js").UseProgressiveRenderingState> & {
|
|
5
|
+
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
6
|
+
}) => ReadonlyMap<string, readonly string[]> | undefined;
|
|
7
|
+
/** Total number of rounds revealed across all plots so far. */
|
|
8
|
+
export declare const selectorProgressiveRevealedRounds: (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("./useProgressiveRendering.types.js").UseProgressiveRenderingState> & {
|
|
9
|
+
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
10
|
+
}) => number;
|
|
11
|
+
/**
|
|
12
|
+
* Aggregated view of every registered plan: the per-series batch counts, the
|
|
13
|
+
* total number of rounds, and the per-series batch size (so every consumer
|
|
14
|
+
* sizes its batches the same way). Point counts are read straight from the
|
|
15
|
+
* processed series rather than carried by the registration.
|
|
16
|
+
*/
|
|
17
|
+
export declare const selectorProgressiveAggregate: (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("./useProgressiveRendering.types.js").UseProgressiveRenderingState> & {
|
|
18
|
+
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
19
|
+
}) => {
|
|
20
|
+
nBatchesBySeries: Map<string, number>;
|
|
21
|
+
totalRounds: number;
|
|
22
|
+
batchSize: number;
|
|
23
|
+
};
|
|
24
|
+
export declare const selectorProgressiveBatchSize: (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("./useProgressiveRendering.types.js").UseProgressiveRenderingState> & {
|
|
25
|
+
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
26
|
+
}) => number;
|
|
27
|
+
export declare const selectorProgressiveTotalRounds: (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("./useProgressiveRendering.types.js").UseProgressiveRenderingState> & {
|
|
28
|
+
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
29
|
+
}) => number;
|
|
30
|
+
/**
|
|
31
|
+
* How many of `seriesId`'s own batches are revealed so far. Capped at that
|
|
32
|
+
* series' total batch count, so series with fewer batches simply stop
|
|
33
|
+
* progressing while longer ones keep filling in.
|
|
34
|
+
*/
|
|
35
|
+
export declare const selectorProgressiveSeriesRevealedBatches: (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("./useProgressiveRendering.types.js").UseProgressiveRenderingState> & {
|
|
36
|
+
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
37
|
+
}, seriesId: string) => number;
|
|
38
|
+
export declare const selectorShouldUseProgressiveRenderer: (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<{}> & {
|
|
39
|
+
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
40
|
+
}, seriesIds: readonly string[], renderer: RendererType | "svg-progressive" | undefined) => boolean;
|
|
41
|
+
/** Order-sensitive equality between two registered series-id sets. */
|
|
42
|
+
export declare function sameSeriesIds(a: readonly SeriesId[] | undefined, b: readonly SeriesId[]): boolean;
|