Skip to content

[charts] Add seriesId prop to MapShapePlot#22975

Closed
JCQuintas wants to merge 1 commit into
mui:masterfrom
JCQuintas:feat/charts-map-shape-plot-series-id
Closed

[charts] Add seriesId prop to MapShapePlot#22975
JCQuintas wants to merge 1 commit into
mui:masterfrom
JCQuintas:feat/charts-map-shape-plot-series-id

Conversation

@JCQuintas

Copy link
Copy Markdown
Member

Summary

Adds a seriesId prop to MapShapePlot to render only a subset of mapShape series.

Until now MapShapePlot always rendered every mapShape series, and its fill/stroke/strokeWidth apply uniformly. That made it impossible to style separate layers differently. With seriesId, multiple MapShapePlot can each target their own series — for example filled shapes below and outlines on top.

<MapShapePlot seriesId="plates" stroke="#fff" />
<MapShapePlot seriesId="countries" fill="none" stroke="#263238" />
  • seriesId accepts a single id or an array of ids.
  • When omitted, behavior is unchanged (renders every mapShape series).

The underlying useMapShapeSeries hook already supports id filtering; this exposes it through the component.

A docs example using this prop follows in a separate PR.

Allows rendering a subset of `mapShape` series, so multiple `MapShapePlot` can
style separate layers (for example filled shapes below and outlines on top).
@JCQuintas JCQuintas requested a review from alexfauquette as a code owner June 26, 2026 09:07
@JCQuintas JCQuintas self-assigned this Jun 26, 2026
@JCQuintas JCQuintas added scope: charts Changes related to the charts. type: new feature Expand the scope of the product to solve a new problem. labels Jun 26, 2026
@JCQuintas

Copy link
Copy Markdown
Member Author

@alexfauquette Not sure if we want to keep the current behaviour or force one MapShapePlot per series.

@code-infra-dashboard

code-infra-dashboard Bot commented Jun 26, 2026

Copy link
Copy Markdown

Deploy preview

https://deploy-preview-22975--material-ui-x.netlify.app/

Bundle size

Bundle Parsed size Gzip size
@mui/x-data-grid 0B(0.00%) 0B(0.00%)
@mui/x-data-grid-pro 0B(0.00%) 0B(0.00%)
@mui/x-data-grid-premium 0B(0.00%) 0B(0.00%)
@mui/x-charts 0B(0.00%) 0B(0.00%)
@mui/x-charts-pro 0B(0.00%) 0B(0.00%)
@mui/x-charts-premium 🔺+125B(+0.02%) 🔺+46B(+0.02%)
@mui/x-date-pickers 0B(0.00%) 0B(0.00%)
@mui/x-date-pickers-pro 0B(0.00%) 0B(0.00%)
@mui/x-tree-view 0B(0.00%) 0B(0.00%)
@mui/x-tree-view-pro 0B(0.00%) 0B(0.00%)
@mui/x-license 0B(0.00%) 0B(0.00%)

Details of bundle changes

Performance

Total duration: 2,019.49 ms +157.38 ms(+8.5%) | Renders: 63 (+0)

Test Duration Renders
LineChart stacked area with multiple series 220.29 ms 🔺+60.13 ms(+37.5%) 2 (+0)
ScatterChartPremium with big data amount (webgl renderer) 112.61 ms 🔺+41.30 ms(+57.9%) 5 (+0)
LineChart with big data amount (with marks) 96.05 ms 🔺+16.11 ms(+20.2%) 2 (+0)
Area chart with big data amount (no marks) 27.84 ms 🔺+9.16 ms(+49.0%) 2 (+0)
LineChart with date axis and big data amount 19.17 ms 🔺+7.28 ms(+61.3%) 2 (+0)

…and 4 more (+17 within noise) — details

Metric alarms

Test Metric Change
LineChart stacked area with multiple series bench:paint 🔺 +73.60 ms
ScatterChartPremium with big data amount (webgl renderer) bench:paint 🔺 +38.97 ms
LineChart with big data amount (with marks) bench:paint 🔺 +26.37 ms
Area chart with big data amount (no marks) bench:paint 🔺 +11.91 ms
LineChart with date axis and big data amount bench:paint 🔺 +14.75 ms
ScatterChartPro with big data amount and zoomed in (batch renderer) bench:paint 🔺 +6.53 ms
ScatterChartPro with big data amount (single renderer) bench:paint 🔺 +9.04 ms
ScatterChartPro with big data amount and zoomed in (single renderer) bench:paint 🔺 +6.08 ms
ScatterChartPro with big data amount (batch renderer) bench:paint 🔺 +4.89 ms

Check out the code infra dashboard for more information about this PR.

@alexfauquette

Copy link
Copy Markdown
Member

Not sure to get it. why not using the [data-series="seriesId"] selector like the other charts?

@JCQuintas

Copy link
Copy Markdown
Member Author

Not sure to get it. why not using the [data-series="seriesId"] selector like the other charts?

For some reason I though our default API was using multiple plots 🫠

nvm, it seems I need a cup of coffee...

@JCQuintas JCQuintas closed this Jun 26, 2026
@JCQuintas JCQuintas deleted the feat/charts-map-shape-plot-series-id branch June 26, 2026 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: charts Changes related to the charts. type: new feature Expand the scope of the product to solve a new problem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants