Skip to content

hoverlabel formatting in unified mode #4683

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
nicolaskruchten opened this issue Mar 25, 2020 · 6 comments · Fixed by #4687
Closed

hoverlabel formatting in unified mode #4683

nicolaskruchten opened this issue Mar 25, 2020 · 6 comments · Fixed by #4687
Assignees
Labels
bug something broken
Milestone

Comments

@nicolaskruchten
Copy link
Contributor

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

@nicolaskruchten nicolaskruchten added the bug something broken label Mar 25, 2020
@antoinerg
Copy link
Contributor

At the moment, it inherits layout.font. I'll implement what you're asking.

@antoinerg
Copy link
Contributor

@nicolaskruchten @alexcjohnson is it ever possible for layout.hoverlabel to be undefined? Doesn't it always get coerced?

@nicolaskruchten
Copy link
Contributor Author

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.

@alexcjohnson
Copy link
Collaborator

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.

@nicolaskruchten
Copy link
Contributor Author

right sorry I meant to post this exact example... the answer is blue ;)

@nicolaskruchten
Copy link
Contributor Author

related to #4482 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants