Skip to content
OpenChart

Graph

Draw a network of nodes and edges with a force layout, then encode size, color and labels and mark a seed node.

A graph draws a network: the things in it as nodes and the connections between them as edges. A force layout pulls connected nodes together and pushes the rest apart, so clusters, bridges and hubs show up without anyone placing them. Use it when the reader needs the shape of the connections.

When the connections carry amounts that flow from stage to stage, a sankey shows them better. When the reader needs exact values for each node, put them in a data table.

A basic graph

Set type to "graph", list the nodes (each with an id) and the edges (each with a source and a target id). layout.type: "force" is the default layout, chargeStrength sets how hard nodes repel each other and linkDistance sets the distance an edge pulls toward. layout.seed makes the layout repeatable: the same spec and seed settle into the same shape.

A code-review network. This chart is drawn in the browser.

A code-review network. Source: Illustrative data.
{
  "type": "graph",
  "nodes": [
    {
      "id": "Ava",
      "label": "Ava",
      "team": "Platform"
    },
    {
      "id": "Liam",
      "label": "Liam",
      "team": "Platform"
    },
    {
      "id": "Mia",
      "label": "Mia",
      "team": "Platform"
    },
    {
      "id": "Noah",
      "label": "Noah",
      "team": "Platform"
    },
    {
      "id": "Zoe",
      "label": "Zoe",
      "team": "Web"
    },
    {
      "id": "Ethan",
      "label": "Ethan",
      "team": "Web"
    },
    {
      "id": "Chloe",
      "label": "Chloe",
      "team": "Web"
    },
    {
      "id": "Leo",
      "label": "Leo",
      "team": "Web"
    },
    {
      "id": "Isla",
      "label": "Isla",
      "team": "Data"
    },
    {
      "id": "Owen",
      "label": "Owen",
      "team": "Data"
    },
    {
      "id": "Nora",
      "label": "Nora",
      "team": "Data"
    },
    {
      "id": "Kai",
      "label": "Kai",
      "team": "Data"
    }
  ],
  "edges": [
    {
      "source": "Ava",
      "target": "Liam"
    },
    {
      "source": "Liam",
      "target": "Mia"
    },
    {
      "source": "Mia",
      "target": "Ava"
    },
    {
      "source": "Noah",
      "target": "Ava"
    },
    {
      "source": "Noah",
      "target": "Liam"
    },
    {
      "source": "Zoe",
      "target": "Ethan"
    },
    // … 14 more edges; Copy includes them
  ],
  "encoding": {
    "nodeLabel": {
      "field": "label"
    }
  },
  "layout": {
    "type": "force",
    "chargeStrength": -120,
    "linkDistance": 40,
    "seed": 7
  },
  "chrome": {
    "title": "Twelve engineers and who reviewed whose code",
    "subtitle": "An edge means one engineer reviewed the other's pull request"
  }
}
import { Graph } from "@opendata-ai/openchart-react";
import type { GraphSpec } from "@opendata-ai/openchart-core";
import "@opendata-ai/openchart-core/styles.css";

const spec: GraphSpec = {
  "type": "graph",
  "nodes": [/* 12 nodes, as in the Spec tab; Copy includes them */],
  "edges": [/* 20 edges; Copy includes them */],
  "encoding": {
    "nodeLabel": {
      "field": "label"
    }
  },
  "layout": {
    "type": "force",
    "chargeStrength": -120,
    "linkDistance": 40,
    "seed": 7
  },
  "chrome": {
    "title": "Twelve engineers and who reviewed whose code",
    "subtitle": "An edge means one engineer reviewed the other's pull request"
  }
};

export function Example() {
  return <Graph spec={spec} />;
}
<script setup lang="ts">
import { Graph } from "@opendata-ai/openchart-vue";
import type { GraphSpec } from "@opendata-ai/openchart-core";
import "@opendata-ai/openchart-core/styles.css";

const spec: GraphSpec = {
  "type": "graph",
  "nodes": [/* 12 nodes, as in the Spec tab; Copy includes them */],
  "edges": [/* 20 edges; Copy includes them */],
  "encoding": {
    "nodeLabel": {
      "field": "label"
    }
  },
  "layout": {
    "type": "force",
    "chargeStrength": -120,
    "linkDistance": 40,
    "seed": 7
  },
  "chrome": {
    "title": "Twelve engineers and who reviewed whose code",
    "subtitle": "An edge means one engineer reviewed the other's pull request"
  }
};
</script>

