-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Plots.purge does not halt render loop for scene or scene2d #126
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
Comments
Is this related to what @alexcjohnson was saying here? |
@emackey Confirmed. This situation also occurs if
That said, What exactly are you trying to do by purging the graph div? To clear the graph, you could instead call: Plotly.newPlot(Tabs.getGraph(), [], {}); |
@emackey Alternatively you could remove the graph div element completely e.g: Plotly.newPlot('graph', [{x:[1,2,3], y:[2,1,2], type:'scattergl'}]).then(function() {
d3.select('#graph').remove();
}); |
Thanks guys, two comments:
OK, third comment:
|
Perhaps |
Interesting. Putting a breakpoint in the render loop and this Plotly.newPlot(Tabs.fresh(), [{
type: 'scattergl',
x: [1,2,3],
y: [1,2,3],
z: [2,1,2]
}])
.then(function() {
console.log(Plotly.d3.select('canvas').size()); // => 1
})
.then(function() {
Plotly.newPlot(Tabs.getGraph(), []);
})
.then(function() {
console.log(Plotly.d3.select('canvas').size()); // => 0
}); catches the breakpoint only once.
As far as I know (I'm no WebGL expert by the way), rendering WebGL objects inside a |
Here's what I'm seeing. Open the
Next, click the round gray circle at the top of DevTools, to begin recording a timeline. A recording dialog pops up and counts off some seconds. After five seconds, click Now, let's try it with a
Record a new 5-second timeline. It looks a bit different: In the console, repeat your previous command, so as to create a new scattergl plot in a fresh Tab. It should look exactly like the previous scattergl, but record another 5 seconds and you'll see it's different: Repeat the fresh scattergl command several more times, and you'll see the chart get worse each time. After about 5 newPlots, it looks like this: After about 15 of them, Chrome gets angry:
Note the word The good news is, there does seem to be a way to shut down easily, at least for If you can prevent |
@emackey Thank you very much for this report. The gl3d modules are definitely more mature than Unfortunately, the plot-creation logic in the plotly.js code can't directly be shared between gl3d and gl2d. In gl3d, The point you bring up about Moreover, // grab ref to scene object
var scene2d = Tabs.getGraph()._fullLayout._plots.xy._scene2d;
// destroy it
scene2d.destroy(); might be worth trying. |
This seems like the same problem as #132 The problem is that we are never calling Also we should be calling these methods in |
This issue is the bug report itself, and #132 is a PR offering a possible solution to this. Keep in mind that the user is not encouraged to call So the problem stands: How can an app dismiss any plot from the page, without immediately creating a new plot in its place, and expect the render loop to halt? |
This can be seen in the
test_dashboard
environment, open the console and plot this:then purge:
The render loop starts throwing exceptions but keeps firing. I believe this affects 3D scenes as well.
The text was updated successfully, but these errors were encountered: