-
Notifications
You must be signed in to change notification settings - Fork 183
Home
JSNetworkX is a port of NetworkX, a popular graph library for Python, to JavaScript.
JSNetworkX allows you to build, process and analyze graphs in JavaScript. It can be used together with D3.js in the browser to create interactive graph visualizations.
- Usage
- Differences between the Python and JavaScript implementations (you should read this!)
- How to draw graphs with JSNetworkX
- Examples
You can download the latest version of JSNetworkX here:
or get the latest version and the source code:
The following libraries are used by JSNetworkX:
- Jasmine for testing
- Closure Library as base framework
- D3 for visualization
The Closure Compiler is used to minimize and optimize the code.
The development for JSNetworkX has just started, the rough roadmap is as follows:
- Port unit tests to Jasmine (ongoing)
- Port base classes (done)
- Implement renderer with D3 (done, but subject to change)
- Port algorithms module
The code is scattered with using bracket notation to access properties (foo['bar']
) instead of dot notation (foo.bad
). This is ugly, I know. But it is necessary to make the code work well with the Closure Compiler in advanced mode. This mode drastically reduces the file size.
To build the library on your own you need ant. ant compile will download all necessary dependencies (Closure library and compiler) and compile the files.
You can run test either on the uncompiled or compiled code (SpecRunner.html and SpecRunner_compiled.htm respectively). To run the compiled test, you have to build a special test version with ant test_compile, which just adds some helper functions and creates an easier to read version of the compiled code.