<template>
  <Graph :spec="spec" />
</template>
<script lang="ts">
import { Graph } from "@opendata-ai/openchart-svelte";
import type { GraphSpec } from "@opendata-ai/openchart-core";
import "@opendata-ai/openchart-core/styles.css";

const spec: GraphSpec = {
  "type": "graph",
  "nodes": [/* 12 nodes, as in the Spec tab; Copy includes them */],
  "edges": [/* 20 edges; Copy includes them */],
  "encoding": {
    "nodeLabel": {
      "field": "label"
    }
  },
  "layout": {
    "type": "force",
    "chargeStrength": -120,
    "linkDistance": 40,
    "seed": 7
  },
  "chrome": {
    "title": "Twelve engineers and who reviewed whose code",
    "subtitle": "An edge means one engineer reviewed the other's pull request"
  }
};
</script>

<Graph {spec} />
import { createGraph } from "@opendata-ai/openchart-vanilla";
import type { GraphSpec } from "@opendata-ai/openchart-core";
import "@opendata-ai/openchart-core/styles.css";

const spec: GraphSpec = {
  "type": "graph",
  "nodes": [/* 12 nodes, as in the Spec tab; Copy includes them */],
  "edges": [/* 20 edges; Copy includes them */],
  "encoding": {
    "nodeLabel": {
      "field": "label"
    }
  },
  "layout": {
    "type": "force",
    "chargeStrength": -120,
    "linkDistance": 40,
    "seed": 7
  },
  "chrome": {
    "title": "Twelve engineers and who reviewed whose code",
    "subtitle": "An edge means one engineer reviewed the other's pull request"
  }
};

const container = document.getElementById("chart");
if (!container) throw new Error('Add <div id="chart"></div> to the page first.');
createGraph(container, spec);

Graphs draw on a canvas once the page’s script runs, so the figure reserves its height until then. Drag a node to move it; it rejoins the layout when you let go. Scroll or pinch to zoom, and drag the background to pan.

Clusters

layout.clustering names a field, and the layout pulls nodes with the same value together. Here the field is each engineer’s team, and nodeColor on the same field colors the teams. The legend is interactive by default: clicking a team isolates it, and each entry shows how many nodes it has.

The code-review network grouped by team. This chart is drawn in the browser.

The code-review network grouped by team. Source: Illustrative data.
{
  "type": "graph",
  "nodes": [
    {
      "id": "Ava",
      "label": "Ava",
      "team": "Platform"
    },
    {
      "id": "Liam",
      "label": "Liam",
      "team": "Platform"
    },
    {
      "id": "Mia",
      "label": "Mia",
      "team": "Platform"
    },
    {
      "id": "Noah",
      "label": "Noah",
      "team": "Platform"
    },
    {
      "id": "Zoe",
      "label": "Zoe",
      "team": "Web"
    },
    {
      "id": "Ethan",
      "label": "Ethan",
      "team": "Web"
    },
    {
      "id": "Chloe",
      "label": "Chloe",
      "team": "Web"
    },
    {
      "id": "Leo",
      "label": "Leo",
      "team": "Web"
    },
    {
      "id": "Isla",
      "label": "Isla",
      "team": "Data"
    },
    {
      "id": "Owen",
      "label": "Owen",
      "team": "Data"
    },
    {
      "id": "Nora",
      "label": "Nora",
      "team": "Data"
    },
    {
      "id": "Kai",
      "label": "Kai",
      "team": "Data"
    }
  ],
  "edges": [
    {
      "source": "Ava",
      "target": "Liam"
    },
    {
      "source": "Liam",
      "target": "Mia"
    },
    {
      "source": "Mia",
      "target": "Ava"
    },
    {
      "source": "Noah",
      "target": "Ava"
    },
    {
      "source": "Noah",
      "target": "Liam"
    },
    {
      "source": "Zoe",
      "target": "Ethan"
    },
    // … 14 more edges; Copy includes them
  ],
  "encoding": {
    "nodeColor": {
      "field": "team",
      "type": "nominal"
    },
    "nodeLabel": {
      "field": "label"
    }
  },
  "layout": {
    "type": "force",
    "clustering": {
      "field": "team"
    },
    "chargeStrength": -120,
    "linkDistance": 40,
    "seed": 7
  },
  "chrome": {
    "title": "Three teams of four, linked by five cross-team reviews",
    "subtitle": "Colored and clustered by team"
  }
}
import { Graph } from "@opendata-ai/openchart-react";
import type { GraphSpec } from "@opendata-ai/openchart-core";
import "@opendata-ai/openchart-core/styles.css";

