Skip to content

Implement hovertemplate for all traces that support hover #3437

Description

@etpinard

Building on top of #3126, #3284, #3398 and #3436 hovertemplate is now supported for trace types: scatter, bar, pie, histogram, scattergl, sankey, scatterpolar, barpolar, scatterternary, scatterpolargl, choropleth, scattergeo and scattermapbox.

The "missing" trace types are:

  • contour, heatmap, histogram2d, histogram2dcontour
  • box and violin (for points done in Hovertemplate for box/violin points #3685 | otherwise not implemented)
  • all the gl3d trace types: scatter3d, surface, mesh3d, stremtubes, cone, isosurface
  • scattercarpet
  • ohlc and candlestick
  • splom
  • parcats
  • pointcloud, heatmapgl and contourgl (are we deprecating those trace types in v2?) deprecated
    cc @nicolaskruchten

Activity

  1. changed the title [-]Implement `hovertemplate` for all trace that support hover[/-] [+]Implement `hovertemplate` for all traces that support hover[/+] on Jan 14, 2019
  2. nicolaskruchten commented on Jan 14, 2019

    @nicolaskruchten
    Contributor

    Yup! I would say that scatter3d is the most important remaining one, followed by parcats and splom, then contour/heatmap/surface then the the histogram2d ones

  3. mpf82 commented on Jan 16, 2019

    @mpf82

    Personally, I would find it helpful and intuitive if for box the hovertemplate would be applied to single points only, not affecting the other hover texts (such as median, min, lower fence, ...).

    There could be a separate property to handle these.

  4. etpinard commented on Jan 24, 2019

    @etpinard
    ContributorAuthor

    scatter3d is the most important remaining one, followed by parcats and splom

    Cool, we'll try to fit these in v1.45.0. Thanks for the info!

  5. nicolaskruchten commented on Feb 9, 2019

    @nicolaskruchten
    Contributor

    If I can revise my original priority list, I might put @mpf82's suggestion above parcats ... It's pretty useful to be able to mouse over an outlier to know which one it is!

  6. etpinard commented on Feb 10, 2019

    @etpinard
    ContributorAuthor

    I might put @mpf82's suggestion above parcats

    I would find it helpful and intuitive if for box the hovertemplate would be applied to single points only, not affecting the other hover texts (such as median, min, lower fence, ...).

    Hmm. We haven't figured out the api for that one yet. See #3126 (comment)

    We can't just make hovertemplate just work on box points, because at some point we'll want to implement hovertemplates on all box hover labels.

  7. nicolaskruchten commented on Feb 10, 2019

    @nicolaskruchten
    Contributor

    We can't just make hovertemplate just work on box points, because at some point we'll want to implement hovertemplates on all box hover labels.

    I actually would find this to be most natural, and then we'd add boxhovertemplate or similar for the non-single-point ones.

  8. etpinard commented on Feb 10, 2019

    @etpinard
    ContributorAuthor

    we'd add boxhovertemplate

    I really dislike three-word attribute names, but I guess that would be one way to solve the problem.

    In a similar way, we'll need to declare multiple *hovertemplate attributes for parcats: one when hovering over links, and one when hovering over nodes.

    Sankey does a good job at this: it declares two hovetemplate attributes: one in link.hovertemplate and one in node.hovertemplate. Unfortunately, for parcats and box/violin we don't have "nice" attribute containers like these to work with.

    Hmm well, I guess for parcats we could use the line container and then maybe coerce a hovertemplate inside each dimensions item? Or maybe have the root hovertemplate apply to all the dimensions/nodes and be ignored when hovering on links?

  9. etpinard commented on Feb 15, 2019

    @etpinard
    ContributorAuthor

    After #3530, only box, violin, ohlc, candlestick and the old gl2d traces will be missing hovertemplate support.

  10. etpinard commented on Mar 26, 2019

    @etpinard
    ContributorAuthor

    hovertemplate support for box and violin points is implemented in #3685

  11. jackparmer commented on Sep 10, 2020

    @jackparmer
    Contributor

    This issue has been tagged with NEEDS SPON$OR

    A community PR for this feature would certainly be welcome, but our experience is deeper features like this are difficult to complete without the Plotly maintainers leading the effort.

    Sponsorship range: $5k-$10k

    What Sponsorship includes:

    • Completion of this feature to the Sponsor's satisfaction, in a manner coherent with the rest of the Plotly.js library and API
    • Tests for this feature
    • Long-term support (continued support of this feature in the latest version of Plotly.js)
    • Documentation at plotly.com/javascript
    • Possibility of integrating this feature with Plotly Graphing Libraries (Python, R, F#, Julia, MATLAB, etc)
    • Possibility of integrating this feature with Dash
    • Feature announcement on community.plotly.com with shout out to Sponsor (or can remain anonymous)
    • Gratification of advancing the world's most downloaded, interactive scientific graphing libraries (>50M downloads across supported languages)

    Please include the link to this issue when contacting us to discuss.

  12. gvwilson commented on Jun 11, 2024

    @gvwilson
    Contributor

    Hi - this issue has been sitting for a while, so as part of our effort to tidy up our public repositories I'm going to close it. If it's still a concern, we'd be grateful if you could open a new issue (with a short reproducible example if appropriate) so that we can add it to our stack. Cheers - @gvwilson

  13. emilykl commented on Nov 12, 2025

    @emilykl
    Contributor

    Reopening because still relevant

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions