Skip to content

Plotly.deleteFrames(gd, null) should delete *all* frames #1528

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
rreusser opened this issue Mar 29, 2017 · 6 comments
Closed

Plotly.deleteFrames(gd, null) should delete *all* frames #1528

rreusser opened this issue Mar 29, 2017 · 6 comments
Assignees
Labels
bug something broken

Comments

@rreusser
Copy link
Contributor

rreusser commented Mar 29, 2017

Currently, I think Plotly.deleteFrames('graph', null); will throw an error as it expects a list of frame indices to be deleted. This seems like an oversight. To match animate(gd, null), it should probably delete all frames. If there's agreement, I'll make this quick fix.

will fail here: https://github.com/plotly/plotly.js/blob/master/src/plot_api/plot_api.js#L2767

@rreusser rreusser self-assigned this Mar 29, 2017
@etpinard
Copy link
Contributor

Hmm. What does Plotly.deleteTraces(gd, null) do?

@rreusser
Copy link
Contributor Author

Comparison:

screen shot 2017-03-29 at 16 56 10

@rreusser
Copy link
Contributor Author

rreusser commented Mar 29, 2017

The challenge (both for traces and frames, IMO) is that it's difficult to track what the indices actually are since there's no API for querying the state of the chart without digging into ._fullData — which is pretty stable at this point though still private — and ._transitionData — which always bugs me as a slight misnomer that should be _animationData so that I hate recommending digging into private data as a formally correct answer to how to maintain the state of the plot.

@rreusser
Copy link
Contributor Author

(Small addendum that unless no longer throwing an error is a breaking change, I don't see a particular problem with considering both of these an enhancement or both of these simply unsupported (in which case the frame error should be more descriptive))

@etpinard
Copy link
Contributor

@rreusser this issue was closed by #1531, correct? Or do you want to leave this open to discuss it further?

@rreusser
Copy link
Contributor Author

Oops. Neglected to close. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken
Projects
None yet
Development

No branches or pull requests

2 participants