const spec: GraphSpec = {
  "type": "graph",
  "nodes": [/* 12 nodes, as in the Spec tab; Copy includes them */],
  "edges": [/* 20 edges; Copy includes them */],
  "encoding": {
    "nodeColor": {
      "field": "team",
      "type": "nominal"
    },
    "nodeLabel": {
      "field": "label"
    }
  },
  "layout": {
    "type": "force",
    "clustering": {
      "field": "team"
    },
    "chargeStrength": -120,
    "linkDistance": 40,
    "seed": 7
  },
  "chrome": {
    "title": "Three teams of four, linked by five cross-team reviews",
    "subtitle": "Colored and clustered by team"
  }
};

export function Example() {
  return <Graph spec={spec} />;
}
<script setup lang="ts">
import { Graph } from "@opendata-ai/openchart-vue";
import type { GraphSpec } from "@opendata-ai/openchart-core";
import "@opendata-ai/openchart-core/styles.css";

const spec: GraphSpec = {
  "type": "graph",
  "nodes": [/* 12 nodes, as in the Spec tab; Copy includes them */],
  "edges": [/* 20 edges; Copy includes them */],
  "encoding": {
    "nodeColor": {
      "field": "team",
      "type": "nominal"
    },
    "nodeLabel": {
      "field": "label"
    }
  },
  "layout": {
    "type": "force",
    "clustering": {
      "field": "team"
    },
    "chargeStrength": -120,
    "linkDistance": 40,
    "seed": 7
  },
  "chrome": {
    "title": "Three teams of four, linked by five cross-team reviews",
    "subtitle": "Colored and clustered by team"
  }
};
</script>

<template>
  <Graph :spec="spec" />
</template>
<script lang="ts">
import { Graph } from "@opendata-ai/openchart-svelte";
import type { GraphSpec } from "@opendata-ai/openchart-core";
import "@opendata-ai/openchart-core/styles.css";

const spec: GraphSpec = {
  "type": "graph",
  "nodes": [/* 12 nodes, as in the Spec tab; Copy includes them */],
  "edges": [/* 20 edges; Copy includes them */],
  "encoding": {
    "nodeColor": {
      "field": "team",
      "type": "nominal"
    },
    "nodeLabel": {
      "field": "label"
    }
  },
  "layout": {
    "type": "force",
    "clustering": {
      "field": "team"
    },
    "chargeStrength": -120,
    "linkDistance": 40,
    "seed": 7
  },
  "chrome": {
    "title": "Three teams of four, linked by five cross-team reviews",
    "subtitle": "Colored and clustered by team"
  }
};
</script>

<Graph {spec} />
import { createGraph } from "@opendata-ai/openchart-vanilla";
import type { GraphSpec } from "@opendata-ai/openchart-core";
import "@opendata-ai/openchart-core/styles.css";

const spec: GraphSpec = {
  "type": "graph",
  "nodes": [/* 12 nodes, as in the Spec tab; Copy includes them */],
  "edges": [/* 20 edges; Copy includes them */],
  "encoding": {
    "nodeColor": {
      "field": "team",
      "type": "nominal"
    },
    "nodeLabel": {
      "field": "label"
    }
  },
  "layout": {
    "type": "force",
    "clustering": {
      "field": "team"
    },
    "chargeStrength": -120,
    "linkDistance": 40,
    "seed": 7
  },
  "chrome": {
    "title": "Three teams of four, linked by five cross-team reviews",
    "subtitle": "Colored and clustered by team"
  }
};

const container = document.getElementById("chart");
if (!container) throw new Error('Add <div id="chart"></div> to the page first.');
createGraph(container, spec);

Encoding size, color and edge width

The encoding channels map node and edge fields to marks. nodeSize sets the radius from a number (3 to 12 pixels by default), nodeColor the fill, and edgeWidth the stroke width from 0.5 to 4 pixels. nodeLabel names the field the labels show. Labels run on a budget: the graph draws the labels that fit at the current zoom, best-connected nodes first, so more appear as you zoom in.

A research knowledge graph. This chart is drawn in the browser.

