How white66-7/graph-fluid-spring works
Graph Inertia is a Logseq plugin that replaces the built-in graph view with a continuously simulated Canvas2D knowledge graph. The principal workflow fetches graph data, builds simulation state, and runs physics, timeline effects, and rendering; pointer interaction and camera controls operate on the live view. The README documents additional product capabilities such as momentum dragging, node birth effects, time travel, and native-graph fallback. Some wiring is visible only in excerpts or README documentation, so unsampled connections are omitted rather than inferred.
Main entry points: main.js Runtime orchestrator · index.js Plugin entry · warm.js Layout prewarmer · physics.js Force simulation
Components 18
Host integration
- Logseq host
- Logseq DB
- Plugin entry
index.js - Settings and language
src/i18n.js
Graph runtime
- Graph data source
src/datasource.js - Graph data model
src/data.js - Runtime orchestrator
src/main.js - Layout prewarmer
src/warm.js
Simulation and effects
- Force simulation
src/physics.js - Spatial grid
src/spatial.js - Birth effects
src/effects.js - Time-travel timeline
src/timeline.js
View and controls
- Canvas overlay
src/overlay.js - Canvas2D renderer
src/renderer.js - Camera
src/camera.js - Pointer interaction
src/interaction.js - Graph toolbar
src/toolbar.js
Other components
- User
Connections 27
- User → Logseq host: opens graph
README.md - Logseq host → Plugin entry: loads plugin
README.md - Plugin entry → Logseq DB: queries graph
index.js - Plugin entry → Graph data source: fetches data
index.js - Graph data source → Logseq DB: reads graph
README.md - Plugin entry → Runtime orchestrator: mounts runtime
index.js - Plugin entry → Settings and language: syncs settings
index.js - Runtime orchestrator → Graph data model: builds model
src/main.js - Runtime orchestrator → Force simulation: creates simulation
src/main.js - Runtime orchestrator → Birth effects: creates effects
src/main.js - Runtime orchestrator → Canvas2D renderer: creates renderer
src/main.js - Runtime orchestrator → Layout prewarmer: prewarms layout
src/warm.js - Layout prewarmer → Graph data source: fetches data
src/warm.js - Layout prewarmer → Graph data model: builds model
src/warm.js - Layout prewarmer → Force simulation: settles layout
src/warm.js - Force simulation → Spatial grid: uses grid
README.md - Runtime orchestrator → Time-travel timeline: updates timeline
README.md - Runtime orchestrator → Canvas overlay: mounts canvas
src/main.js - Runtime orchestrator → Camera: fits view
src/main.js - Runtime orchestrator → Pointer interaction: updates runtime
src/main.js - Runtime orchestrator → Graph toolbar: shows controls
src/main.js - Runtime orchestrator → Canvas2D renderer: sets grid
src/main.js - User → Pointer interaction: drags nodes
README.md - Pointer interaction → Force simulation: pins nodes
- User → Time-travel timeline: plays time travel
README.md - User → Graph toolbar: uses controls
- Canvas2D renderer → Canvas overlay: draws canvas