()
| 524 | } |
| 525 | |
| 526 | destroy(): void { |
| 527 | this.destroyed = true; |
| 528 | this.cancelAnimation?.(); |
| 529 | if (this.interactionResumeTimer !== null) { |
| 530 | clearTimeout(this.interactionResumeTimer); |
| 531 | this.interactionResumeTimer = null; |
| 532 | } |
| 533 | if (this.labelCullDebounceTimer !== null) { |
| 534 | clearTimeout(this.labelCullDebounceTimer); |
| 535 | this.labelCullDebounceTimer = null; |
| 536 | } |
| 537 | this.autoFitTarget = null; |
| 538 | this.interactionAbort?.abort(); |
| 539 | this.interactionAbort = null; |
| 540 | clearTextureCache(this.textureCache); |
| 541 | for (const ping of this.pingNodes.values()) ping.glow.destroy(); |
| 542 | this.pingNodes.clear(); |
| 543 | // Pixi's app.destroy({children:true}) recursively destroys all |
| 544 | // labels — just drop our refs. |
| 545 | this.communityLabels.clear(); |
| 546 | this.communityAssignments = null; |
| 547 | this.communityNames = null; |
| 548 | this.nodes.clear(); |
| 549 | this.nodeArray = []; |
| 550 | this.nodeIdToIndex.clear(); |
| 551 | this.edges = []; |
| 552 | this.edgeIndex.clear(); |
| 553 | this.edgeColorGroups.clear(); |
| 554 | if (this.app) { |
| 555 | try { |
| 556 | this.app.destroy( |
| 557 | { removeView: true }, |
| 558 | { children: true, texture: true }, |
| 559 | ); |
| 560 | } catch { |
| 561 | // Fallback for different Pixi versions |
| 562 | try { |
| 563 | this.app.destroy(true, { children: true }); |
| 564 | } catch { |
| 565 | /* ignore */ |
| 566 | } |
| 567 | } |
| 568 | } |
| 569 | this.app = null; |
| 570 | this.world = null; |
| 571 | } |
| 572 | |
| 573 | // ─── Data ───────────────────────────────────────────────────────── |
| 574 |
no test coverage detected