A research knowledge graph. Source: Illustrative data.
{
  "type": "graph",
  "nodes": [
    {
      "id": "lab-vision",
      "label": "Vision Lab",
      "citations": 92,
      "kind": "Lab"
    },
    {
      "id": "lab-language",
      "label": "Language Lab",
      "citations": 88,
      "kind": "Lab"
    },
    {
      "id": "lab-robotics",
      "label": "Robotics Lab",
      "citations": 61,
      "kind": "Lab"
    },
    {
      "id": "p-chen",
      "label": "Wei Chen",
      "citations": 74,
      "kind": "Researcher"
    },
    {
      "id": "p-okafor",
      "label": "Ada Okafor",
      "citations": 68,
      "kind": "Researcher"
    },
    {
      "id": "p-silva",
      "label": "Marco Silva",
      "citations": 55,
      "kind": "Researcher"
    },
    // … 15 more nodes; Copy includes them
  ],
  "edges": [
    {
      "source": "p-chen",
      "target": "lab-vision",
      "confidence": 0.98
    },
    {
      "source": "p-okafor",
      "target": "lab-language",
      "confidence": 0.96
    },
    {
      "source": "p-silva",
      "target": "lab-robotics",
      "confidence": 0.95
    },
    {
      "source": "p-hoffman",
      "target": "lab-vision",
      "confidence": 0.93
    },
    {
      "source": "p-nakamura",
      "target": "lab-language",
      "confidence": 0.91
    },
    {
      "source": "p-bello",
      "target": "lab-robotics",
      "confidence": 0.88
    },
    // … 26 more edges; Copy includes them
  ],
  "encoding": {
    "nodeSize": {
      "field": "citations"
    },
    "nodeColor": {
      "field": "kind"
    },
    "nodeLabel": {
      "field": "label"
    },
    "edgeWidth": {
      "field": "confidence"
    }
  },
  "layout": {
    "type": "force",
    "chargeStrength": -150,
    "linkDistance": 35,
    "seed": 3
  },
  "chrome": {
    "title": "Labs fund projects, and projects use datasets",
    "subtitle": "Size is citations, color is the kind of entity, edge width is link confidence"
  }
}
import { Graph } from "@opendata-ai/openchart-react";
import type { GraphSpec } from "@opendata-ai/openchart-core";
import "@opendata-ai/openchart-core/styles.css";

const spec: GraphSpec = {
  "type": "graph",
  "nodes": [/* 21 nodes; Copy includes them */],
  "edges": [/* 32 edges; Copy includes them */],
  "encoding": {
    "nodeSize": {
      "field": "citations"
    },
    "nodeColor": {
      "field": "kind"
    },
    "nodeLabel": {
      "field": "label"
    },
    "edgeWidth": {
      "field": "confidence"
    }
  },
  "layout": {
    "type": "force",
    "chargeStrength": -150,
    "linkDistance": 35,
    "seed": 3
  },
  "chrome": {
    "title": "Labs fund projects, and projects use datasets",
    "subtitle": "Size is citations, color is the kind of entity, edge width is link confidence"
  }
};

export function Example() {
  return <Graph spec={spec} />;
}
<script setup lang="ts">
import { Graph } from "@opendata-ai/openchart-vue";
import type { GraphSpec } from "@opendata-ai/openchart-core";
import "@opendata-ai/openchart-core/styles.css";

const spec: GraphSpec = {
  "type": "graph",
  "nodes": [/* 21 nodes; Copy includes them */],
  "edges": [/* 32 edges; Copy includes them */],
  "encoding": {
    "nodeSize": {
      "field": "citations"
    },
    "nodeColor": {
      "field": "kind"
    },
    "nodeLabel": {
      "field": "label"
    },
    "edgeWidth": {
      "field": "confidence"
    }
  },
  "layout": {
    "type": "force",
    "chargeStrength": -150,
    "linkDistance": 35,
    "seed": 3
  },
  "chrome": {
    "title": "Labs fund projects, and projects use datasets",
    "subtitle": "Size is citations, color is the kind of entity, edge width is link confidence"
  }
};
</script>

<template>
  <Graph :spec="spec" />
</template>
<script lang="ts">
import { Graph } from "@opendata-ai/openchart-svelte";
import type { GraphSpec } from "@opendata-ai/openchart-core";
import "@opendata-ai/openchart-core/styles.css";

