mauriciopoppe / function-plot

A 2d function plotter for the web
https://mauriciopoppe.github.io/function-plot/
MIT License
914 stars 112 forks source link

Feature: destroy API to remove the graph and all associated events. #265

Closed mauriciopoppe closed 6 months ago

mauriciopoppe commented 6 months ago

Add a new API method to destroy the graph contents and the associated event listeners.

const instance = functionPlot({ ... })
instance.destroy()

Fixes: https://github.com/mauriciopoppe/function-plot/issues/262