Commit 6bf6e873 authored by VIGNET Pierre's avatar VIGNET Pierre
Browse files

[gui] Add SFDP force-based layout for large graphs; add doc

parent ba1174e3
......@@ -149,28 +149,35 @@
<child>
<widget class="GtkMenuItem" id="neato">
<property name="visible">True</property>
<property name="label" translatable="yes">NEATO</property>
<property name="label" translatable="yes">Neato (energy-based)</property>
<property name="use_underline">True</property>
</widget>
</child>
<child>
<widget class="GtkMenuItem" id="fdp">
<property name="visible">True</property>
<property name="label" translatable="yes">FDP</property>
<property name="label" translatable="yes">FDP (force-based)</property>
<property name="use_underline">True</property>
</widget>
</child>
<child>
<widget class="GtkMenuItem" id="sfdp">
<property name="visible">True</property>
<property name="label" translatable="yes">SFDP (large graphs)</property>
<property name="use_underline">True</property>
</widget>
</child>
<child>
<widget class="GtkMenuItem" id="twopi">
<property name="visible">True</property>
<property name="label" translatable="yes">Twopi</property>
<property name="label" translatable="yes">Twopi (radial)</property>
<property name="use_underline">True</property>
</widget>
</child>
<child>
<widget class="GtkMenuItem" id="circo">
<property name="visible">True</property>
<property name="label" translatable="yes">Circo</property>
<property name="label" translatable="yes">Circo (circular)</property>
<property name="use_underline">True</property>
</widget>
</child>
......
......@@ -203,6 +203,8 @@ class Charter(object):
menu_item.connect("activate", self.do_layout, "neato")
menu_item = self.wtree.get_widget("fdp")
menu_item.connect("activate", self.do_layout, "fdp")
menu_item = self.wtree.get_widget("sfdp")
menu_item.connect("activate", self.do_layout, "sfdp")
menu_item = self.wtree.get_widget("twopi")
menu_item.connect("activate", self.do_layout, "twopi")
menu_item = self.wtree.get_widget("circo")
......
......@@ -56,13 +56,13 @@ class LayoutVisitor(object):
- dot - "hierarchical" or layered drawings of directed graphs.
This is the default tool to use if edges have directionality.
- neato - "spring model'' layouts.
- neato - "spring model" layouts.
This is the default tool to use if the graph is not too large
(about 100 nodes) and you don't know anything else about it.
Neato attempts to minimize a global energy function, which is equivalent
to statistical multi-dimensional scaling.
- fdp - "spring model'' layouts similar to those of neato, but does
- fdp - "spring model" layouts similar to those of neato, but does
this by reducing forces rather than working with energy.
- sfdp - multiscale version of fdp for the layout of large graphs.
......@@ -75,6 +75,8 @@ class LayoutVisitor(object):
This is suitable for certain diagrams of multiple cyclic structures,
such as certain telecommunications networks.
.. seealso:: https://www.graphviz.org/
"""
def __init__(self, view, layout_style):
......@@ -150,6 +152,8 @@ class LayoutVisitor(object):
agraph.layout(prog="neato")
elif layout_style == "fdp":
agraph.layout(prog="fdp")
elif layout_style == "sfdp":
agraph.layout(prog="sfdp")
elif layout_style == "twopi":
agraph.layout(prog="twopi")
elif layout_style == "circo":
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment