feat: add codegraph view — interactive zoomable HTML graph#1198
Open
rohitagr0310 wants to merge 4 commits into
Open
feat: add codegraph view — interactive zoomable HTML graph#1198rohitagr0310 wants to merge 4 commits into
codegraph view — interactive zoomable HTML graph#1198rohitagr0310 wants to merge 4 commits into
Conversation
Renders the index as a zoomable, searchable HTML graph (nodes colored by kind, sized by degree). vis-network is bundled and inlined so the page works fully offline — no CDN — matching CodeGraph's local-first design. `--open` serves it on a loopback port and opens the browser. Data assembly lives in src/graph/viewer.ts and is exposed via a narrow typed CodeGraph.getGraphView(), keeping the raw SQLite handle private. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Write codegraph_view.html inside the project's .codegraph/ directory by default instead of the current working directory. That dir is already gitignored, so a `view` never litters the working tree. An explicit -o is still honored, resolved against the cwd. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
`codegraph view` now opens the graph in the browser immediately without requiring an extra flag. Use `--no-open` to write the HTML file only. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Author
ScreenshotsWhole-graph view —
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Closes #1197
What this adds
A
codegraph viewcommand that renders the indexed graph as a single self-contained HTML file and opens it in your browser automatically.Design decisions
codegraph viewstarts a loopback-only HTTP server and opens the browser immediately;--no-openwrites the file only<project>/.codegraph/codegraph_view.html(already gitignored)assets/vis-network.min.js, copied todist/bycopy-assetsCodeGraph.getGraphView()wraps data assembly; raw DB handle stays privateFiles changed
src/graph/viewer.tsrenderViewerHtml,EmptyGraphViewErrorsrc/bin/codegraph.tsviewsubcommandsrc/index.tsgetGraphView()public methodassets/vis-network.min.js__tests__/cli-view-command.test.tsREADME.mdcodegraph view