All skills
mapbox avatar

/mapbox-data-visualization-patterns

@65bab68 official
by mapboxmapbox/mapbox-agent-skills80 stars
17

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.

Use this Skill: https://skilld.dev/gh/mapbox/mapbox-agent-skills/mapbox-data-visualization-patterns

This session only. Nothing lands on disk.

referencescircles-lines.md

≈601 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Circle/Bubble Maps and Line Data Visualization

Circle/Bubble Maps

Best for: Point data with magnitude, proportional symbols

Pattern: Size circles based on data values

map.on('load', () => {
  map.addSource('earthquakes', {
    type: 'geojson',
    data: 'https://example.com/earthquakes.geojson'
  });

  // Size by magnitude, color by depth
  map.addLayer({
    id: 'earthquakes',
    type: 'circle',
    source: 'earthquakes',
    paint: {
      // Size circles by magnitude
      'circle-radius': ['interpolate', ['exponential', 2], ['get', 'mag'], 0, 2, 5, 20, 8, 100],
      // Color by depth
      'circle-color': [
        'interpolate',
        ['linear'],
        ['get', 'depth'],
        0,
        '#ffffcc',
        50,
        '#a1dab4',
        100,
        '#41b6c4',
        200,
        '#2c7fb8',
        300,
        '#253494'
      ],
      'circle-stroke-color': '#ffffff',
      'circle-stroke-width': 1,
      'circle-opacity': 0.75
    }
  });

  // Add popup on click
  map.on('click', 'earthquakes', (e) => {
    const props = e.features[0].properties;
    new mapboxgl.Popup()
      .setLngLat(e.features[0].geometry.coordinates)
      .setHTML(
        `
        <h3>Magnitude ${props.mag}</h3>
        <p>Depth: ${props.depth} km</p>
        <p>Time: ${new Date(props.time).toLocaleString()}</p>
      `
      )
      .addTo(map);
  });
});

Line Data Visualization

Best for: Routes, flows, connections, networks

Pattern: Style lines based on data

map.on('load', () => {
  map.addSource('traffic', {
    type: 'geojson',
    data: 'https://example.com/traffic.geojson'
  });

  // Traffic flow with data-driven styling
  map.addLayer({
    id: 'traffic-lines',
    type: 'line',
    source: 'traffic',
    paint: {
      // Width by traffic volume
      'line-width': ['interpolate', ['exponential', 2], ['get', 'volume'], 0, 1, 1000, 5, 10000, 15],
      // Color by speed (congestion)
      'line-color': [
        'interpolate',
        ['linear'],
        ['get', 'speed'],
        0,
        '#d73027', // Red: stopped
        15,
        '#fc8d59', // Orange: slow
        30,
        '#fee08b', // Yellow: moderate
        45,
        '#d9ef8b', // Light green: good
        60,
        '#91cf60', // Green: free flow
        75,
        '#1a9850'
      ],
      'line-opacity': 0.8
    }
  });
});

Source: SKILL.md on GitHub

No alerts14d5 checks · Risk SAFE
  • Gen Agent Trust Hub14d

    The skill provides comprehensive patterns for Mapbox data visualizations. It is generally safe, but it identifies an attack surface for indirect prompt injection by demonstrating how to ingest external data and display properties in UI components without sanitization or boundary markers.

  • Socket14d

    No alerts

  • Snyk14d

    Risk: LOW · No issues

  • Runlayer6mo

    2 files scanned · No issues

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at 65bab68. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 6 hours ago.

Activeupdated 6 months ago
  • mapbox
  • choropleth
  • heatmap
  • 3d-extrusion
  • data-driven-styling
  • geojson
  • vector-tiles
  • animation
  • cartography

README badge

README badge for mapbox/mapbox-agent-skills/mapbox-data-visualization-patterns

Teaches patterns for visualizing statistical and geographic data on Mapbox maps, including choropleth maps, heat maps, 3D extrusions, data-driven styling, and animation. Covers layer types, color scales, accessibility, and performance optimization for datasets up to vector tilesets.

Generated from the current SKILL.md.

Does this skill cover vector tiles or only GeoJSON?
It covers both. The skill recommends GeoJSON for datasets under 1 MB, vector tiles for datasets over 10 MB. See the performance reference file for implementation details.
What color scale strategies does this skill include?
Three main strategies: linear interpolation for continuous gradients, step intervals for discrete buckets, and match-based styling for categorical data. ColorBrewer scales are recommended for accessibility.
Does this skill cover 3D visualizations?
Yes. The skill includes patterns for 3D building extrusions and terrain elevation, with detailed implementation in the 3d-extrusions reference file.
Can this skill handle real-time or animated data?
Yes. The animation reference file covers time-series animation, real-time data updates, and smooth transitions.
What layer types are covered?
Choropleth (fill layers), heat maps, circle/bubble maps, line visualizations, and 3D extrusions. Additional patterns are available in referenced files for clustering and custom styling.

Generated from the current SKILL.md. These answers refresh after source changes.