How harshkapadia2/git-graph works
Git Graph is a browser-based visualizer for Commit, Tree, and Blob objects in a selected local .git directory. The main workflow reads branch information, parses objects for the chosen branch, formats them and their links, then renders an interactive graph. Users can switch branches, highlight commits and related objects, and inspect raw object contents. The graph follows documented capabilities and shown imports/calls; unsampled utility internals and any unshown wiring are not inferred.
Main entry points: App.jsx App orchestration · GraphArea.jsx Graph rendering · ObjectArea.jsx Object lanes · commonFns.js Git file access
Components 20
Repository workflow
- App orchestration
src/components/App/App.jsx
Git object parsing
- Branch discovery
src/util/generateBranchInfo.js - Object traversal
src/util/generateObjects.js - Git file access
src/util/commonFns.js - Object formatting
src/util/formatObjects.js - Connection generation
src/util/generateConnections.js - Raw object reader
src/util/objectRawData.js
Graph visualization
- Graph rendering
src/components/GraphArea/GraphArea.jsx - Object lanes
src/components/ObjectArea/ObjectArea.jsx - Git object view
src/components/GitObject/GitObject.jsx - Object ID helper
src/util/generateId.js - Highlight propagation
src/util/coloring.js
User interaction
- Branch selector
src/components/BranchSelector/BranchSelector.jsx - Commit selector
src/components/CommitSelector/CommitSelector.jsx - Raw data display
src/components/RawDataDisplay/RawDataDisplay.jsx
Status and display
- Usage introduction
src/components/IntroMsg/IntroMsg.jsx - Error messages
src/components/ErrorMsg/ErrorMsg.jsx - Loading indicator
src/components/Loader/Loader.jsx - Back to top
src/components/BackToTop/BackToTop.jsx
Other components
- Repository user
Connections 26
- Repository user → App orchestration: selects repository
src/components/App/App.jsx - App orchestration → Branch discovery: loads branches
src/components/App/App.jsx - App orchestration → Object traversal: parses branch
src/components/App/App.jsx - App orchestration → Object formatting: formats objects
src/components/App/App.jsx - App orchestration → Connection generation: builds links
src/components/App/App.jsx - App orchestration → Highlight propagation: updates highlights
src/components/App/App.jsx - App orchestration → Raw object reader: requests raw data
src/components/App/App.jsx - Object traversal → Git file access: reads Git objects
src/util/generateObjects.js - Branch discovery → Git file access: reads branch refs
src/util/generateBranchInfo.js - Raw object reader → Git file access: reads object data
src/util/objectRawData.js - App orchestration → Graph rendering: renders graph
src/components/App/App.jsx - Graph rendering → Object lanes: renders object lanes
src/components/GraphArea/GraphArea.jsx - Object lanes → Git object view: renders objects
src/components/ObjectArea/ObjectArea.jsx - Object lanes → Object ID helper: creates blob IDs
src/components/ObjectArea/ObjectArea.jsx - Highlight propagation → Object ID helper: matches blob IDs
src/util/coloring.js - Graph rendering → App orchestration: sends raw selection
src/components/GraphArea/GraphArea.jsx - Git object view → App orchestration: reports raw selection
src/components/GitObject/GitObject.jsx - App orchestration → Branch selector: renders selector
src/components/App/App.jsx - Branch selector → App orchestration: chooses branch
src/components/App/App.jsx - App orchestration → Commit selector: renders selector
src/components/App/App.jsx - Commit selector → App orchestration: submits commits
src/components/CommitSelector/CommitSelector.jsx - App orchestration → Raw data display: renders raw data
src/components/App/App.jsx - App orchestration → Usage introduction: renders introduction
src/components/App/App.jsx - App orchestration → Error messages: renders errors
src/components/App/App.jsx - App orchestration → Loading indicator: renders loading state
src/components/App/App.jsx - App orchestration → Back to top: renders control
src/components/App/App.jsx