Vector.js

Vector is an open source javascript library for creating interactive graphics. View the repository, run the tests, or meet the team.

Directed Graph Element Open in Sandbox

Description

This interactive demonstrates the directed graph element.

Script

/**
* @title Directed Graph Element
* @description This interactive demonstrates the directed graph element.
* @tags [elements]
*/
import { Interactive, getScriptName } from '../../index.js';
let interactive = new Interactive(getScriptName());
interactive.width = 768;
interactive.height = 150;
interactive.border = true;
let graph = interactive.graph({ directed: true });
let a = graph.addNode(75, 75, 'a');
let b = graph.addNode(200, 75, 'b');
graph.addEdge(a, b);
//# sourceMappingURL=directed-graph-element.js.map