Skip to main content

Module graph

Module graph 

Source
Expand description

Graph visualization endpoints for React Flow UI integration.

These endpoints expose the entity graph structure (nodes and edges) in formats optimized for graph visualization libraries like React Flow.

§Endpoints

RouteMethodDescription
/api/graph/flowPOSTFull graph as nodes + edges for React Flow
/api/graph/edgesPOSTAll ref relationships as explicit edges
/api/graph/treePOSTRecursive subtree from a root entity
/api/graph/neighborsPOSTN-hop neighborhood around an entity
/api/graph/pathPOSTShortest path between two entities
/api/graph/statsGETGraph metrics and statistics

§React Flow Data Model

React Flow expects two arrays: nodes and edges.

  • Node: { id, type, data, position: { x, y }, parentId? }
  • Edge: { id, source, target, label, type }

The graph/flow endpoint returns two grids: a nodes grid and an edges grid (edges encoded in the response grid’s metadata under edgesGrid). When Accept: application/json is used, it returns the native React Flow JSON structure instead.

Functions§

handle_edges
Returns all ref relationships as explicit edge rows.
handle_flow
Returns the entity graph formatted for React Flow consumption.
handle_neighbors
Returns N-hop neighborhood around an entity.
handle_path
Finds the shortest path between two entities.
handle_stats
Returns graph statistics and metrics.
handle_tree
Returns a hierarchical subtree from a root entity.