Web UI Guide

InputLayer includes a browser-based GUI for exploring knowledge graphs, writing queries, and visualizing data as interactive graphs.

Starting the GUI

The GUI is built as a static export and served directly by the InputLayer server.

# Build the GUI and start the server
make run

# Or build separately:
make gui-build                     # builds gui/dist/
cargo run --bin inputlayer-server  # serves GUI at http://localhost:8080/

For development with hot-reload, run the GUI dev server separately:

cargo run --bin inputlayer-server  # backend on :8080
cd gui && npm run dev              # GUI dev server on :3000

Select a knowledge graph from the header dropdown to begin.


Pages Overview

PageDescription
QueryWrite and execute Datalog queries with autocomplete
RelationsBrowse base relations and derived views with data tables and graphs
KG GraphInteractive knowledge graph visualization
DatabaseServer status, knowledge graph management
DocsBuilt-in documentation browser

Query Editor

The query editor supports multi-line Datalog with syntax-aware autocomplete.

Autocomplete

ShortcutAction
Cmd+J (Mac) / Ctrl+SpaceShow completions at cursor
Cmd+Shift+J (Mac) / Ctrl+Shift+SpaceShow all completions (including on empty editor)

Completions include relation names, view names, and Datalog keywords.

Query Results

Results display in a table by default. For queries with 2+ columns, a Graph tab renders the result as a node-edge graph:

  • Arity 2: col[0]col[1] (source → target)
  • Arity 3: col[0]col[2], with col[1] as edge label (subject-predicate-object)
  • Arity 4+: col[0]col[last], middle columns joined as edge label

Relations & Views

The Relations page shows all base relations and derived views in a sidebar tree.

Base relations open a detail panel with:

  • Data tab - Paginated data table
  • Graph tab - Data visualized as a node-edge graph (arity 2+)

Derived views open a detail panel with:

  • Data tab - Paginated data table
  • Dependency Graph tab - Shows rule dependencies between views and relations
  • Data Graph tab - Data visualized as a node-edge graph (arity 2+)
  • Performance tab - Execution statistics

Right-click any relation badge to navigate to KG Graph or the Relations page.


KG Graph

The KG Graph page provides a full-featured interactive graph visualization for exploring knowledge graph data.

Selecting Relations

Use the sidebar to select which relations and views to visualize:

  • Click individual relations to toggle them on/off
  • Select All / Deselect All for bulk control
  • Loading indicators show while data is fetched
  • Unary relations (arity 1) appear as standalone nodes
  • Binary+ relations appear as directed edges

Layout Engines

14 layout algorithms are available from the dropdown:

LayoutTypeBest For
ColaForce-directedGeneral purpose, default
fCoSECompound forceFast, large graphs
CoSE BilkentCompound forceClustered data
EulerSpring-electricOrganic layouts
SpreadForce-directedEven spacing
D3 ForceForce simulationPhysics-based
DagreLayered/hierarchicalDAGs, trees
ELKLayered/hierarchicalComplex hierarchies
CoSEPhysicsSmall-medium graphs
AVSDFCircularCircular arrangements
CircleGeometricSimple ring
ConcentricGeometricDegree-based rings
BreadthfirstTreeTree structures
GridGeometricUniform placement

When compound grouping is active, only compound-compatible layouts are shown (Cola, fCoSE, CoSE Bilkent, ELK, Dagre).

Toolbar Controls

The toolbar at the top-left provides:

ControlDescription
Layout dropdownSwitch between layout algorithms
Focus toggleWhen on, clicking a node fades unrelated elements
Edge labelsToggle edge label visibility
GroupGroup nodes by relation into compound boundaries (visible with 2+ relations)
SearchFind nodes by label (Cmd/Ctrl+F)
ExportDownload graph as PNG (2x) or SVG
MinimapToggle bird's-eye overview with draggable viewport
FullscreenEnter native fullscreen mode

Node Interaction

Click a node to see its detail panel showing:

  • Node label and degree (connection count)
  • Relations it belongs to (as badges)
  • Connected neighbors with direction arrows

Right-click a relation badge in the node detail for:

  • Open in KG Graph -Navigate to KG Graph filtered to that relation
  • Filter to -Show only that relation (when on KG Graph page)
  • Open in Relations -Navigate to the Relations page

Compound Nodes (Grouping)

When 2+ relations are selected, the Group button clusters nodes into compound boundaries by their primary relation:

  • Each relation gets a labeled dashed boundary
  • Nodes are colored by relation (aquamarine → violet → magenta gradient)
  • Edges cross boundaries as needed
  • Layout automatically switches to a compound-compatible engine

Minimap

The minimap shows a bird's-eye thumbnail of the entire graph:

  • Click anywhere on the minimap to center the main view on that point
  • Drag on the minimap to pan the main view in real-time
  • The teal viewport rectangle shows your current view area
  • Updates live as you pan and zoom

Color Legend

When multiple relations are active, a legend appears at the bottom-left:

  • Node colors (circles) -Identify which relation a node belongs to
  • Edge colors (lines) -Identify edge types

Keyboard Shortcuts

ShortcutAction
Cmd/Ctrl+FOpen node search
Enter / Shift+EnterNext / previous search match
EscapeClose search

Graph Limits

For performance, graphs are capped at:

  • 1,000 nodes -Highest-degree nodes are kept
  • 5,000 edges -Truncation indicator shown in sidebar stats

Cross-Navigation

The GUI supports seamless navigation between pages:

  • Relations sidebar -Right-click any relation or view → "Open in KG Graph"
  • Node detail badges -Right-click → navigate to KG Graph or Relations
  • URL parameters -Direct links with ?select=relation_name for both KG Graph and Relations pages