graphflux 0.0.1-beta

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,19 @@
1
+ Copyright (c) 2012-2014 John Williams
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in
11
+ all copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
+ THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,102 @@
1
+ graphflux is a JavaScript library for creating and modifying directed and undirected graphs. In addition to a core graph API, it also comes with implementations for many common graph algorithms.
2
+
3
+ # Table of Contents
4
+
5
+ - [Example](#example)
6
+ - [Installing](#installing)
7
+ - [npm Install](#npm-install)
8
+ - [Bower Install](#bower-install)
9
+ - [Browser Scripts](#browser-scripts)
10
+ - [Source Build](#source-build)
11
+ - [[API Reference]]
12
+ - [Bug Tracking](/johntech0828/graphflux/issues)
13
+ - [[Contributing]]
14
+ - [License](#license)
15
+
16
+ ## Example
17
+
18
+ This following code block shows a small example of how to use graphflux in node.js:
19
+
20
+ ```js
21
+ var Graph = require("graphflux").Graph;
22
+
23
+ // Create a new directed graph
24
+ var g = new Graph();
25
+
26
+ // Add node "a" to the graph with no label
27
+ g.setNode("a");
28
+
29
+ g.hasNode("a");
30
+ // => true
31
+
32
+ // Add node "b" to the graph with a String label
33
+ g.setNode("b", "b's value");
34
+
35
+ // Get the label for node b
36
+ g.node("b");
37
+ // => "b's value"
38
+
39
+ // Add node "c" to the graph with an Object label
40
+ g.setNode("c", { k: 123 });
41
+
42
+ // What nodes are in the graph?
43
+ g.nodes();
44
+ // => `[ 'a', 'b', 'c' ]`
45
+
46
+ // Add a directed edge from "a" to "b", but assign no label
47
+ g.setEdge("a", "b");
48
+
49
+ // Add a directed edge from "c" to "d" with an Object label.
50
+ // Since "d" did not exist prior to this call it is automatically
51
+ // created with an undefined label.
52
+ g.setEdge("c", "d", { k: 456 });
53
+
54
+ // What edges are in the graph?
55
+ g.edges();
56
+ // => `[ { v: 'a', w: 'b' },
57
+ // { v: 'c', w: 'd' } ]`.
58
+
59
+ // Which edges leave node "a"?
60
+ g.outEdges("a");
61
+ // => `[ { v: 'a', w: 'b' } ]`
62
+
63
+ // Which edges enter and leave node "d"?
64
+ g.nodeEdges("d");
65
+ // => `[ { v: 'c', w: 'd' } ]`
66
+ ```
67
+
68
+ or graphflux can be included in a webpage:
69
+
70
+ ```html
71
+ <script src="http://PATH/TO/graphflux.min.js"></script>
72
+ <script>
73
+ var g = new graphflux.Graph();
74
+ // ...etc.
75
+ ```
76
+
77
+ ## Installing
78
+
79
+ ### npm Install
80
+
81
+ Before installing this library you need to install the [npm package manager](http://npmjs.org/).
82
+
83
+ To get graphflux from npm, use:
84
+
85
+ $ npm install graphflux
86
+
87
+ ### Source Build
88
+
89
+ Before building this library you need to install the [npm package manager](http://npmjs.org/).
90
+
91
+ Check out this project and run this command from the root of the project:
92
+
93
+ $ make dist
94
+
95
+ This will generate `graphflux.js` and `graphflux.min.js` in the `dist` directory
96
+ of the project.
97
+
98
+ # License
99
+
100
+ graphflux is licensed under the terms of the MIT License. See the [LICENSE](LICENSE) file for details.
101
+
102
+ [npm package manager]: http://npmjs.org/