Weave: Textile's Opinionated Graph Library
Description
Weave is based on the fine work of JSNetworkX (Javascript port of NetworkX) and NetworkX itself. Weave is developed in Typescript, and as such, is more opinionated than its predecessors. Currently, Weave supports:
- Data structures for graphs and digraphs
- A limited set of network structure and analysis measures
- Nodes can be almost anything that has a string representation
- Edges can hold maps of arbitrary data (e.g., weights, time-series)
- Well-tested (for the most part)
Quick example
import {DiGraph, Algorithms} from "./index"
// Build an empty directed graph
const G = new DiGraph(new Map([["name", "graph!"]]))
// Add some edges
G.addEdge(0, 1, new Map([["weight", 2]]))
G.addEdge(1, 2, new Map([["weight", 1]]))
G.addEdge(2, 0, new Map([["weight", 2]]))
// Grab some information about the graph structure
console.log(G.edgeCount())
console.log(Algorithms.degreeCentrality(G))
Notes
See CONTRIBUTING.md for contribution guidelines.