Liking cljdoc? Tell your friends :D

Titanium-Loom Build Status

Titanium-Loom defines an interface between Titanium, a Clojure graph library by Clojurewerkz, and Loom, a Clojure graph algorithms and visualization library.

Usage

Leiningen/Clojars [group-id/name version]

[aysylu/titanium-loom "0.1.2"]

Namespaces

loom.titanium - integration API

Creation and Interaction

For information on how to create a Titanium graph, see tutorial.

Create a Loom Graph from Titanium Representation

(def default-graph (titanium->loom titanium-graph))
(def custom-graph (titanium->loom titanium-graph
                                  :node-fn (clojurewerkz.titanium.vertices/find-by-kv :age 22)
                                  :edge-fn (->> (clojurewerkz.titanium.edges/get-all-edges)
                                                (filter #(not= % 1)))
                                  :weight-fn (constantly 22))

The custom-graph is created with custom node, edge, and weight functions. This allows the user to convert to Loom representation a subset of the graph stored in the database, if the graph is too big and would not fit into memory, or if only parts of the data are of interest for the analysis.

The default-graph is created using node, edge, and weight functions with default behavior. The node and edge functions return all of the vertices and edges (respectively) in the Titanium graph. The default weight function returns 1 for any given edge.

Visualize

If you have GraphViz installed, and its binaries are in the path, you can view graphs with loom.io/view:

(view default-graph) ;opens image in default image viewer

Inspect and Run Algorithms

See Loom's documentation on how to inspect the Loom graph and run graph algorithms on it.

Dependencies

  • Clojure
  • Loom
  • Titanium
  • Optional for visualization: GrapViz.

TODO

  • Add support for infinite graphs
  • Use more efficient data structures
  • Maybe add validations

Contributors

License

Copyright (C) 2013 Aysylu Greenberg.

Distributed under the Eclipse Public License, the same as Clojure.

Can you improve this documentation? These fine people already did:
Aysylu & aysylu
Edit on GitHub

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close