const spec: GraphSpec = {
  "type": "graph",
  "nodes": [/* 21 nodes; Copy includes them */],
  "edges": [/* 32 edges; Copy includes them */],
  "encoding": {
    "nodeSize": {
      "field": "citations"
    },
    "nodeColor": {
      "field": "kind"
    },
    "nodeLabel": {
      "field": "label"
    },
    "edgeWidth": {
      "field": "confidence"
    }
  },
  "layout": {
    "type": "force",
    "chargeStrength": -150,
    "linkDistance": 35,
    "seed": 3
  },
  "chrome": {
    "title": "Labs fund projects, and projects use datasets",
    "subtitle": "Size is citations, color is the kind of entity, edge width is link confidence"
  }
};
</script>

<Graph {spec} />
import { createGraph } from "@opendata-ai/openchart-vanilla";
import type { GraphSpec } from "@opendata-ai/openchart-core";
import "@opendata-ai/openchart-core/styles.css";

const spec: GraphSpec = {
  "type": "graph",
  "nodes": [/* 21 nodes; Copy includes them */],
  "edges": [/* 32 edges; Copy includes them */],
  "encoding": {
    "nodeSize": {
      "field": "citations"
    },
    "nodeColor": {
      "field": "kind"
    },
    "nodeLabel": {
      "field": "label"
    },
    "edgeWidth": {
      "field": "confidence"
    }
  },
  "layout": {
    "type": "force",
    "chargeStrength": -150,
    "linkDistance": 35,
    "seed": 3
  },
  "chrome": {
    "title": "Labs fund projects, and projects use datasets",
    "subtitle": "Size is citations, color is the kind of entity, edge width is link confidence"
  }
};

const container = document.getElementById("chart");
if (!container) throw new Error('Add <div id="chart"></div> to the page first.');
createGraph(container, spec);

Edge style and a seed node

edgeStyle maps a field to solid, dashed or dotted lines; here it separates local service from express service on a subway line. seedNode marks one node. The seed gets a ring and a label that always shows, and it stays lit when a hover, a selection or a legend filter dims the rest. Its size still comes from nodeSize.

The Lexington Avenue line as a graph. This chart is drawn in the browser.

The Lexington Avenue line as a graph. Source: Illustrative data.
{
  "type": "graph",
  "nodes": [
    {
      "id": "brooklyn-bridge",
      "label": "Brooklyn Bridge",
      "ridership": 21000,
      "express": true
    },
    {
      "id": "canal",
      "label": "Canal St",
      "ridership": 12000,
      "express": false
    },
    {
      "id": "spring",
      "label": "Spring St",
      "ridership": 8000,
      "express": false
    },
    {
      "id": "bleecker",
      "label": "Bleecker St",
      "ridership": 14000,
      "express": false
    },
    {
      "id": "astor",
      "label": "Astor Pl",
      "ridership": 11000,
      "express": false
    },
    {
      "id": "union-square",
      "label": "14 St-Union Sq",
      "ridership": 45000,
      "express": true
    },
    // … 9 more nodes; Copy includes them
  ],
  "edges": [
    {
      "source": "brooklyn-bridge",
      "target": "canal",
      "service": "Local"
    },
    {
      "source": "canal",
      "target": "spring",
      "service": "Local"
    },
    {
      "source": "spring",
      "target": "bleecker",
      "service": "Local"
    },
    {
      "source": "bleecker",
      "target": "astor",
      "service": "Local"
    },
    {
      "source": "astor",
      "target": "union-square",
      "service": "Local"
    },
    {
      "source": "union-square",
      "target": "23rd",
      "service": "Local"
    },
    // … 12 more edges; Copy includes them
  ],
  "encoding": {
    "nodeSize": {
      "field": "ridership"
    },
    "nodeLabel": {
      "field": "label"
    },
    "edgeStyle": {
      "field": "service",
      "type": "nominal"
    }
  },
  "seedNode": "grand-central",
  "layout": {
    "type": "force",
    "chargeStrength": -100,
    "linkDistance": 50,
    "seed": 5
  },
  "chrome": {
    "title": "Express service skips ten of the fifteen stations",
    "subtitle": "Stations sized by weekday ridership; Grand Central is the seed node"
  }
}
import { Graph } from "@opendata-ai/openchart-react";
import type { GraphSpec } from "@opendata-ai/openchart-core";
import "@opendata-ai/openchart-core/styles.css";

