Skip to content

Decreased show/hide trace performance #1623

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

Closed
legg681 opened this issue Apr 26, 2017 · 5 comments
Closed

Decreased show/hide trace performance #1623

legg681 opened this issue Apr 26, 2017 · 5 comments

Comments

@legg681
Copy link

legg681 commented Apr 26, 2017

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.

@etpinard
Copy link
Contributor

Thanks for posting.

This is probably a side effect of #1432

@etpinard etpinard added bug something broken type: performance labels Apr 26, 2017
@etpinard etpinard self-assigned this Apr 28, 2017
@etpinard
Copy link
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?

@rpaskowitz
Copy link
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.

@alexcjohnson
Copy link
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 🎉

@etpinard etpinard removed the bug something broken label Oct 4, 2018
@etpinard etpinard removed their assignment Oct 25, 2018
@gvwilson
Copy link
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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants