Graphviz and Subgraphs

180 views
Skip to first unread message

borobudur

unread,
May 19, 2012, 3:42:53 AM5/19/12
to Neo4j
Hi, I was wondering if I can configure the
org.neo4j.visualization.graphviz.GraphvizWriter so that I can have
subgraphs or clusters in my graphviz output according to this:

<a href="http://www.graphviz.org/content/cluster">graphviz.org/content/
cluster</a>

Thanks!

Peter Neubauer

unread,
May 19, 2012, 4:18:14 AM5/19/12
to ne...@googlegroups.com

Well,
Yes that is possible, you will have to provide your own graph walker (like the one used in the example at blog.neo4j.org) and your own graph style. I have no example here (on mobile) but look at the tests and work from there.

Let us know your progress!

Send from mobile.

Peter Neubauer

unread,
May 23, 2012, 3:20:43 AM5/23/12
to ne...@googlegroups.com
Stefan,
Alistair just added some stub code for subgraphs here:

https://github.com/neo4j/community/commit/c392afbf5902e6d5fd649c13ac98df99ca4d4666

You might be interested in contributing more along these lines?

Cheers,

/peter neubauer

G:  neubauer.peter
S:  peter.neubauer
P:  +46 704 106975
L:   http://www.linkedin.com/in/neubauer
T:   @peterneubauer

If you can write, you can code - @coderdojomalmo
If you can sketch, you can use a graph database - @neo4j

Alistair Jones

unread,
May 23, 2012, 2:03:55 PM5/23/12
to ne...@googlegroups.com
Hi,

In case it helps, the dot code from that example looks like this:

digraph Neo {
  node [
    fontname = "Bitstream Vera Sans"
    shape = "Mrecord"
    fontsize = "8"
  ]
  edge [
    fontname = "Bitstream Vera Sans"
    fontsize = "8"
  ]
 subgraph cluster_USA {  N13 [
    label = "{Node\[13\]|'name' = 'Emil Eifrém' : String\l'country_of_residence' = 'USA' : String\l}"
  ]
 label = "USA"
 }
 subgraph cluster_Sweden {  N14 [
    label = "{Node\[14\]|'name' = 'Tobias Ivarsson' : String\l'country_of_residence' = 'Sweden' : String\l}"
  ]
  N15 [
    label = "{Node\[15\]|'name' = 'Johan Svensson' : String\l'country_of_residence' = 'Sweden' : String\l}"
  ]
 label = "Sweden"
 }
  N13 -> N14 [
    label = "KNOWS\n"
  ]
  N15 -> N13 [
    label = "KNOWS\n"
  ]
  N14 -> N15 [
    label = "KNOWS\n"
  ]
  N14 -> N13 [
    label = "WORKS_FOR\n"
  ]
}

I've attached a rendered SVG as well.

cheers,

Alistair

subgraphs.dot.svg
Reply all
Reply to author
Forward
0 new messages