Skip to content

ForceGraph 0.3.0 — Live simulation and node dragging

Latest

Choose a tag to compare

@ianleon ianleon released this 27 Oct 03:14
· 2 commits to main since this release

ForceGraph 0.3.0 adds a live simulation and node dragging to the native SwiftUI graph view.

ForceGraphView(nodes: notes, edges: links) { open($0) }
    .simulation(ObsidianGraphForces.defaults.configuration)
    .nodeLabel { $0.title }
  • Grab a node and move it while connected nodes respond; release to let the graph settle.
  • Drag empty space to pan, pinch to zoom and double-tap to fit.
  • Preserve the pointer's grab offset; recover from interrupted gestures and respect Reduce Motion.
  • The view stops requesting animation frames after settling and wakes when input changes.
  • Use the Foundation-only ForceSimulation directly for pinning, graph updates, hit testing and custom renderers.
  • Barnes–Hut repulsion supports larger graphs; settings include link, collision, centering and cooling forces.
  • Existing view calls retain the fixed layout until .simulation(...) is added.
  • Run Examples/LiveGraph for a native macOS demo using the public view.

Validated locally: 79 tests, 100% executable-line coverage for the live engine/configuration/quadtree/controller and Obsidian force mapping; release performance tests at 1,000 and 5,000 nodes; warnings-as-errors; iOS, macOS, visionOS, tvOS and watchOS builds; DocC. Rendering and gesture appearance are outside these unit-coverage figures. The SwiftUI view is available on iOS/macOS/visionOS; the core engine also supports tvOS/watchOS.

No external dependencies or hosted CI were added. Full Obsidian graph-settings parity is outside this release.