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.

hoverlabel formatting in unified mode

See original GitHub issue

The intention for unified hoverlabel formatting is that if layout.hoverlabel isn’t specified, it will use the settings from layout.legend for e.g. bgcolor and font etc, otherwise it will use the layout.hoverlabel settings.

Right now it seems like neither work to override the hoverlabel formatting in x unified mode

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
alexcjohnsoncommented, Mar 25, 2020

Just be careful re: all the template confusion, ideally we can just use the legend settings as the defaults for the hoverlabel settings at the coerce level, rather than interrogating the input layout directly.

Now what do you suppose will happen if you provide:

layout: {
    template: { layout: { hoverlabel: { bgcolor: 'blue' } } },
    legend: { bgcolor: 'red' }
}

I’m not sure what this should do, but we have similar inheritance scattered all around - and we I do recall we discussed this during the templates push - so it should be handled at the coerce level rather than special logic for this case.

1reaction
nicolaskruchtencommented, Mar 25, 2020

Oh I meant if e.g. layout.hoverlabel.bgcolor isn’t specified in the input, we should fall back to layout.legend.bgcolor’s coerced value in unified hovermode… makes sense?

so: layout: {} will get us a white hoverlabel, layout: {legend: {bgcolor: 'red}} will get us a red hoverlabel and layout: {legend: {bgcolor: 'red}, hoverlabel: {bgcolor: 'blue'} will get us a blue one. Ditto all the other settings in layout.hoverlabel like font etc that are in common with layout.legend.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Hover text and formatting in Python
Hover label text and colors default to trace colors in hover modes other than unified , and can be globally set via the...
Read more >
Plotly: How to edit unified hoverlabel? - python
Is there a way to 'tune' the menu obtained by editing the traces' names, numbers formats or adding additional informations? What if I...
Read more >
Hover Text and Formatting in Python-Plotly
Example 2: x unified. If layout.hovermode='x' , a single hover label appears per trace, for points at the same x value as the...
Read more >
How To Change Order Of R Plotly Hover Labels With "X ...
How To Change Order Of R Plotly Hover Labels With "X Unified" Mode ... a single hover label appear, add a different column,...
Read more >
25 Controlling tooltips
25.3 Styling. There is currently one main attribute for controlling the style of a tooltip: hoverlabel . With this attribute you can currently...
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