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

Imply trace indices from name attribute #75

Open
nirvana-msu opened this issue Jul 13, 2022 · 0 comments
Open

Imply trace indices from name attribute #75

nirvana-msu opened this issue Jul 13, 2022 · 0 comments

Comments

@nirvana-msu
Copy link

The doc page is a little misleading saying that updateData contains data:

... in a format matching figure['data']

Specifically, I naively thought I could include trace name there and it would figure out the correct trace to append data to (or create new):

dict(x=[1], y=[1], name='Trace 1')

That works on initial load (because it just creates a new plot) however on subsequent updates it fails because it assumes trace indices are simply linearly increasing, and also because passing name to extendTraces throws an error.

It would be very convenient if that was handled automatically, namely:

  • If name is present, check if it matches any of existing traces.
    • If it does, that's the trace to extend (and also name should be removed from the data passed to extendTraces).
    • If it does not, add as a new trace.
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

1 participant