Basic Graph Render
The smallest useful InferaGraph: build a StaticDataAdapter
from in-memory nodes and edges,
then drop the <InferaGraph /> component (or the vanilla
constructor) into a container. No server, no provider, no extra config — the defaults render
a force-directed 3D layout you can rotate and zoom.
Live output
All four nodes, force-directed graph layout. Drag to rotate, scroll to zoom.
Sample data
// nodes + edges — generic, not domain-specific
const nodes = [
{ id: 'a', attributes: { title: 'Alpha', category: 'foo' } },
{ id: 'b', attributes: { title: 'Bravo', category: 'foo' } },
{ id: 'c', attributes: { title: 'Charlie', category: 'bar' } },
{ id: 'd', attributes: { title: 'Delta', category: 'bar' } },
];
const edges = [
{ id: 'e1', source: 'a', target: 'b', type: 'connects_to' },
{ id: 'e2', source: 'b', target: 'c', type: 'connects_to' },
{ id: 'e3', source: 'c', target: 'd', type: 'connects_to' },
];Usage
import { StaticDataAdapter } from '@inferagraph/core/data';
import { GraphProvider, InferaGraph } from '@inferagraph/core/react';
const adapter = new StaticDataAdapter({ nodes, edges });
export function App() {
return (
<GraphProvider adapter={adapter}>
<InferaGraph />
</GraphProvider>
);
}