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

Feature: add a way to 'extend' a plot in a sorted way #4408

Closed
bearsh opened this issue Dec 4, 2019 · 2 comments
Closed

Feature: add a way to 'extend' a plot in a sorted way #4408

bearsh opened this issue Dec 4, 2019 · 2 comments

Comments

@bearsh
Copy link

bearsh commented Dec 4, 2019

using Plotly,extendTraces() appends the data to the end. What about a way to 'insert' new data in a sorted way?

How should it work?
if I have the following plot with
x: [t, t+10, t+20]
y: [1,2,3]

a call to Plotly.extendTraceSorted() with
x: [t+5, t+15], y: [5, 5]

should insert the pair in a sorted way based on x:
x: [t, t+5, t+10, t+15, t+20]
y: [1, 5, 2, 5, 3]

Why
This allows to first render a graph with much less datapoints (e.g. scatter plot, sensor data, every 10min). later either by user request or timed add more and more datapoints until all data is plotted. or only add points for a timespan the user zooms in.

what do you think?

@etpinard
Copy link
Contributor

I think you can get the desired behaviour using a sort transform:

https://codepen.io/etpinard/pen/WNbpmzV?editors=1010

@etpinard
Copy link
Contributor

etpinard commented Jan 7, 2020

Closing to due lack of activity.

@etpinard etpinard closed this as completed Jan 7, 2020
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

2 participants