Skip to content

Add way to configure trace module ordering within subplot #3748

Closed

Description

@cpsievert

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

Activity

  1. etpinard commented on Apr 8, 2019

    @etpinard
    Contributor

    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).

  2. cpsievert commented on Apr 8, 2019

    @cpsievert
    Author

    or better yet honor the ordering found in gd.data

    That'd be awesome 👍

    Perhaps worth adding to #420?

  3. alexcjohnson commented on Apr 9, 2019

    @alexcjohnson
    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?

  4. cpsievert commented on Apr 9, 2019

    @cpsievert
    Author

    Can we just add something like a zindex attribute

    I could likely manage with that

  5. changed the title [-]Some traces (e.g. box, violin, bar) always appear below other traces[/-] [+]Add way to configure trace module ordering within subplot[/+] on May 30, 2019
  6. emilykl commented on May 24, 2024

    @emilykl
    Contributor

    Addressed by #6918

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions