question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Template strings in hover data

See original GitHub issue

This could include both attributes that exist in the trace

trace.hovertemplate = '{text}<br>{marker.size} Items<br>{y} Dollars'

But also data that is computed on-the-fly by plotly.js, like the bin widths:

trace.hovertemplate = 'The number of people between the age of {binleft} and {binright} is {bintotal}.'

This means you could express the existing box and violin text with some type of hovertemplate

This could span across traces, like the hover data on stacked bars

trace.template = 'This represents {trace.y} out of {data.total}'

Or one day, perhaps even trace level computations, like the sum of the area

texttemplate = 'The sum of the money is {trace.sum}'

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:18 (18 by maintainers)

github_iconTop GitHub Comments

4reactions
nicolaskruchtencommented, Sep 14, 2018

Note that we’ll likely need to bake in some kind of printf-style number formatting here as well to control precision, separators etc.

2reactions
nicolaskruchtencommented, Oct 5, 2018

… but the idea of : then formatting-language sounds fine to me 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Hover text and formatting in Python - Plotly
Over 17 examples of Hover Text and Formatting including changing color, size, ... This template string can include variables in %{variable} format, ...
Read more >
Python/Plotly: How to customize hover-template on with what ...
This will create simple two scatter3d plots, where hoverdata is x,y and z axis. Now you want to add the data m=[9,8,7,6,5] to...
Read more >
Hover Text and Formatting in Python-Plotly - GeeksforGeeks
It is a useful approach to Hover Text and Formatting as it allows to reveal a large amount of data about complex information....
Read more >
Introduction to Hovertemplate in Plotly Graphs - Medium
How to use custom data in hovertemplate ... “y”, “label” or “values” we need to format them in the hovertemplate string.
Read more >
Tooltips - Bootstrap
Hover over the buttons below to see the four tooltips directions: top, right, bottom, ... template, string, '<div class="tooltip" role="tooltip"><div ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found