#7004: [with patch, needs work] Refactor the graph layout code, and add
interface
with graphviz for acyclic layout
--------------------------+-------------------------------------------------
Reporter: nthiery | Owner: nthiery
Type: enhancement | Status: assigned
Priority: major | Milestone: sage-combinat
Component: graph theory | Keywords: graph layout, graphviz, acyclic
Reviewer: | Author: Nicolas M. ThiƩry
Merged: |
--------------------------+-------------------------------------------------
Description changed by nthiery:
Old description:
> Experimental patch on:
> http://combinat.sagemath.org/hgwebdir.cgi/patches/file/tip/trac_7004
> -graphviz-nt.patch
>
> This also requires graphviz and a dot2tex spkg available from:
>
> http://sage.math.washington.edu/home/nthiery/dot2tex-0.2.spkg
>
> From the patch description:
>
> - Refactors the graph layout code, with:
>
> - A new main graph.layout() method, to be called by plot, latex, ...
> - Many layout methods, like graph._layout_circular()
> - Extends the graphviz_string method (latex labels)
> - Define a new layout method ._layout_acyclic() implemented by
> calling dot2tex and graphviz
> - Implement an alternative implementation of latex for graphs
> by delegating all the work to dot2tex (GraphLatex.dot2tex_picture)
> - Slightly simplifies the handling of default values for
> graph.latex_options
>
> - Makes some fixes to the poset code:
> - __repr__ -> _repr_
> - _latex_ by calling latex on the internal element
>
> TODO:
>
> - Add an optional default_layout method that subclasses could
> override (like for the Petersen graph, ...). This would be better
> for them than to systematically construct the layout at
> construction time.
>
> - Refactor the remaining layout functions (planar, ...) as above
>
> - Double check all the logic to make sure it is backward compatible
>
> - A lot of code is doing things very similar to dot2tex. Maybe things
> could be merged.
>
> - Finish to doctest everything
>
> - Implement the different options for both latex constructions
>
> - Add appropriate # optional comments
>
> - Make dot2tex.spkg into an optional sage package
New description:
Experimental patch on:
http://combinat.sagemath.org/hgwebdir.cgi/patches/file/tip/trac_7004
-graphviz-nt.patch
This also requires graphviz and a dot2tex spkg available from:
http://sage.math.washington.edu/home/nthiery/dot2tex-2.8.6.spkg
From the patch description:
- Refactors the graph layout code, with:
- A new main graph.layout() method, to be called by plot, latex, ...
- Many layout methods, like graph._layout_circular()
- Extends the graphviz_string method (latex labels)
- Define a new layout method ._layout_acyclic() implemented by
calling dot2tex and graphviz
- Implement an alternative implementation of latex for graphs
by delegating all the work to dot2tex (GraphLatex.dot2tex_picture)
- Slightly simplifies the handling of default values for
graph.latex_options
- Makes some fixes to the poset code:
- __repr__ -> _repr_
- _latex_ by calling latex on the internal element
TODO:
- make layout(layout="bla") automatically lookup _layout_bla, so that
subclasses can define new layout algorithms (e.g. acyclic for directed
graphs).
- Add an optional default_layout method that subclasses could
override (like for the Petersen graph, ...). This would be better
for them than to systematically construct the layout at
construction time.
- Move the layout code out of posets into a _layout_acyclic_spring in
directed graphs, and have _layout_acyclic call it if dot2tex is not
available.
- Refactor the remaining layout functions (planar, ...) as above
- Double check all the logic to make sure it is backward compatible
- A lot of code is doing things very similar to dot2tex. Maybe things
could be merged.
- Finish to doctest everything
- Implement the different options for both latex constructions
- Add appropriate # optional comments
- Make dot2tex.spkg into an optional sage package
--
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/7004#comment:3>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---