Skip to content

Expose Plotly.purge method #300

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

Merged
merged 14 commits into from
Mar 11, 2016
Merged

Expose Plotly.purge method #300

merged 14 commits into from
Mar 11, 2016

Conversation

etpinard
Copy link
Contributor

@etpinard etpinard commented Mar 1, 2016

resolves #126

@mdtusz @mikolalysenko @alexcjohnson @emackey

supplementary background info in #117 and #132

In brief, this PR adds a purge method to the our official API on the Plotly object.

Whereas, the internal Plotly.Plots.purge is meant to prepare the state for subsequent Plotly.plot calls (e.g what Plotly.newPlot does essentially), the proposed Plotly.purge clear the state -- including the gl contexts -- and the graph div instead without the documented all hell braking loose.

var myImage = new Image();
myImage.src = figDir + plotname + '.png';

image.innerHTML = '';
image.appendChild(myImage);

gd = document.createElement('div');
gd.id = 'graph';
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mdtusz not sure why I didn't do this before, now you can use Plotly.plot('graph', [], {}) in the test-dashboard.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🍻

@mdtusz
Copy link
Contributor

mdtusz commented Mar 4, 2016

💃

etpinard added a commit that referenced this pull request Mar 11, 2016
@etpinard etpinard merged commit 52a3b09 into master Mar 11, 2016
@etpinard etpinard deleted the expose-purge-method branch March 11, 2016 14:38
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

Successfully merging this pull request may close these issues.

Plots.purge does not halt render loop for scene or scene2d
2 participants