Skip to content

Decreased show/hide trace performance #1623

Description

@legg681

Hello,

I upgraded my plotly version from 1.16.0 to 1.25.0. With this update the delay when showing or hiding a trace got noticably longer. I tried to reproduce the issue in this codepen. When changing the plotly version from 1.16.0 to 1.25.0 in the html part the difference becomes apparent, when showing or hiding a trace.

1.16.0 feels very responsive, almost instant, whereas 1.25.0 has a very noticable lag.

Activity

  1. etpinard commented on Apr 26, 2017

    @etpinard
    Contributor

    Thanks for posting.

    This is probably a side effect of #1432

  2. self-assigned this
    on Apr 28, 2017
  3. etpinard commented on Apr 28, 2017

    @etpinard
    Contributor

    This perf decrease in indeed a side-effect of #1432 where we added double click interactions on legend items.

    @MarvinGee #1432 was first released in v1.25.0, so we should be able to upgrade to v1.24.2 without seeing this issue.


    This perf 📉 is due to this setTimeout where we wait 300ms in case another mouse up/down combo comes in - which effectively adds 300ms to every single-click legend item interaction 🐢 .

    To mitigate the problem, we could add a config option to disable double-click interactions on legend items which would remove that setTimeout when turned on.

    Fixing the problem will be a little trickier. We can't make double-clicks first call the single-click restyle and then some other restyle because the first click would hide the trace and then the second click would make that same trace visible again which isn't particularly desirable.

    I get the feeling that we should drop those legend double click interactions in v2. Greater than 300ms trace toggles are unacceptable (I really which I would've thought about that while reviewing #1432 😡 )

    @rpaskowitz @alexcjohnson any thoughts on this?

  4. rpaskowitz commented on Apr 28, 2017

    @rpaskowitz
    Contributor

    I find some of the hover behaviour and the checkmark not going away but the series just becoming faded a bit weird, but here's an example of how Richshaw does it - http://code.shutterstock.com/rickshaw/examples/legend.html

    The checkmarks control series visibility in the way that a single click does in Plotly, while clicking on the series name causes just that series to be shown.

    Another pattern I've seen, but can't find an example of offhand is to show an 'Only' button beside or on a series, normally tied to a hover event.

  5. alexcjohnson commented on Apr 29, 2017

    @alexcjohnson
    Collaborator

    I like the idea of an "only" button that appears on hover - perhaps an 👁 icon at the right edge of the label? I don't think that would need to wait for v2, as no functionality would disappear, we'd just turn a doubleclick into a more specific single-click. It would also make this feature more discoverable 🎉

  6. removed their assignment
    on Oct 25, 2018
  7. gvwilson commented on Jun 10, 2024

    @gvwilson
    Contributor

    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

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions