Uh oh!
There was an error while loading. Please reload this page.
Conversation
With the changes made in this PR, a bunch of mocks are now broken in unified hover modes because they contain this in their layout: "legend": {
"font": {
"family": "", "size": 0, "color": ""
}, This is all over our mocks and I wonder why that is the case? EDIT: Commit 4ef8205 now takes care of the problem. |
alexcjohnson
commented
Mar 25, 2020
Ah yeah, that's in a lot of really old mocks... my recollection is these came from the predecessor to chart studio, which at one point had a bug that it was saving effectively |
antoinerg
commented
Mar 25, 2020
I don't particularly like the changes I made in I must say however that inheriting the |
nicolaskruchten
commented
Mar 25, 2020
We explicitly force the legend bgcolor to transparent in some mocks? |
antoinerg
commented
Mar 25, 2020
We do. For example: plotly.js/test/image/mocks/11.json Line 240 in 60425d2 |
| bgcolor: fullLayout.paper_bgcolor, | ||
| title: {text: t0, font: fullLayout.hoverlabel.font}, | ||
| font: fullLayout.hoverlabel.font, | ||
| bgcolor: fullLayout.hoverlabel.bgcolor || fullLayout.paper_bgcolor, |
There was a problem hiding this comment.
why do we need the paper_bgcolor fallback here?
There was a problem hiding this comment.
If hoverlabel.bgcolor is undefined, we need a fallback. We can either specify it here or specify paper_bgcolor in mockLayoutOut in order for legendSupplyDefaults to use it as a fallback. Let me know what you prefer!
There was a problem hiding this comment.
Do we have a test for this?
Should we update the descriptions?
There was a problem hiding this comment.
Yes, the background color is well tested to make sure that the color is set by layout attribute hoverlabel.bgcolor > legend.bgcolor > paper_bgcolor.
We should definitely update the description.
There was a problem hiding this comment.
Just closing the loop based on our off-GH conversation: layout.hoverlabel.bgcolor is empty by default, so that each hoverlabel knows to take its color from its trace. It only has a value if you explicitly set one, that will become the common hover label color for all traces.
Uh oh!
There was an error while loading. Please reload this page.
alexcjohnson
commented
Mar 26, 2020
Re: transparent legend bgcolor - there are two interesting cases: legend over the margin, and legend over the plot. Both of these will happen from time to time, but I'd say we should fall back on |
alexcjohnson
commented
Mar 26, 2020
Yes, looking at it again I think you're right. Also because the default for |
antoinerg
commented
Mar 26, 2020
Ok, I went with |
| register([ | ||
| require('./components/fx'), | ||
| require('./components/legend'), | ||
| require('./components/fx'), |
There was a problem hiding this comment.
Heh that was easy 😅 A little fragile though. Can we add a comment at least, saying that fx needs to come after legend for supplyDefaults to work correctly? I wonder if there are any other couplings like this?
There was a problem hiding this comment.
Done in 0d406a0
It's a bit fragile although the hoverlable_test would fail if the order was changed!
alexcjohnson
left a comment
There was a problem hiding this comment.
Fantastic - just one request for a comment then this is ready to go! 💃

Fixes#4683
TODO
bordercolor(531fe79)hoverlabel.bgcoloris opaque by default (cc8ca1c)