MCPcopy
hub / github.com/toorshia/justgage / destroy

Method destroy

src/core/JustGage.js:1186–1208  ·  view source on GitHub ↗

* Destroy the gauge and clean up resources

()

Source from the content-addressed store, hash-verified

1184 * Destroy the gauge and clean up resources
1185 */
1186 destroy() {
1187 // Cancel any running animations
1188 if (this.animator) {
1189 this.animator.cancel();
1190 }
1191
1192 // Clean up SVG renderer
1193 if (this.renderer) {
1194 this.renderer.remove();
1195 }
1196
1197 // Clear container
1198 if (this.node?.parentNode) {
1199 this.node.innerHTML = '';
1200 }
1201
1202 // Clear references
1203 this.node = null;
1204 this.config = null;
1205 this.renderer = null;
1206 this.animator = null;
1207 this.canvas = null;
1208 }
1209
1210 /**
1211 * Get current gauge value

Callers 4

core.test.jsFile · 0.80

Calls 2

cancelMethod · 0.80
removeMethod · 0.45

Tested by

no test coverage detected