Add DensityMap trace for the MapLibre map subplot (plotly.js densitymap) · Issue #414 · plotly/plotly.rs · GitHub
Skip to content

Add DensityMap trace for the MapLibre map subplot (plotly.js densitymap) #414

Description

@jqnatividad

This complements ChoroplethMap support (#410) by adding density-heatmap trace for it. plotly.js provides densitymap as the MapLibre-based successor to the (Mapbox-based) densitymapbox, which is deprecated upstream. We should add a matching DensityMap Rust trace.

Motivation

DensityMapbox targets the older Mapbox subplot (layout.mapbox). New work should be able to draw weighted density heatmaps on the same layout.map subplot that ChoroplethMap already uses, with full color-scale and hover support.

Proposed change

Add a DensityMap<Lat, Lon, Z> trace that mirrors ChoroplethMap's structure but with a density data model:

  • Data: lat, lon, z (per-point weight), radius, opacity
  • Color: zauto, zmin/zmax/zmid, colorscale, autocolorscale, reversescale, showscale, colorbar, coloraxis
  • Hover: text, hovertext, hoverinfo, hovertemplate, hovertemplatefallback, hoverlabel
  • Map/misc: subplot (defaults to "map"), below, ids, meta, customdata, uirevision

No marker/selected/unselected (density traces have none). Registration: a DensityMap variant on PlotType (serializes to "densitymap"), plus module/type re-exports.

Dependency

This builds on the MapLibre map subplot (LayoutMap/MapStyle) introduced in #410, so the PR is stacked on that work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions