Add `destroy()` method
destroy()
will remove the calendar from the DOM.
It can also takes a function as argument, that will be executed when the calendar is removed, at the end of the animation.
destroy()
always returns null
, so remember to assign it to your calendar instance, to also free the memory.
var cal = new CalHeatMap();
cal.init({}); // Creating the calendar
cal = cal.destroy(); // Remove the calendar from the DOM, and assign the 'cal' variable to `null`, avoiding memory leak