-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Wrong interaction between fill:tonexty and fill:none traces #113
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
Comments
@iustin Thanks for writing in. This is an interesting report. @alexcjohnson will share more information on the fill-to algorithm shortly. |
Oh interesting indeed... I hadn't thought about what should happen with fill when you hide traces but this definitely is NOT it. Good catch. This is I believe the only case we have, at least so far, where the attributes of a hidden trace should still matter! I think the right logic is to chain
So to be precise, lets say trace filli = tracei.fill;
for(j = i; j >= 0; j--) {
tracej = data[j];
if(tracej.type !== 'scatter') continue;
if(tracej.visible !== true) break; // recall visible='legendonly'...
if(trace.fill.substr(0,6) !== 'tonext') {
filli = tracej.fill;
break;
}
// what's left to continue looping is only invisible scatter fill:tonext traces
} |
@alexcjohnson I'm glad you found this interesting! One question: in your example, I'mnot sure what's the difference between the |
@etpinard perhaps one of you guys can flesh out the above algorithm, then make a few tests (side-by-side subplots with all the traces visible on one side, some turned off on the other?) so we can see if we all agree that this is doing the right thing? |
@alexcjohnson - ah, I understood what confidence bands are; what I meant was: I don't see how with the current options, you can make a difference between somebody doing a confidence band, and somebody (like my example) who wants |
Maybe fixed by #3005 |
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 |
Not sure if I'm misunderstanding the way fill should be used or not. In any case, a scatter graph with:
none
lines, which might or might not intersect the fill lines, which have to come firsttozeroy
and multipletonexty
lines; none of these fill-something lines are intersectingEverything looks OK, until one hides the
tozeroy
line and alltonexty
lines that have values smaller than the non-fill lines. Normally I'd expect the next 'fill-something' line to expand to zero, but - since there is a hard separation between tozeroy and tonexty - this doesn't happen. Instead, the next (and smallest) fill-tonexty line will just fill to a non-fill line.If there are no non-fill lines, then the smalles
tonexty
line will - as expected - fill to zeroy. It seems to me thattonexty
should ignorefill:none
lines, or alternatively: remove the distinction betweentonexty
andtozeroy
, sincetonexty
already doestozeroy
if it doesn't find a next y trace.I'm not sure I explained correctly, so here's a chart that shows this behaviour:
https://plot.ly/~iustin/59/no-fill-fill-1-fill-2-fill-3/
just hide/unhide the
fill-1
trace, and see the wrong behaviour. Additionally toggle theno-fill
trace as well. If on the other hand,fill-2
is hidden, you can see thatfill-3
fills correctly tofill-1
, and not tono-fill
, so sometimesfill:none
traces are indeed ignored.The text was updated successfully, but these errors were encountered: