JunoLab / atom-ink

IDE toolkit for Atom
MIT License
228 stars 40 forks source link

add a "forget all plots" button in the plot pane #167

Closed viryfred closed 5 years ago

viryfred commented 5 years ago

Hi,

I added a button "forget all plots" in the plot pane: forget_all_plots

I am far far away to be an expert of JS (first JS code), but here are the intended behavior: decrease the memory consumption (e.g. when performing live plotting).

Thank you in advance to take this feature into account.

pfitzseb commented 5 years ago

Thanks for the contribution!

I'd prefer a solution that doesn't try to update the DOM that often -- you should be able to teardown all items and then just empty this.items and this.ids and then this.activateItem(0) or something like that.

If you want to implement it in that way I'll hold off on merging, otherwise I can just merge and make the change myself -- up to you :)

Oh, and it would be cool if we could find another icon for this button.

viryfred commented 5 years ago

Thanks for your quick answer!

I prefer you merge and make the change, I never programmed in Javascript (that's why I tried the straightforward solution for me), even if I understand the idea behind your solution for performance.

Concerning the icon, where are stored the resources? In which format? I have two propositions:

pfitzseb commented 5 years ago

There are a couple of built-in icons that you can see in the "Styleguide" (just type that into the command paletter).

I've gone with this for now: image

Thanks again for the PR, this was definitely a necessary feature! :)