Skip to content

Variable: graph ​

ts
const graph: GraphFunction<GraphInput, GraphOptions>;

Experimental

A network graph: one graph trace of the nodes and links of an edge table (source, target, weight), with an optional node table (nodes, matched by id) for labels, colors, sizes, symbols, positions and hover text. color groups the nodes (one color and legend item per value), or maps a numeric column through a colorscale on coloraxis; size takes a column or 'degree'; directed draws arrowheads; arrangement picks the layout, with its options under the trace's own name (force, layered, tree, arc, hive). Drawing the figure needs the graph package: import '@mk7s/holochart/graph'.

Example ​

ts
const figure = graph(emails, {
  source: 'from',
  target: 'to',
  weight: 'count',
  nodes: people,
  id: 'name',
  color: 'team',
  size: 'degree',
});

Released under the MIT License.