The GRAPH/JSON library provides functions for serializing graph objects as defined by the GRAPH library to/from JSON.
The code is available under the GNU General Public License.
Source:
http://github.com/eschulte/graph.
Helper function for serializing Graphs to JSON objects and reading JSON objects back into graphs. The JSON syntax for a graph is compatible with the JavaScript d3 visualization library, allowing for interactive viewing of graphs in the browser.
See d3 (specifically d3-force) for more.
[Generic function]
from-d3 graph input => result
Parse a D3 format string or stream INPUT into GRAPH.
[Generic function]
from-json graph input => result
[Method]
from-json (graph graph) input => result
Parse string or stream INPUT into GRAPH.
[Generic function]
to-d3 graph &key stream group-fn => result
Return a JSON encoding of GRAPH formatted for D3. Edges should have numeric values which d3 will translate into their width. Optional keyword argument GROUP-FN should be a function from nodes to group numbers.
[Generic function]
to-html graph &key stream group-fn => result
Write GRAPH to an HTML file. The resulting HTML file will display an interactive version of GRAPH. Usesto-d3
to first encode the graph as JSON which is embedded in the HTML page.
[Generic function]
to-json graph &key stream node-fn edge-fn => result
Write a JSON encoding of GRAPH to STREAM.
This documentation was prepared with a hacked up version of DOCUMENTATION-TEMPLATE.