diff --git a/CHANGELOG.md b/CHANGELOG.md index b37b671f..ca0219e7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ### Added +- [[#413](https://github.com/plotly/plotly.rs/issues/413)] Add hover (`hovertext`/`hoverinfo`/`hovertemplate`/`customdata`/`hoverlabel`/`text`) and color-scale (`colorscale`/`colorbar`/`showscale`/`reversescale`/`autocolorscale`/`coloraxis`) support, plus `ids`/`meta`/`uirevision`/`below`, to `DensityMapbox` - [[#406](https://github.com/plotly/plotly.rs/issues/406)] Expose `plotly.js` 3.1–3.6 attributes ### Changed diff --git a/plotly/src/traces/density_mapbox.rs b/plotly/src/traces/density_mapbox.rs index 30dac55a..f19b885c 100644 --- a/plotly/src/traces/density_mapbox.rs +++ b/plotly/src/traces/density_mapbox.rs @@ -3,7 +3,10 @@ use plotly_derive::FieldSetter; use serde::Serialize; -use crate::common::{LegendGroupTitle, Line, PlotType, Visible}; +use crate::common::{ + ColorBar, ColorScale, Dim, HoverInfo, Label, LegendGroupTitle, Line, PlotType, Visible, +}; +use crate::private::{NumOrString, NumOrStringCollection}; use crate::Trace; #[serde_with::skip_serializing_none] @@ -49,6 +52,10 @@ where /// Line display properties. line: Option, + /// Assigns id labels to each datum. These ids are for object constancy of + /// data points during animation. + ids: Option>, + lat: Option>, lon: Option>, z: Option>, @@ -56,6 +63,48 @@ where /// Sets the opacity of the trace. opacity: Option, + /// Sets text elements associated with each (lat,lon,z) triplet. If a single + /// string, the same string appears over all the data points. If an array of + /// strings, the items are mapped in order to the data points. To be seen, + /// the trace `hover_info` must contain a "text" flag. + text: Option>, + + /// Sets hover text elements associated with each (lat,lon,z) triplet. If a + /// single string, the same string appears over all the data points. If an + /// array of strings, the items are mapped in order to the data points. To + /// be seen, the trace `hover_info` must contain a "text" flag. + #[serde(rename = "hovertext")] + hover_text: Option>, + + /// Determines which trace information appears on hover. + #[serde(rename = "hoverinfo")] + hover_info: Option, + + /// Template string used for rendering the information that appear on hover + /// box. Note that this will override `hover_info`. Variables are inserted + /// using %{variable}, for example "y: %{y}". + #[serde(rename = "hovertemplate")] + hover_template: Option>, + + /// Fallback string used for rendering the information that appear on hover + /// box when the `hover_template` cannot be evaluated. + #[serde(rename = "hovertemplatefallback")] + hover_template_fallback: Option>, + + /// Properties of label displayed on mouse hover. + #[serde(rename = "hoverlabel")] + hover_label: Option