ztellman / rhizome Goto Github PK
View Code? Open in Web Editor NEWsimple graph and tree visualization
simple graph and tree visualization
cider no longer supports <1.7 versions of clojure. When connecting to the repl, this causes problems with cider. Admittedly, this is a weakness of cider, but all tests pass when bumping the version to 1.8.
See http://www.graphviz.org/content/dot-language
I'm trying to visualize some data structures that have slots that contain pointers. Automatically rendering vectors as dot records is nice, but there doesn't seem to be a way to name or otherwise snap edges to particular ports.
Hello Zach!
A genuine question, is clustering working for view-tree? My definition:
(defn show-tree [root] (viz/view-tree node-branch? node-children root :options {:dpi 48} :node->descriptor (fn [n] {:label (str n)}) :node->cluster :index))
Does not cluster on my :index key...keep up the good work!
A documentation section on emitting Dot files should be quite useful, e.g. integrating with web based Graphviz visualization using http://mdaines.github.io/viz.js/
In Graphviz, you can have edges pointing to and from clusters. The documentation appears to be down a lot, so here's the cached version.
In short:
compound=true
on the graphlhead
/ltail
("logical head/tail") to a cluster nameRight now it doesn't appear I can do this from the viz ns because cluster names are unpredictable gensyms.
AFAICT, there are two obvious ways (potentially orthogonal) to solving this problem:
node->name
fn, as called for in #5 but which ended up being unnecessary there (at least I think so; that fn was called node->id
but I think the id they're referring to is the name in graphviz parlance; id is for when you're producing e.g. SVG to set the id of the resulting XML element; but rhizome appears to call it "name")node->name
fn e.g. in rhizome.dot
would also work.I'm a slightly bigger fan of 1 since it would also give me the option of producing more intelligible names than the gensyms, which is convenient when I'm producing the dot instead of the graphical output.
The workaround is to rebind the private dynamic *node->id*
. I'm perfectly happy doing that, but I want to make sure I contribute back to rhizome. Either I can write some docs telling people how to do that, but since it's marked as private maybe that's less than ideal, and I should instead resolve (1) or (2).
It's half the size of the other releases and running "lein deps" with [rhizome "0.1.7"] in the project.clj file triggers a message that there is a problem with the zip file (presumably, that means the jar).
(rhizome.viz/view-graph #{:a :b} {:a [:b]}
:edge->descriptor (fn [_ _]
{:label '[:a {:b "c"}]}))
; IllegalArgumentException Error: <stdin>: syntax error in line 8 near '"'
I think I might be running aground on the "show label as record" feature, and pr-str'ing is actually what I want here (and what I thought it was doing for the longest anyway), but I thought I'd file an issue just in case.
(#_rhizome.dot/graph->dot
rhizome.viz/view-graph
[:a]
{}
:node->descriptor (fn [n] {:label n})
:cluster->descriptor (fn [n] {:label n})
:node->cluster
{:a :cluster-a}
:cluster->parent
{:cluster-a :cluster-b})
Results in an empty graph.
It's fixed by adding something into cluster-b:
(#_rhizome.dot/graph->dot
rhizome.viz/view-graph
[:a :b]
{}
:node->descriptor (fn [n] {:label n})
:cluster->descriptor (fn [n] {:label n})
:node->cluster
{:a :cluster-a
:b :cluster-b}
:cluster->parent
{:cluster-a :cluster-b})
I am trying to show a cluster of clusters.
Also removing the cluster parent from cluster-a of course fixes this (but without it being grouped.)
Hi Zach and thanks in advance for sharing your lib,
I'd like to render simple html as graphviz doc says that it's possible
Here an example to translate
https://raw.githubusercontent.com/ellson/graphviz/master/doc/infosrc/html3.gv
do you think it's possible using this rhizome tool?
Thanks
Juan
Hello,
I'm using this library, and it's working well.
However, we have a headless Jenkins server that we use for creating release artifacts (RPMs), and the compilations are failing with:
Exception in thread "main" java.awt.HeadlessException:
No X11 DISPLAY variable was set, but this program performed an operation which requires it., compiling:(viz.clj:24:3)
(and a long stack trace).
The machine I'm developing on has an X server (no surprise!), but the build server, and the final server don't.
(I've added Graphviz to the RPM dependencies of the release, so some things might get pulled in from there when it's installed on the server)
Is there any way to build this on a headless server?
Will it run on a headless server? (I just want it to generate SVG in answer to a web request).
Calum
Added pull request
user=> (use 'rhizome.viz)
nil
user=> (def g
#_=> {:a [:b :c]
#_=> :b [:c]
#_=> :c [:a]})
#'user/g
user=> (view-graph (keys g) g
#_=> :node->descriptor (fn [n] {:label n}))
nil
user=> (view-graph (keys g) g
#_=> :cluster->descriptor (fn [n] {:label n})
#_=> :node->cluster identity
#_=> :cluster->parent {:b :c, :a :c})
NullPointerException javax.swing.ImageIcon.loadImage (ImageIcon.java:309)
user=> (pst)
NullPointerException
javax.swing.ImageIcon.loadImage (ImageIcon.java:309)
javax.swing.ImageIcon.setImage (ImageIcon.java:369)
rhizome.viz/view-image (viz.clj:53)
rhizome.viz/view-image (viz.clj:50)
clojure.core/comp/fn--4156 (core.clj:2341)
user/eval2474 (NO_SOURCE_FILE:1)
clojure.lang.Compiler.eval (Compiler.java:6619)
clojure.lang.Compiler.eval (Compiler.java:6582)
clojure.core/eval (core.clj:2852)
clojure.main/repl/read-eval-print--6588/fn--6591 (main.clj:259)
clojure.main/repl/read-eval-print--6588 (main.clj:259)
clojure.main/repl/fn--6597 (main.clj:277)
nil
user=> (System/getProperty "java.runtime.version")
"1.8.0-ea-b94"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.