-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
feat: absolute draw order / rank property #4676
Comments
Let me break down the current behavior a little:
Meaning scatter traces are always on top, image traces are always on bottom, everything in between is as in this list. So with all of that in mind, which of these three categories describes your use cases? It would be fairly easy to add an attribute to change (3) - the ordering of traces of the same type on the same axes, but hard to add a way to change the other orderings (different types, or on different axes). But there's a workaround: make extra axes - that can be set to be overlaying and matching the main axes and with all their marks disabled, so really their only effect is to change the layering - and put the traces intended to be in back on lower-numbered axes, traces in front on higher-numbered axes. |
The scenario we encountered is in the area of (1). We have scatter traces linked to yaxis2 and bar traces linked to yaxis1. The scatter traces should be drawn on top of the bar traces. From your explanation, the best solution would be to add additional axes with higher indexes (e.g. yaxis3) and re-assign the bar traces to these. We simplified the axis logic for our less technical end users as follows:
We could build a workaround on our side that would be invisible to the user by automatically creating multiple axes based on the To summarize: |
Summing up past discussions of solution design for this one. API
Implementation (based on notes from @alexcjohnson)
|
See great progress: plotly/plotly.js#6918 |
We could possibly close this one as |
agreed |
Currently, there is no way to set an absolute draw order for traces. It would be very useful to have a property to determine the global draw order, e.g. to give a trace the value of 1 to make sure it is always drawn on top of all other traces and another trace the value of 9999 to make sure it is drawn behind all other traces.
The text was updated successfully, but these errors were encountered: