ss-graph
[![Build Status](https://travis-ci.org/boycgit/ss-graph.svg?branch=master)](https://travis-ci.org/boycgit/ss-graph) [![Coverage Status](https://coveralls.io/repos/github/boycgit/ss-graph/badge.svg?branch=master)](https://coveralls.io/github/boycgit/ss-gra
Last updated a year ago by jscon .
Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install ss-graph 
SYNC missed versions from official npm registry.

ss-graph

Build Status Coverage Status MIT Licence npm version

Data Structure Serial - Graph

  • written in Typescript
  • fully tested

Installation

Node.js / Browserify

npm install ss-graph --save
var {Graph, GraphEdge, GraphVertex} = require('ss-graph');

Global object

Include the pre-built script.

<script src="./dist/index.umd.min.js"></script>

usage

const graph = new Graph();

const vertexA = new GraphVertex('A');
const vertexB = new GraphVertex('B');
const vertexC = new GraphVertex('C');
const vertexD = new GraphVertex('D');

const edgeAB = new GraphEdge(vertexA, vertexB, 1);
const edgeBC = new GraphEdge(vertexB, vertexC, 2);
const edgeCD = new GraphEdge(vertexC, vertexD, 3);
const edgeAD = new GraphEdge(vertexA, vertexD, 4);

graph
    .addEdge(edgeAB)
    .addEdge(edgeBC)
    .addEdge(edgeCD)
    .addEdge(edgeAD);

expect(graph.getWeight()).toBe(10);

Build & test

npm run build
npm test

document

npm run doc

then open the generated out/index.html file in your browser.

License

MIT.

Current Tags

  • 0.1.1                                ...           latest (a year ago)

2 Versions

  • 0.1.1                                ...           a year ago
  • 0.1.0                                ...           a year ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 2
Dependencies (2)
Dev Dependencies (25)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |