mapbox-data-visualization-patterns
Patterns for visualizing data on maps including choropleth maps, heat maps, 3D visualizations, data-driven styling, and animated data. Covers layer types, color scales, and performance optimization.
Security Assessment
About mapbox-data-visualization-patterns
mapbox-data-visualization-patterns is a comprehensive pattern library for visualizing data on Mapbox GL maps. It solves the problem of choosing and correctly implementing the right map visualization for a given dataset — choropleth maps, heat maps, point clustering, 3D extrusions, data-driven styling, and animated time-series — by providing ready-to-adapt JavaScript patterns using Mapbox GL layer types and expressions.
The skill's main document covers choropleth maps with data-driven `interpolate`, `step`, and `match` color expressions and reusable hover popups, plus heat maps for point density, and explains when to prefer smooth interpolation versus discrete buckets. Reference files go deeper on clustering (with a decision table for clustering versus heatmaps and custom cluster properties), 3D extrusions (including the caveat that the classic example works only with classic styles and an anti-pattern warning against constant extrusion heights), circles and lines, legends and use cases, animation, and performance optimization for data-heavy applications. Throughout, it emphasizes data-driven styling from feature properties rather than hard-coded values, and it ships an evals file for testing.
Target users are web developers and data practitioners building interactive maps with Mapbox GL JS. Typical use cases include visualizing statistical data by region, showing incident or event density, extruding building or population data in 3D, animating time-series, and optimizing rendering for large datasets. All examples are client-side Mapbox GL styling code that reads GeoJSON sources; the skill contains no destructive operations, credential handling, or remote code execution.
FAQ
What visualization types does this skill cover?
Choropleth maps, heat maps, point clustering, 3D extrusions, data-driven styling, and animated time-series data, plus performance optimization for data-heavy maps.
When should I use clustering versus a heat map?
Use clustering for discrete grouping with exact, clickable counts (store locators, event listings); use a heat map for a continuous density gradient (crime or incident areas). The clustering reference includes a full comparison table.
How does data-driven styling work?
Styles read feature properties through Mapbox expressions — `interpolate` for continuous scales, `step` for discrete buckets, and `match` for categorical data — so colors, sizes, and 3D heights come from the data rather than fixed values.
Are there caveats for 3D extrusions?
Yes. The 3D-buildings example works with classic styles only (streets-v12, dark-v11, light-v11, etc.); the Mapbox Standard style includes detailed 3D buildings by default. The skill also warns against using a constant extrusion height instead of a property-driven expression.
What library and data format do the patterns assume?
Mapbox GL JS, with GeoJSON sources providing features and properties. The patterns are client-side styling and layer code you adapt to your own data.
Install mapbox-data-visualization-patterns
Quick Setup:
- Copy the skill folder to
.claude/skills/ - Claude will automatically detect and use the skill
Repository
mapbox/mapbox-agent-skills