const spec: GraphSpec = {
  "type": "graph",
  "nodes": [/* 15 nodes; Copy includes them */],
  "edges": [/* 18 edges; Copy includes them */],
  "encoding": {
    "nodeSize": {
      "field": "ridership"
    },
    "nodeLabel": {
      "field": "label"
    },
    "edgeStyle": {
      "field": "service",
      "type": "nominal"
    }
  },
  "seedNode": "grand-central",
  "layout": {
    "type": "force",
    "chargeStrength": -100,
    "linkDistance": 50,
    "seed": 5
  },
  "chrome": {
    "title": "Express service skips ten of the fifteen stations",
    "subtitle": "Stations sized by weekday ridership; Grand Central is the seed node"
  }
};

export function Example() {
  return <Graph spec={spec} />;
}
<script setup lang="ts">
import { Graph } from "@opendata-ai/openchart-vue";
import type { GraphSpec } from "@opendata-ai/openchart-core";
import "@opendata-ai/openchart-core/styles.css";

const spec: GraphSpec = {
  "type": "graph",
  "nodes": [/* 15 nodes; Copy includes them */],
  "edges": [/* 18 edges; Copy includes them */],
  "encoding": {
    "nodeSize": {
      "field": "ridership"
    },
    "nodeLabel": {
      "field": "label"
    },
    "edgeStyle": {
      "field": "service",
      "type": "nominal"
    }
  },
  "seedNode": "grand-central",
  "layout": {
    "type": "force",
    "chargeStrength": -100,
    "linkDistance": 50,
    "seed": 5
  },
  "chrome": {
    "title": "Express service skips ten of the fifteen stations",
    "subtitle": "Stations sized by weekday ridership; Grand Central is the seed node"
  }
};
</script>

<template>
  <Graph :spec="spec" />
</template>
<script lang="ts">
import { Graph } from "@opendata-ai/openchart-svelte";
import type { GraphSpec } from "@opendata-ai/openchart-core";
import "@opendata-ai/openchart-core/styles.css";

const spec: GraphSpec = {
  "type": "graph",
  "nodes": [/* 15 nodes; Copy includes them */],
  "edges": [/* 18 edges; Copy includes them */],
  "encoding": {
    "nodeSize": {
      "field": "ridership"
    },
    "nodeLabel": {
      "field": "label"
    },
    "edgeStyle": {
      "field": "service",
      "type": "nominal"
    }
  },
  "seedNode": "grand-central",
  "layout": {
    "type": "force",
    "chargeStrength": -100,
    "linkDistance": 50,
    "seed": 5
  },
  "chrome": {
    "title": "Express service skips ten of the fifteen stations",
    "subtitle": "Stations sized by weekday ridership; Grand Central is the seed node"
  }
};
</script>

<Graph {spec} />
import { createGraph } from "@opendata-ai/openchart-vanilla";
import type { GraphSpec } from "@opendata-ai/openchart-core";
import "@opendata-ai/openchart-core/styles.css";

const spec: GraphSpec = {
  "type": "graph",
  "nodes": [/* 15 nodes; Copy includes them */],
  "edges": [/* 18 edges; Copy includes them */],
  "encoding": {
    "nodeSize": {
      "field": "ridership"
    },
    "nodeLabel": {
      "field": "label"
    },
    "edgeStyle": {
      "field": "service",
      "type": "nominal"
    }
  },
  "seedNode": "grand-central",
  "layout": {
    "type": "force",
    "chargeStrength": -100,
    "linkDistance": 50,
    "seed": 5
  },
  "chrome": {
    "title": "Express service skips ten of the fifteen stations",
    "subtitle": "Stations sized by weekday ridership; Grand Central is the seed node"
  }
};

const container = document.getElementById("chart");
if (!container) throw new Error('Add <div id="chart"></div> to the page first.');
createGraph(container, spec);

Fields that matter

Field What it does
type "graph" selects this visualization.
nodes The nodes, each with an id and any data fields.
edges The edges, each with a source and a target node id and any data fields.
layout.type The layout algorithm. "force" is the default.
layout.chargeStrength, layout.linkDistance How hard nodes repel and how long edges pull.
layout.clustering A node field whose groups the layout pulls together.
layout.seed A number that makes the force layout settle the same way each time.
encoding.nodeSize, nodeColor, nodeLabel Node radius, fill and label text from node fields.
encoding.edgeWidth, edgeStyle Edge width and line style from edge fields.
seedNode The id of a node to mark with a ring and an always-on label; it stays lit when the rest dims.