Skip to content
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

Add way to configure trace module ordering within subplot #3748

Closed
cpsievert opened this issue Apr 8, 2019 · 5 comments
Closed

Add way to configure trace module ordering within subplot #3748

cpsievert opened this issue Apr 8, 2019 · 5 comments
Labels
feature something new

Comments

@cpsievert
Copy link

For example, although the scatter trace appears first, it is drawn on top of the box-plot https://codepen.io/cpsievert/pen/yrVpeb

Needed for ggplotly() parity plotly/plotly.R#866

@etpinard
Copy link
Contributor

etpinard commented Apr 8, 2019

Yep, that's how things work unfortunately for now.

Here's our ordering:

traceLayerClasses: [
'heatmaplayer',
'contourcarpetlayer', 'contourlayer',
'waterfalllayer', 'barlayer',
'carpetlayer',
'violinlayer',
'boxlayer',
'ohlclayer',
'scattercarpetlayer', 'scatterlayer'
],

I guess we could add a list-like attribute to configure the module ordering, or better yet honor the ordering found in gd.data (but that would be a breaking change).

@cpsievert
Copy link
Author

or better yet honor the ordering found in gd.data

That'd be awesome 👍

Perhaps worth adding to #420?

@alexcjohnson
Copy link
Collaborator

or better yet honor the ordering found in gd.data

Not sure this is a good idea. For one there are cross-trace interactions that sometimes make this impossible (or at least nonsensical) - mostly involving filled scatter* but stacked bar would also do weird things in certain cases.

I also worry people would accidentally lose point-like traces behind area-like traces, and that in some contexts like chart studio it could be hard to get the order you want.

So I'd prefer we keep the current behavior but add a way to stack it as desired. Can we just add something like a zindex attribute - where any matching values keep the current behavior but different values (within a subplot) stack by index?

@cpsievert
Copy link
Author

Can we just add something like a zindex attribute

I could likely manage with that

@emilykl
Copy link
Contributor

emilykl commented May 24, 2024

Addressed by #6918

@emilykl emilykl closed this as completed May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature something new
Projects
None yet
Development

No branches or pull requests

4 participants