@mui/x-charts-premium 9.2.0 → 9.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BarChartPremium/BarChartPremium.js +65 -35
- package/BarChartPremium/BarChartPremium.mjs +65 -35
- package/BarChartPremium/RangeBar/RangeBarPlot.d.mts +10 -0
- package/BarChartPremium/RangeBar/RangeBarPlot.d.ts +10 -0
- package/BarChartPremium/RangeBar/RangeBarPlot.js +59 -2
- package/BarChartPremium/RangeBar/RangeBarPlot.mjs +59 -2
- package/BarChartPremium/RangeBar/RangeBarWebGLPlot.d.mts +10 -0
- package/BarChartPremium/RangeBar/RangeBarWebGLPlot.d.ts +10 -0
- package/BarChartPremium/RangeBar/RangeBarWebGLPlot.js +82 -0
- package/BarChartPremium/RangeBar/RangeBarWebGLPlot.mjs +76 -0
- package/BarChartPremium/RangeBar/seriesConfig/extrema.js +3 -0
- package/BarChartPremium/RangeBar/seriesConfig/extrema.mjs +3 -0
- package/BarChartPremium/RangeBar/seriesConfig/seriesProcessor.js +2 -2
- package/BarChartPremium/RangeBar/seriesConfig/seriesProcessor.mjs +2 -2
- package/BarChartPremium/useBarChartPremiumProps.js +2 -1
- package/BarChartPremium/useBarChartPremiumProps.mjs +2 -1
- package/BarChartPremium/webgl/useBarWebGLPlotData.d.mts +2 -7
- package/BarChartPremium/webgl/useBarWebGLPlotData.d.ts +2 -7
- package/BarChartPremium/webgl/useBarWebGLPlotData.js +4 -151
- package/BarChartPremium/webgl/useBarWebGLPlotData.mjs +4 -150
- package/BarChartPremium/webgl/useWebGLBarLikePlotData.d.mts +39 -0
- package/BarChartPremium/webgl/useWebGLBarLikePlotData.d.ts +39 -0
- package/BarChartPremium/webgl/useWebGLBarLikePlotData.js +169 -0
- package/BarChartPremium/webgl/useWebGLBarLikePlotData.mjs +163 -0
- package/CHANGELOG.md +314 -0
- package/CandlestickChart/CandlestickChart.js +36 -27
- package/CandlestickChart/CandlestickChart.mjs +36 -27
- package/CandlestickChart/seriesConfig/extrema.js +3 -0
- package/CandlestickChart/seriesConfig/extrema.mjs +3 -0
- package/CandlestickChart/seriesConfig/seriesProcessor.js +2 -2
- package/CandlestickChart/seriesConfig/seriesProcessor.mjs +2 -2
- package/ChartsDataProviderPremium/ChartsDataProviderPremium.js +2 -2
- package/ChartsDataProviderPremium/ChartsDataProviderPremium.mjs +2 -2
- package/ChartsGeoDataProviderPremium/ChartsGeoDataProviderPremium.d.mts +35 -0
- package/ChartsGeoDataProviderPremium/ChartsGeoDataProviderPremium.d.ts +35 -0
- package/ChartsGeoDataProviderPremium/ChartsGeoDataProviderPremium.js +125 -0
- package/ChartsGeoDataProviderPremium/ChartsGeoDataProviderPremium.mjs +119 -0
- package/ChartsGeoDataProviderPremium/ChartsGeoDataProviderPremium.plugins.d.mts +5 -0
- package/ChartsGeoDataProviderPremium/ChartsGeoDataProviderPremium.plugins.d.ts +5 -0
- package/ChartsGeoDataProviderPremium/ChartsGeoDataProviderPremium.plugins.js +10 -0
- package/ChartsGeoDataProviderPremium/ChartsGeoDataProviderPremium.plugins.mjs +4 -0
- package/ChartsGeoDataProviderPremium/index.d.mts +3 -0
- package/ChartsGeoDataProviderPremium/index.d.ts +3 -0
- package/ChartsGeoDataProviderPremium/index.js +20 -0
- package/ChartsGeoDataProviderPremium/index.mjs +3 -0
- package/ChartsGeoDataProviderPremium/useChartsGeoDataProviderPremiumProps.d.mts +10 -0
- package/ChartsGeoDataProviderPremium/useChartsGeoDataProviderPremiumProps.d.ts +10 -0
- package/ChartsGeoDataProviderPremium/useChartsGeoDataProviderPremiumProps.js +49 -0
- package/ChartsGeoDataProviderPremium/useChartsGeoDataProviderPremiumProps.mjs +42 -0
- package/ChartsRadialDataProviderPremium/ChartsRadialDataProviderPremium.js +2 -2
- package/ChartsRadialDataProviderPremium/ChartsRadialDataProviderPremium.mjs +2 -2
- package/HeatmapPremium/HeatmapPremium.js +52 -22
- package/HeatmapPremium/HeatmapPremium.mjs +52 -22
- package/Map/FocusedMapShape.d.mts +4 -0
- package/Map/FocusedMapShape.d.ts +4 -0
- package/Map/FocusedMapShape.js +66 -0
- package/Map/FocusedMapShape.mjs +60 -0
- package/Map/GeoDataPlot.d.mts +26 -0
- package/Map/GeoDataPlot.d.ts +26 -0
- package/Map/GeoDataPlot.js +65 -0
- package/Map/GeoDataPlot.mjs +60 -0
- package/Map/Graticule.d.mts +1 -0
- package/Map/Graticule.d.ts +1 -0
- package/Map/Graticule.js +30 -0
- package/Map/Graticule.mjs +24 -0
- package/Map/MapShape.d.mts +10 -0
- package/Map/MapShape.d.ts +10 -0
- package/Map/MapShape.js +55 -0
- package/Map/MapShape.mjs +49 -0
- package/Map/MapShapePlot.d.mts +21 -0
- package/Map/MapShapePlot.d.ts +21 -0
- package/Map/MapShapePlot.js +86 -0
- package/Map/MapShapePlot.mjs +80 -0
- package/Map/index.d.mts +7 -0
- package/Map/index.d.ts +7 -0
- package/Map/index.js +60 -0
- package/Map/index.mjs +8 -0
- package/Map/seriesConfig/descriptionGetter.d.mts +3 -0
- package/Map/seriesConfig/descriptionGetter.d.ts +3 -0
- package/Map/seriesConfig/descriptionGetter.js +19 -0
- package/Map/seriesConfig/descriptionGetter.mjs +13 -0
- package/Map/seriesConfig/getColor.d.mts +3 -0
- package/Map/seriesConfig/getColor.d.ts +3 -0
- package/Map/seriesConfig/getColor.js +35 -0
- package/Map/seriesConfig/getColor.mjs +29 -0
- package/Map/seriesConfig/getSeriesWithDefaultValues.d.mts +3 -0
- package/Map/seriesConfig/getSeriesWithDefaultValues.d.ts +3 -0
- package/Map/seriesConfig/getSeriesWithDefaultValues.js +15 -0
- package/Map/seriesConfig/getSeriesWithDefaultValues.mjs +8 -0
- package/Map/seriesConfig/index.d.mts +2 -0
- package/Map/seriesConfig/index.d.ts +2 -0
- package/Map/seriesConfig/index.js +28 -0
- package/Map/seriesConfig/index.mjs +21 -0
- package/Map/seriesConfig/keyboardFocusHandler.d.mts +9 -0
- package/Map/seriesConfig/keyboardFocusHandler.d.ts +9 -0
- package/Map/seriesConfig/keyboardFocusHandler.js +19 -0
- package/Map/seriesConfig/keyboardFocusHandler.mjs +13 -0
- package/Map/seriesConfig/legend.d.mts +3 -0
- package/Map/seriesConfig/legend.d.ts +3 -0
- package/Map/seriesConfig/legend.js +28 -0
- package/Map/seriesConfig/legend.mjs +22 -0
- package/Map/seriesConfig/seriesProcessor.d.mts +3 -0
- package/Map/seriesConfig/seriesProcessor.d.ts +3 -0
- package/Map/seriesConfig/seriesProcessor.js +66 -0
- package/Map/seriesConfig/seriesProcessor.mjs +59 -0
- package/Map/seriesConfig/tooltip.d.mts +3 -0
- package/Map/seriesConfig/tooltip.d.ts +3 -0
- package/Map/seriesConfig/tooltip.js +33 -0
- package/Map/seriesConfig/tooltip.mjs +27 -0
- package/RadialBarChart/RadialBarChart.js +10 -10
- package/RadialBarChart/RadialBarChart.mjs +10 -10
- package/RadialBarChart/seriesConfig/getColor.js +7 -51
- package/RadialBarChart/seriesConfig/getColor.mjs +8 -52
- package/RadialBarChart/seriesConfig/tooltip.js +3 -26
- package/RadialBarChart/seriesConfig/tooltip.mjs +4 -27
- package/RadialLineChart/RadialArea.d.mts +2 -11
- package/RadialLineChart/RadialArea.d.ts +2 -11
- package/RadialLineChart/RadialArea.js +4 -3
- package/RadialLineChart/RadialArea.mjs +4 -3
- package/RadialLineChart/RadialAreaPlot.js +3 -1
- package/RadialLineChart/RadialAreaPlot.mjs +3 -1
- package/RadialLineChart/RadialLine.d.mts +4 -3
- package/RadialLineChart/RadialLine.d.ts +4 -3
- package/RadialLineChart/RadialLine.js +4 -3
- package/RadialLineChart/RadialLine.mjs +4 -3
- package/RadialLineChart/RadialLineChart.d.mts +7 -5
- package/RadialLineChart/RadialLineChart.d.ts +7 -5
- package/RadialLineChart/RadialLineChart.js +11 -11
- package/RadialLineChart/RadialLineChart.mjs +11 -11
- package/RadialLineChart/RadialLineHighlightPlot.d.mts +3 -2
- package/RadialLineChart/RadialLineHighlightPlot.d.ts +3 -2
- package/RadialLineChart/RadialLinePlot.js +3 -1
- package/RadialLineChart/RadialLinePlot.mjs +3 -1
- package/RadialLineChart/seriesConfig/getColor.js +6 -53
- package/RadialLineChart/seriesConfig/getColor.mjs +7 -54
- package/RadialLineChart/seriesConfig/seriesProcessor.d.mts +2 -2
- package/RadialLineChart/seriesConfig/seriesProcessor.d.ts +2 -2
- package/RadialLineChart/seriesConfig/seriesProcessor.js +1 -138
- package/RadialLineChart/seriesConfig/seriesProcessor.mjs +2 -138
- package/RadialLineChart/seriesConfig/tooltip.js +3 -24
- package/RadialLineChart/seriesConfig/tooltip.mjs +4 -25
- package/RadialLineChart/useRadialLinePlotData.d.mts +1 -0
- package/RadialLineChart/useRadialLinePlotData.d.ts +1 -0
- package/RadialLineChart/useRadialLinePlotData.js +3 -1
- package/RadialLineChart/useRadialLinePlotData.mjs +3 -1
- package/ScatterChartPremium/ScatterChartPremium.d.mts +2 -1
- package/ScatterChartPremium/ScatterChartPremium.d.ts +2 -1
- package/ScatterChartPremium/ScatterChartPremium.js +62 -32
- package/ScatterChartPremium/ScatterChartPremium.mjs +62 -32
- package/hooks/index.d.mts +4 -1
- package/hooks/index.d.ts +4 -1
- package/hooks/index.js +33 -0
- package/hooks/index.mjs +4 -1
- package/hooks/useGeoData.d.mts +6 -0
- package/hooks/useGeoData.d.ts +6 -0
- package/hooks/useGeoData.js +17 -0
- package/hooks/useGeoData.mjs +13 -0
- package/hooks/useGeoFeatureIndexesByName.d.mts +7 -0
- package/hooks/useGeoFeatureIndexesByName.d.ts +7 -0
- package/hooks/useGeoFeatureIndexesByName.js +19 -0
- package/hooks/useGeoFeatureIndexesByName.mjs +15 -0
- package/hooks/useGeoPath.d.mts +6 -0
- package/hooks/useGeoPath.d.ts +6 -0
- package/hooks/useGeoPath.js +17 -0
- package/hooks/useGeoPath.mjs +13 -0
- package/hooks/useMapShapeSeries.d.mts +34 -0
- package/hooks/useMapShapeSeries.d.ts +34 -0
- package/hooks/useMapShapeSeries.js +45 -0
- package/hooks/useMapShapeSeries.mjs +40 -0
- package/index.d.mts +2 -0
- package/index.d.ts +2 -0
- package/index.js +25 -1
- package/index.mjs +3 -1
- package/internals/plugins/useGeoProjection/index.d.mts +3 -0
- package/internals/plugins/useGeoProjection/index.d.ts +3 -0
- package/internals/plugins/useGeoProjection/index.js +38 -0
- package/internals/plugins/useGeoProjection/index.mjs +3 -0
- package/internals/plugins/useGeoProjection/useGeoProjection.d.mts +3 -0
- package/internals/plugins/useGeoProjection/useGeoProjection.d.ts +3 -0
- package/internals/plugins/useGeoProjection/useGeoProjection.js +58 -0
- package/internals/plugins/useGeoProjection/useGeoProjection.mjs +50 -0
- package/internals/plugins/useGeoProjection/useGeoProjection.selectors.d.mts +39 -0
- package/internals/plugins/useGeoProjection/useGeoProjection.selectors.d.ts +39 -0
- package/internals/plugins/useGeoProjection/useGeoProjection.selectors.js +135 -0
- package/internals/plugins/useGeoProjection/useGeoProjection.selectors.mjs +128 -0
- package/internals/plugins/useGeoProjection/useGeoProjection.types.d.mts +55 -0
- package/internals/plugins/useGeoProjection/useGeoProjection.types.d.ts +55 -0
- package/internals/plugins/useGeoProjection/useGeoProjection.types.js +5 -0
- package/internals/plugins/useGeoProjection/useGeoProjection.types.mjs +1 -0
- package/models/chartsSlotsComponentsPropsPremium.d.mts +1 -0
- package/models/chartsSlotsComponentsPropsPremium.d.ts +1 -0
- package/models/chartsSlotsComponentsPropsPremium.js +5 -0
- package/models/chartsSlotsComponentsPropsPremium.mjs +1 -0
- package/models/index.d.mts +2 -1
- package/models/index.d.ts +2 -1
- package/models/index.js +11 -0
- package/models/index.mjs +2 -1
- package/models/seriesType/index.d.mts +2 -1
- package/models/seriesType/index.d.ts +2 -1
- package/models/seriesType/index.js +11 -0
- package/models/seriesType/index.mjs +2 -1
- package/models/seriesType/mapShape.d.mts +105 -0
- package/models/seriesType/mapShape.d.ts +105 -0
- package/models/seriesType/mapShape.js +5 -0
- package/models/seriesType/mapShape.mjs +1 -0
- package/models/seriesType/radialBar.d.mts +1 -1
- package/models/seriesType/radialBar.d.ts +1 -1
- package/models/seriesType/radialLine.d.mts +4 -0
- package/models/seriesType/radialLine.d.ts +4 -0
- package/package.json +34 -6
- package/typeOverloads/modules.d.mts +16 -1
- package/typeOverloads/modules.d.ts +16 -1
- package/utils/webgl/useWebGLResizeObserver.js +3 -3
- package/utils/webgl/useWebGLResizeObserver.mjs +2 -2
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { useZAxes } from '@mui/x-charts/hooks';
|
|
5
|
+
import { useGeoData } from "../hooks/useGeoData.mjs";
|
|
6
|
+
import { useGeoPath } from "../hooks/useGeoPath.mjs";
|
|
7
|
+
import { useMapShapeSeries } from "../hooks/useMapShapeSeries.mjs";
|
|
8
|
+
import { useGeoFeatureIndexesByName } from "../hooks/useGeoFeatureIndexesByName.mjs";
|
|
9
|
+
import { MapShape } from "./MapShape.mjs";
|
|
10
|
+
import { FocusedMapShape } from "./FocusedMapShape.mjs";
|
|
11
|
+
import { mapShapeSeriesConfig } from "./seriesConfig/index.mjs";
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
/**
|
|
14
|
+
* Renders series mapShape items.
|
|
15
|
+
*/
|
|
16
|
+
export function MapShapePlot(props) {
|
|
17
|
+
const {
|
|
18
|
+
className,
|
|
19
|
+
fill,
|
|
20
|
+
stroke = 'none',
|
|
21
|
+
strokeWidth = 1
|
|
22
|
+
} = props;
|
|
23
|
+
const geoData = useGeoData();
|
|
24
|
+
const path = useGeoPath();
|
|
25
|
+
const series = useMapShapeSeries();
|
|
26
|
+
const featureIndexesByName = useGeoFeatureIndexesByName();
|
|
27
|
+
const {
|
|
28
|
+
zAxis,
|
|
29
|
+
zAxisIds
|
|
30
|
+
} = useZAxes();
|
|
31
|
+
if (!geoData || !path || series.length === 0) {
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
const defaultZAxisId = zAxisIds[0];
|
|
35
|
+
return /*#__PURE__*/_jsxs("g", {
|
|
36
|
+
className: className,
|
|
37
|
+
children: [series.map(seriesItem => {
|
|
38
|
+
const {
|
|
39
|
+
data,
|
|
40
|
+
id,
|
|
41
|
+
hidden,
|
|
42
|
+
colorAxisId
|
|
43
|
+
} = seriesItem;
|
|
44
|
+
if (hidden) {
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
const colorAxis = zAxis[colorAxisId ?? defaultZAxisId];
|
|
48
|
+
const colorGetter = mapShapeSeriesConfig.colorProcessor(seriesItem, undefined, undefined, colorAxis);
|
|
49
|
+
return /*#__PURE__*/_jsx("g", {
|
|
50
|
+
"data-series": id,
|
|
51
|
+
children: data.map((item, dataIndex) => {
|
|
52
|
+
if (item.hidden) {
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
const featureIndexes = featureIndexesByName.get(item.name);
|
|
56
|
+
if (featureIndexes === undefined || featureIndexes.length === 0) {
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
return /*#__PURE__*/_jsx(React.Fragment, {
|
|
60
|
+
children: featureIndexes.map(featureIndex => {
|
|
61
|
+
const feature = geoData.features[featureIndex];
|
|
62
|
+
const d = path(feature);
|
|
63
|
+
if (!d) {
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
66
|
+
return /*#__PURE__*/_jsx(MapShape, {
|
|
67
|
+
seriesId: id,
|
|
68
|
+
dataIndex: dataIndex,
|
|
69
|
+
d: d,
|
|
70
|
+
color: fill ?? colorGetter(dataIndex),
|
|
71
|
+
stroke: stroke,
|
|
72
|
+
strokeWidth: strokeWidth
|
|
73
|
+
}, featureIndex);
|
|
74
|
+
})
|
|
75
|
+
}, item.name);
|
|
76
|
+
})
|
|
77
|
+
}, id);
|
|
78
|
+
}), /*#__PURE__*/_jsx(FocusedMapShape, {})]
|
|
79
|
+
});
|
|
80
|
+
}
|
package/Map/index.d.mts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from "./GeoDataPlot.mjs";
|
|
2
|
+
export * from "./MapShapePlot.mjs";
|
|
3
|
+
export * from "./MapShape.mjs";
|
|
4
|
+
export * from "./FocusedMapShape.mjs";
|
|
5
|
+
export * from "./Graticule.mjs";
|
|
6
|
+
export type { D3NamedProjection, GeoProjectionInput } from "../internals/plugins/useGeoProjection/useGeoProjection.types.mjs";
|
|
7
|
+
export type { GeoProjection, ExtendedFeatureCollection } from '@mui/x-charts-vendor/d3-geo';
|
package/Map/index.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from "./GeoDataPlot.js";
|
|
2
|
+
export * from "./MapShapePlot.js";
|
|
3
|
+
export * from "./MapShape.js";
|
|
4
|
+
export * from "./FocusedMapShape.js";
|
|
5
|
+
export * from "./Graticule.js";
|
|
6
|
+
export type { D3NamedProjection, GeoProjectionInput } from "../internals/plugins/useGeoProjection/useGeoProjection.types.js";
|
|
7
|
+
export type { GeoProjection, ExtendedFeatureCollection } from '@mui/x-charts-vendor/d3-geo';
|
package/Map/index.js
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _GeoDataPlot = require("./GeoDataPlot");
|
|
7
|
+
Object.keys(_GeoDataPlot).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _GeoDataPlot[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _GeoDataPlot[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
var _MapShapePlot = require("./MapShapePlot");
|
|
18
|
+
Object.keys(_MapShapePlot).forEach(function (key) {
|
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
|
20
|
+
if (key in exports && exports[key] === _MapShapePlot[key]) return;
|
|
21
|
+
Object.defineProperty(exports, key, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () {
|
|
24
|
+
return _MapShapePlot[key];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
var _MapShape = require("./MapShape");
|
|
29
|
+
Object.keys(_MapShape).forEach(function (key) {
|
|
30
|
+
if (key === "default" || key === "__esModule") return;
|
|
31
|
+
if (key in exports && exports[key] === _MapShape[key]) return;
|
|
32
|
+
Object.defineProperty(exports, key, {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
get: function () {
|
|
35
|
+
return _MapShape[key];
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
var _FocusedMapShape = require("./FocusedMapShape");
|
|
40
|
+
Object.keys(_FocusedMapShape).forEach(function (key) {
|
|
41
|
+
if (key === "default" || key === "__esModule") return;
|
|
42
|
+
if (key in exports && exports[key] === _FocusedMapShape[key]) return;
|
|
43
|
+
Object.defineProperty(exports, key, {
|
|
44
|
+
enumerable: true,
|
|
45
|
+
get: function () {
|
|
46
|
+
return _FocusedMapShape[key];
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
var _Graticule = require("./Graticule");
|
|
51
|
+
Object.keys(_Graticule).forEach(function (key) {
|
|
52
|
+
if (key === "default" || key === "__esModule") return;
|
|
53
|
+
if (key in exports && exports[key] === _Graticule[key]) return;
|
|
54
|
+
Object.defineProperty(exports, key, {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
get: function () {
|
|
57
|
+
return _Graticule[key];
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
});
|
package/Map/index.mjs
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _internals = require("@mui/x-charts/internals");
|
|
8
|
+
const descriptionGetter = ({
|
|
9
|
+
identifier,
|
|
10
|
+
series
|
|
11
|
+
}) => {
|
|
12
|
+
const item = series.data[identifier.dataIndex];
|
|
13
|
+
if (!item) {
|
|
14
|
+
return '';
|
|
15
|
+
}
|
|
16
|
+
const label = (0, _internals.getLabel)(item.label ?? item.name, 'tooltip') ?? item.name;
|
|
17
|
+
return `${label}: ${item.value}`;
|
|
18
|
+
};
|
|
19
|
+
var _default = exports.default = descriptionGetter;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { getLabel } from '@mui/x-charts/internals';
|
|
2
|
+
const descriptionGetter = ({
|
|
3
|
+
identifier,
|
|
4
|
+
series
|
|
5
|
+
}) => {
|
|
6
|
+
const item = series.data[identifier.dataIndex];
|
|
7
|
+
if (!item) {
|
|
8
|
+
return '';
|
|
9
|
+
}
|
|
10
|
+
const label = getLabel(item.label ?? item.name, 'tooltip') ?? item.name;
|
|
11
|
+
return `${label}: ${item.value}`;
|
|
12
|
+
};
|
|
13
|
+
export default descriptionGetter;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
const getColor = (series, _mainAxis, _secondaryAxis, zAxis) => {
|
|
8
|
+
const colorScale = zAxis?.colorScale;
|
|
9
|
+
if (colorScale) {
|
|
10
|
+
return dataIndex => {
|
|
11
|
+
if (dataIndex == null) {
|
|
12
|
+
return series.color;
|
|
13
|
+
}
|
|
14
|
+
const item = series.data[dataIndex];
|
|
15
|
+
if (item === undefined) {
|
|
16
|
+
return series.color;
|
|
17
|
+
}
|
|
18
|
+
const scaleInput = item.colorValue ?? item.value;
|
|
19
|
+
if (scaleInput != null) {
|
|
20
|
+
const color = colorScale(scaleInput);
|
|
21
|
+
if (color !== null) {
|
|
22
|
+
return color;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return item.color ?? series.color;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
return dataIndex => {
|
|
29
|
+
if (dataIndex == null) {
|
|
30
|
+
return series.color;
|
|
31
|
+
}
|
|
32
|
+
return series.data[dataIndex].color ?? series.color;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
var _default = exports.default = getColor;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
const getColor = (series, _mainAxis, _secondaryAxis, zAxis) => {
|
|
2
|
+
const colorScale = zAxis?.colorScale;
|
|
3
|
+
if (colorScale) {
|
|
4
|
+
return dataIndex => {
|
|
5
|
+
if (dataIndex == null) {
|
|
6
|
+
return series.color;
|
|
7
|
+
}
|
|
8
|
+
const item = series.data[dataIndex];
|
|
9
|
+
if (item === undefined) {
|
|
10
|
+
return series.color;
|
|
11
|
+
}
|
|
12
|
+
const scaleInput = item.colorValue ?? item.value;
|
|
13
|
+
if (scaleInput != null) {
|
|
14
|
+
const color = colorScale(scaleInput);
|
|
15
|
+
if (color !== null) {
|
|
16
|
+
return color;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return item.color ?? series.color;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
return dataIndex => {
|
|
23
|
+
if (dataIndex == null) {
|
|
24
|
+
return series.color;
|
|
25
|
+
}
|
|
26
|
+
return series.data[dataIndex].color ?? series.color;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
export default getColor;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
+
const getSeriesWithDefaultValues = (seriesData, seriesIndex, colors) => {
|
|
10
|
+
return (0, _extends2.default)({}, seriesData, {
|
|
11
|
+
id: seriesData.id ?? `auto-generated-id-${seriesIndex}`,
|
|
12
|
+
color: seriesData.color ?? colors[seriesIndex % colors.length]
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
var _default = exports.default = getSeriesWithDefaultValues;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
const getSeriesWithDefaultValues = (seriesData, seriesIndex, colors) => {
|
|
3
|
+
return _extends({}, seriesData, {
|
|
4
|
+
id: seriesData.id ?? `auto-generated-id-${seriesIndex}`,
|
|
5
|
+
color: seriesData.color ?? colors[seriesIndex % colors.length]
|
|
6
|
+
});
|
|
7
|
+
};
|
|
8
|
+
export default getSeriesWithDefaultValues;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.mapShapeSeriesConfig = void 0;
|
|
8
|
+
var _internals = require("@mui/x-charts/internals");
|
|
9
|
+
var _seriesProcessor = _interopRequireDefault(require("./seriesProcessor"));
|
|
10
|
+
var _getColor = _interopRequireDefault(require("./getColor"));
|
|
11
|
+
var _legend = _interopRequireDefault(require("./legend"));
|
|
12
|
+
var _tooltip = _interopRequireDefault(require("./tooltip"));
|
|
13
|
+
var _getSeriesWithDefaultValues = _interopRequireDefault(require("./getSeriesWithDefaultValues"));
|
|
14
|
+
var _descriptionGetter = _interopRequireDefault(require("./descriptionGetter"));
|
|
15
|
+
var _keyboardFocusHandler = _interopRequireDefault(require("./keyboardFocusHandler"));
|
|
16
|
+
const mapShapeSeriesConfig = exports.mapShapeSeriesConfig = {
|
|
17
|
+
seriesProcessor: _seriesProcessor.default,
|
|
18
|
+
colorProcessor: _getColor.default,
|
|
19
|
+
legendGetter: _legend.default,
|
|
20
|
+
tooltipGetter: _tooltip.default,
|
|
21
|
+
getSeriesWithDefaultValues: _getSeriesWithDefaultValues.default,
|
|
22
|
+
keyboardFocusHandler: _keyboardFocusHandler.default,
|
|
23
|
+
identifierSerializer: _internals.identifierSerializerSeriesIdDataIndex,
|
|
24
|
+
identifierCleaner: _internals.identifierCleanerSeriesIdDataIndex,
|
|
25
|
+
descriptionGetter: _descriptionGetter.default,
|
|
26
|
+
isHighlightedCreator: _internals.createIsHighlighted,
|
|
27
|
+
isFadedCreator: _internals.createIsFaded
|
|
28
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { identifierSerializerSeriesIdDataIndex, identifierCleanerSeriesIdDataIndex, createIsHighlighted, createIsFaded } from '@mui/x-charts/internals';
|
|
2
|
+
import seriesProcessor from "./seriesProcessor.mjs";
|
|
3
|
+
import getColor from "./getColor.mjs";
|
|
4
|
+
import legendGetter from "./legend.mjs";
|
|
5
|
+
import tooltipGetter from "./tooltip.mjs";
|
|
6
|
+
import getSeriesWithDefaultValues from "./getSeriesWithDefaultValues.mjs";
|
|
7
|
+
import descriptionGetter from "./descriptionGetter.mjs";
|
|
8
|
+
import keyboardFocusHandler from "./keyboardFocusHandler.mjs";
|
|
9
|
+
export const mapShapeSeriesConfig = {
|
|
10
|
+
seriesProcessor,
|
|
11
|
+
colorProcessor: getColor,
|
|
12
|
+
legendGetter,
|
|
13
|
+
tooltipGetter,
|
|
14
|
+
getSeriesWithDefaultValues,
|
|
15
|
+
keyboardFocusHandler,
|
|
16
|
+
identifierSerializer: identifierSerializerSeriesIdDataIndex,
|
|
17
|
+
identifierCleaner: identifierCleanerSeriesIdDataIndex,
|
|
18
|
+
descriptionGetter,
|
|
19
|
+
isHighlightedCreator: createIsHighlighted,
|
|
20
|
+
isFadedCreator: createIsFaded
|
|
21
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type KeyboardFocusHandler } from '@mui/x-charts/internals';
|
|
2
|
+
/**
|
|
3
|
+
* Move the focus across the shapes of the map series.
|
|
4
|
+
*
|
|
5
|
+
* `ArrowRight`/`ArrowLeft` move to the next/previous shape of the focused series,
|
|
6
|
+
* while `ArrowUp`/`ArrowDown` move between series.
|
|
7
|
+
*/
|
|
8
|
+
declare const keyboardFocusHandler: KeyboardFocusHandler<'mapShape', 'mapShape'>;
|
|
9
|
+
export default keyboardFocusHandler;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type KeyboardFocusHandler } from '@mui/x-charts/internals';
|
|
2
|
+
/**
|
|
3
|
+
* Move the focus across the shapes of the map series.
|
|
4
|
+
*
|
|
5
|
+
* `ArrowRight`/`ArrowLeft` move to the next/previous shape of the focused series,
|
|
6
|
+
* while `ArrowUp`/`ArrowDown` move between series.
|
|
7
|
+
*/
|
|
8
|
+
declare const keyboardFocusHandler: KeyboardFocusHandler<'mapShape', 'mapShape'>;
|
|
9
|
+
export default keyboardFocusHandler;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _internals = require("@mui/x-charts/internals");
|
|
8
|
+
const mapShapeSeriesTypes = new Set(['mapShape']);
|
|
9
|
+
const allowCycles = false;
|
|
10
|
+
const useCurrentSeriesMaxLength = true;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Move the focus across the shapes of the map series.
|
|
14
|
+
*
|
|
15
|
+
* `ArrowRight`/`ArrowLeft` move to the next/previous shape of the focused series,
|
|
16
|
+
* while `ArrowUp`/`ArrowDown` move between series.
|
|
17
|
+
*/
|
|
18
|
+
const keyboardFocusHandler = (0, _internals.createCommonKeyboardFocusHandler)(mapShapeSeriesTypes, allowCycles, useCurrentSeriesMaxLength);
|
|
19
|
+
var _default = exports.default = keyboardFocusHandler;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { createCommonKeyboardFocusHandler } from '@mui/x-charts/internals';
|
|
2
|
+
const mapShapeSeriesTypes = new Set(['mapShape']);
|
|
3
|
+
const allowCycles = false;
|
|
4
|
+
const useCurrentSeriesMaxLength = true;
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Move the focus across the shapes of the map series.
|
|
8
|
+
*
|
|
9
|
+
* `ArrowRight`/`ArrowLeft` move to the next/previous shape of the focused series,
|
|
10
|
+
* while `ArrowUp`/`ArrowDown` move between series.
|
|
11
|
+
*/
|
|
12
|
+
const keyboardFocusHandler = createCommonKeyboardFocusHandler(mapShapeSeriesTypes, allowCycles, useCurrentSeriesMaxLength);
|
|
13
|
+
export default keyboardFocusHandler;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _internals = require("@mui/x-charts/internals");
|
|
8
|
+
const legendGetter = ({
|
|
9
|
+
seriesOrder,
|
|
10
|
+
series
|
|
11
|
+
}) => {
|
|
12
|
+
return seriesOrder.reduce((acc, seriesId) => {
|
|
13
|
+
const s = series[seriesId];
|
|
14
|
+
const seriesLabel = (0, _internals.getLabel)(s.label, 'legend');
|
|
15
|
+
if (seriesLabel === undefined) {
|
|
16
|
+
return acc;
|
|
17
|
+
}
|
|
18
|
+
acc.push({
|
|
19
|
+
type: 'mapShape',
|
|
20
|
+
markType: s.labelMarkType,
|
|
21
|
+
seriesId,
|
|
22
|
+
color: s.color,
|
|
23
|
+
label: seriesLabel
|
|
24
|
+
});
|
|
25
|
+
return acc;
|
|
26
|
+
}, []);
|
|
27
|
+
};
|
|
28
|
+
var _default = exports.default = legendGetter;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { getLabel } from '@mui/x-charts/internals';
|
|
2
|
+
const legendGetter = ({
|
|
3
|
+
seriesOrder,
|
|
4
|
+
series
|
|
5
|
+
}) => {
|
|
6
|
+
return seriesOrder.reduce((acc, seriesId) => {
|
|
7
|
+
const s = series[seriesId];
|
|
8
|
+
const seriesLabel = getLabel(s.label, 'legend');
|
|
9
|
+
if (seriesLabel === undefined) {
|
|
10
|
+
return acc;
|
|
11
|
+
}
|
|
12
|
+
acc.push({
|
|
13
|
+
type: 'mapShape',
|
|
14
|
+
markType: s.labelMarkType,
|
|
15
|
+
seriesId,
|
|
16
|
+
color: s.color,
|
|
17
|
+
label: seriesLabel
|
|
18
|
+
});
|
|
19
|
+
return acc;
|
|
20
|
+
}, []);
|
|
21
|
+
};
|
|
22
|
+
export default legendGetter;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
+
var _internals = require("@mui/x-charts/internals");
|
|
10
|
+
const defaultValueFormatter = v => v == null ? '' : String(v.value);
|
|
11
|
+
const seriesProcessor = ({
|
|
12
|
+
series,
|
|
13
|
+
seriesOrder
|
|
14
|
+
}, dataset, isItemVisible) => {
|
|
15
|
+
const defaultizedSeries = {};
|
|
16
|
+
seriesOrder.forEach(seriesId => {
|
|
17
|
+
const input = series[seriesId];
|
|
18
|
+
const datasetKeys = input.datasetKeys;
|
|
19
|
+
if (datasetKeys && typeof datasetKeys.name !== 'string') {
|
|
20
|
+
(0, _internals.incompleteDatasetKeysError)('MapShape', seriesId, ['name']);
|
|
21
|
+
}
|
|
22
|
+
let data;
|
|
23
|
+
if (input.valueGetter) {
|
|
24
|
+
data = dataset?.map(input.valueGetter) ?? [];
|
|
25
|
+
} else if (datasetKeys) {
|
|
26
|
+
data = dataset?.map(d => {
|
|
27
|
+
const rep = {
|
|
28
|
+
name: d[datasetKeys.name]
|
|
29
|
+
};
|
|
30
|
+
if (datasetKeys.label !== undefined) {
|
|
31
|
+
rep.label = d[datasetKeys.label];
|
|
32
|
+
}
|
|
33
|
+
if (datasetKeys.value !== undefined) {
|
|
34
|
+
rep.value = d[datasetKeys.value];
|
|
35
|
+
}
|
|
36
|
+
if (datasetKeys.colorValue !== undefined) {
|
|
37
|
+
rep.colorValue = d[datasetKeys.colorValue];
|
|
38
|
+
}
|
|
39
|
+
return rep;
|
|
40
|
+
}) ?? [];
|
|
41
|
+
} else {
|
|
42
|
+
data = input.data ?? [];
|
|
43
|
+
}
|
|
44
|
+
defaultizedSeries[seriesId] = (0, _extends2.default)({
|
|
45
|
+
labelMarkType: 'square'
|
|
46
|
+
}, input, {
|
|
47
|
+
data: data.map((item, dataIndex) => (0, _extends2.default)({}, item, {
|
|
48
|
+
hidden: !isItemVisible?.({
|
|
49
|
+
type: 'mapShape',
|
|
50
|
+
seriesId,
|
|
51
|
+
dataIndex
|
|
52
|
+
})
|
|
53
|
+
})),
|
|
54
|
+
hidden: !isItemVisible?.({
|
|
55
|
+
type: 'mapShape',
|
|
56
|
+
seriesId
|
|
57
|
+
}),
|
|
58
|
+
valueFormatter: input.valueFormatter ?? defaultValueFormatter
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
return {
|
|
62
|
+
series: defaultizedSeries,
|
|
63
|
+
seriesOrder
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
var _default = exports.default = seriesProcessor;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import { incompleteDatasetKeysError } from '@mui/x-charts/internals';
|
|
3
|
+
const defaultValueFormatter = v => v == null ? '' : String(v.value);
|
|
4
|
+
const seriesProcessor = ({
|
|
5
|
+
series,
|
|
6
|
+
seriesOrder
|
|
7
|
+
}, dataset, isItemVisible) => {
|
|
8
|
+
const defaultizedSeries = {};
|
|
9
|
+
seriesOrder.forEach(seriesId => {
|
|
10
|
+
const input = series[seriesId];
|
|
11
|
+
const datasetKeys = input.datasetKeys;
|
|
12
|
+
if (datasetKeys && typeof datasetKeys.name !== 'string') {
|
|
13
|
+
incompleteDatasetKeysError('MapShape', seriesId, ['name']);
|
|
14
|
+
}
|
|
15
|
+
let data;
|
|
16
|
+
if (input.valueGetter) {
|
|
17
|
+
data = dataset?.map(input.valueGetter) ?? [];
|
|
18
|
+
} else if (datasetKeys) {
|
|
19
|
+
data = dataset?.map(d => {
|
|
20
|
+
const rep = {
|
|
21
|
+
name: d[datasetKeys.name]
|
|
22
|
+
};
|
|
23
|
+
if (datasetKeys.label !== undefined) {
|
|
24
|
+
rep.label = d[datasetKeys.label];
|
|
25
|
+
}
|
|
26
|
+
if (datasetKeys.value !== undefined) {
|
|
27
|
+
rep.value = d[datasetKeys.value];
|
|
28
|
+
}
|
|
29
|
+
if (datasetKeys.colorValue !== undefined) {
|
|
30
|
+
rep.colorValue = d[datasetKeys.colorValue];
|
|
31
|
+
}
|
|
32
|
+
return rep;
|
|
33
|
+
}) ?? [];
|
|
34
|
+
} else {
|
|
35
|
+
data = input.data ?? [];
|
|
36
|
+
}
|
|
37
|
+
defaultizedSeries[seriesId] = _extends({
|
|
38
|
+
labelMarkType: 'square'
|
|
39
|
+
}, input, {
|
|
40
|
+
data: data.map((item, dataIndex) => _extends({}, item, {
|
|
41
|
+
hidden: !isItemVisible?.({
|
|
42
|
+
type: 'mapShape',
|
|
43
|
+
seriesId,
|
|
44
|
+
dataIndex
|
|
45
|
+
})
|
|
46
|
+
})),
|
|
47
|
+
hidden: !isItemVisible?.({
|
|
48
|
+
type: 'mapShape',
|
|
49
|
+
seriesId
|
|
50
|
+
}),
|
|
51
|
+
valueFormatter: input.valueFormatter ?? defaultValueFormatter
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
return {
|
|
55
|
+
series: defaultizedSeries,
|
|
56
|
+
seriesOrder
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
export default seriesProcessor;
|