Skip to content

fix(knowledge-graph): resize KnowledgeGraph3D canvas when container dimensions change#3411

Merged
mrveiss merged 2 commits intoDev_new_guifrom
issue-3370
Apr 3, 2026
Merged

fix(knowledge-graph): resize KnowledgeGraph3D canvas when container dimensions change#3411
mrveiss merged 2 commits intoDev_new_guifrom
issue-3370

Conversation

@mrveiss
Copy link
Copy Markdown
Owner

@mrveiss mrveiss commented Apr 3, 2026

Closes #3370

🤖 Generated with Claude Code

mrveiss and others added 2 commits April 3, 2026 23:25
…ons change (#3370)

Add a ResizeObserver in initGraph() that calls graph.value.width(w).height(h)
whenever the container's contentRect changes (entity details panel, window resize,
sidebar collapse). Disconnect it at the top of disposeGraph() to prevent stale
callbacks after teardown.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 3, 2026

✅ SSOT Configuration Compliance: Passing

🎉 No hardcoded values detected that have SSOT config equivalents!

@mrveiss mrveiss merged commit 715452b into Dev_new_gui Apr 3, 2026
2 of 3 checks passed
@mrveiss mrveiss deleted the issue-3370 branch April 3, 2026 20:36
@mrveiss
Copy link
Copy Markdown
Owner Author

mrveiss commented Apr 3, 2026

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

Verified:

  • graph.value is a ForceGraph3DInstance from 3d-force-graph.width()/.height() are the correct fluent setters for this library (not a Cytoscape API mismatch)
  • container.value is null-guarded at the top of initGraph() before resizeObserver.observe(container.value) is reached
  • Cleanup in disposeGraph() correctly disconnects and nulls resizeObserver before tearing down the Three.js graph, preventing stale callbacks
  • entries[0]?.contentRect safe access and if (graph.value && rect) guard in the callback are both correct

🤖 Generated with Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant