You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+51-19Lines changed: 51 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,15 +2,48 @@
2
2
3
3
## About jsgraph
4
4
5
-
_Graphs are mathematical abstractions that are useful for solving many types of problems in computer science. Consequently, these abstractions must also be represented in computer programs._ - [J. Siek](http://ecee.colorado.edu/~siek/resume.pdf)
5
+
_"... At the other end of the spectrum is, for example, graph theory, where the basic object, a graph, can be immediately comprehended. One will not get anywhere in graph theory by sitting in an armchair and trying to understand graphs better. Neither is it particularly necessary to read much of the literature before tackling a problem: it is of course helpful to be aware of some of the most important techniques, but the interesting problems tend to be open precisely because the established techniques cannot easily be applied."_ - [W.T. Gowers](https://en.wikipedia.org/wiki/Timothy_Gowers)
6
6
7
-
Encapsule/jsgraph is a framework for working with directed graph data models using an in-memory storage container abstraction, and a small but growing collection of powerfully-extensible graph coloring algorithms implemented using the [visitor pattern](https://en.wikipedia.org/wiki/Visitor_pattern). The library is specifically designed for efficient embedding in complex Node.js / HTML 5 applications that require clean separation of concerns, and a high-degree of extensibility and control.
7
+
### Status
8
8
9
-
jsgraph is based on the API design and architectural separaton of concerns for graph algorithms invented by the authors of the [Boost C++ Graph Library](http://www.boost.org/doc/libs/1_56_0/libs/graph/doc/index.html) (BGL). The port is logically close enough that the BGL documentation should be considered as an advanced resource.
I encourage you to take some time and experiment with the library as it's truly powerful once you get over the initial learning curve.
11
+
Ich danke Ihnen sehr [Travis CI](https://travis-ci.org/Encapsule/jsgraph.svg?branch=master)
12
12
13
-
_"... At the other end of the spectrum is, for example, graph theory, where the basic object, a graph, can be immediately comprehended. One will not get anywhere in graph theory by sitting in an armchair and trying to understand graphs better. Neither is it particularly necessary to read much of the literature before tackling a problem: it is of course helpful to be aware of some of the most important techniques, but the interesting problems tend to be open precisely because the established techniques cannot easily be applied."_ - [W.T. Gowers](https://en.wikipedia.org/wiki/Timothy_Gowers)
13
+
### Summary
14
+
15
+
`Encapsule/jsgraph` implements a framework for storing and processing in-memory directed graph data sets that is inspired by the research of [Jeremy Siek](http://wphomes.soic.indiana.edu/jsiek/) and his work on the [Boost C++ Graph Library](http://www.boost.org/doc/libs/1_59_0/libs/graph/doc/table_of_contents.html).
16
+
17
+
The library provides and normalizes the following operations independent of graph topology and semantics:
18
+
19
+
- Generic, multi-dimensional container abstraction for storing directed graphs in memory.
20
+
- JSON/native JavaScript data object import/export API's.
21
+
- Vertex and edge CRUD API's.
22
+
- Application-defined vertex and edge property API's.
23
+
- Vertex and edge enumeration API's.
24
+
- Root/leaf vertex set enumeration API's.
25
+
- Generic transposition algorithm.
26
+
- Developer-extensible breadth-first visit and search algorithm.
27
+
- Developer-extensible depth-first visit and search algorithm.
28
+
29
+
### Audience
30
+
31
+
jsgraph is a framework for building next-generation frameworks on Node.js and HTML 5.
32
+
33
+
- Use instead of in-memory object hierarchies linked by reference:
34
+
- Serializable to JSON (even when cyclic).
35
+
- Edges can be labeled with properties. References can't.
36
+
- Much simpler to debug and test.
37
+
- Promotes code consistency and readability.
38
+
- Less refactoring due to data structure udpates.
39
+
- Implement business logic and process as generic graph algorithms:
40
+
- Considerably reduce lines of code/test.
41
+
- Make the architecture of the design manifest in code.
42
+
- Re-use investment on other and new data types without code modification.
43
+
44
+
### Training and Support
45
+
46
+
If you're considering using jsgraph in a commerical product, please get in touch with [Encapsule.io](https://encapsule.io) - we can save you time, and help you get the most out of your investment.
14
47
15
48
### Programming
16
49
@@ -26,7 +59,7 @@ _"... At the other end of the spectrum is, for example, graph theory, where the
26
59
In your project, install via npm.
27
60
28
61
$ npm install jsgraph --save
29
-
jsgraph@0.5.xx node_modules/jsgraph
62
+
jsgraph@0.6.xx node_modules/jsgraph
30
63
31
64
### Sources
32
65
@@ -51,7 +84,7 @@ See also: [Encapsule/jsgraph on GitHub](https://github.com/Encapsule/jsgraph)
51
84
52
85
## Example
53
86
54
-
The following short example constructs a `DirectedGraph` container using a v0.5 jsgraph digraph data object, and derives a simple rank assignment algorithm from jsgraph's bundled `breadthFirstTraverse` algorithm. Note that the BFT visitor interface callback functions leverage the `DirectedGraph` API to get/set the data property value of each visited vertex to its rank.
87
+
The following short example constructs a `DirectedGraph` container using a v0.6 jsgraph digraph data object, and derives a simple rank assignment algorithm from jsgraph's bundled `breadthFirstTraverse` algorithm. Note that the BFT visitor interface callback functions leverage the `DirectedGraph` API to get/set the data property value of each visited vertex to its rank.
A depth-first traversal concludes when all reacable vertices have been visited, or when the client signals termination by returning Boolean **false** back to the algorithm from one of its visitor interface callback functions.
305
347
306
-
## More examples
307
-
308
-
The best public examples of how to use jsgraph v0.5 are embedded in the module's test suite. Take a look at the ./test directory scripts.
309
-
310
-
## Support
311
-
312
-
I'm happy to answer questions and help you get going with jsgraph in your project.
313
-
314
-
Ping me on Twitter ([@AlpineLakes](https://twitter.com/AlpineLakes)) or file [Issues](https://github.com/Encapsule/jsgraph/issues) tagged with the 'question' label.
errors.unshift("You have specified an empty starting vertex set for this traversal. This is allowed only if you set request.options.allowEmptyStartVector === true.");
149
+
errors.unshift("Traversal aborted because we don't know which vertex to start on. Specify a graph that has at least one root vertex, explicity specify the start vertex (or vertices) via `request.options.startVector` array, or suppress this error by setting `request.options.allowEmptyStartVector` to Boolean true.");
errors.unshift("BFS visitor."+request_.method+" returned type '"+jstype+"' instead of expected '[object Boolean]'.");
51
+
errors.unshift(request_.algorithm+" visitor interface error in callback function '"+request_.method+"'. Function returned type '"+jstype+"' instead of expected '[object Boolean]'.");
0 commit comments