gpui-graph
Force-directed network graph component for GPUI, built on gpui-base. Made for graph query and exploration tools.
- d3-force style layout (Barnes–Hut many-body, collision, link, gravity, community clustering)
- Pan, zoom, drag, hover focus, node / edge selection, parallel edges, self-loops, arrows, labels
- Incremental
mergefor "expand neighbors",remove_nodes, pinning - Communities from your data (
Node::group): hulls, color by group, collapse into super nodes - Keyboard operable (arrow-key selection, Enter, Shift-F10, Esc, zoom / fit), focus-visible rings
- Follows the gpui-base theme tokens and honors reduced motion
Usage
[]
= "0.1"
= "=0.8.0"
= { = "gpui-pre", = "=0.3.9" } # must match gpui-base
use ;
// once at startup
init;
init; // key bindings
let graph = cx.new;
let subscription = cx.subscribe;
// Store `subscription` in the owning view to keep it active.
// the graph fills its parent, so give the parent a size
div.flex_1.child
See the repository for the full API
overview and the query-app example.
License
Licensed under the Apache License, Version 2.0.