Skip to content

DensityMapbox is missing hover, color-scale, and data-array attributes #413

Description

@jqnatividad

The DensityMapbox trace exposes only a small subset of the attributes that plotly.js v3.6.0 supports for the densitymapbox trace. In particular it has no hover configuration and no color-scale controls, so a density heatmap cannot show per-point hover text or a custom/reversed colorscale + colorbar.

Current behavior

DensityMapbox currently supports only: name, visible, showlegend, legendrank, legendgroup, legendgrouptitle, line, lat, lon, z, opacity, subplot, zauto, zmin/zmax/zmid, zoom, radius.

Because there are no hover fields, the default hover readout is raw lat/lon/z — and when z is a uniform weight (a common case), the hover shows a meaningless z: 1.

Missing attributes (per the plotly.js reference - https://plotly.com/javascript/reference/densitymapbox/)

  • Hover/text: text, hovertext, hoverinfo, hovertemplate, hovertemplatefallback, hoverlabel
  • Color controls: colorscale, autocolorscale, reversescale, showscale, colorbar, coloraxis
  • Data/misc: ids, meta, customdata, uirevision, below

Proposed change

Add the above as Option fields following the existing FieldSetter pattern, mirroring the field/type/serde conventions already used by ScatterMapbox and ChoroplethMap (e.g. hover_text: Option<Dim> → hovertext, color_scale: Option → colorscale, color_bar: Option → colorbar). Existing fields are unchanged, so this is purely additive.

Notes / out of scope

  • DensityMapbox has been deprecated. Adding this support to help users transition to the new DensityMap trace.
  • radius stays Option (scalar). plotly.js allows number or array (per-point radius); widening to Dim<_> is a breaking change to the existing setter and can be a follow-up.
  • The pre-existing zoom and line fields are not valid densitymapbox trace attributes (zoom belongs on layout.mapbox.zoom); removing them would be breaking and is left for a separate cleanup.

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