Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
VIGNET Pierre
cadbiom
Commits
6bf6e873
Commit
6bf6e873
authored
Jan 20, 2020
by
VIGNET Pierre
Browse files
[gui] Add SFDP force-based layout for large graphs; add doc
parent
ba1174e3
Changes
3
Hide whitespace changes
Inline
Side-by-side
gui/cadbiom_gui/gt_gui/chart_glade/charter.glade
View file @
6bf6e873
...
...
@@ -149,28 +149,35 @@
<child>
<widget
class=
"GtkMenuItem"
id=
"neato"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"label"
translatable=
"yes"
>
N
EATO
</property>
<property
name=
"label"
translatable=
"yes"
>
N
eato (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>
...
...
gui/cadbiom_gui/gt_gui/charter.py
View file @
6bf6e873
...
...
@@ -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"
)
...
...
gui/cadbiom_gui/gt_gui/layout.py
View file @
6bf6e873
...
...
@@ -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"
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment