Dear graph/posets devs, Due to urgent needs for Sage days 20, I just rebased and worked further on my patch for #7004:
Refactor the graph layout code, and add interface with graphviz It is now up on trac for review. See the ticket description for what was changed. The main improvement from the user point of view is that it is more modular, allowing for using any layout algorithm (circular/spring/planar/...) with any plot function (graph_editor, plot, save, plot3d), when meaningful. There are a couple design questions and TODO's left in the ticket description which I reproduce here for discussions. So here is what remains to do, now in this ticket, or later: * Double check all the logic to make sure it is backward compatible There are not that many tests for the graph layout code (because it is non trivial to test). So please recreate all your favorite graph plots and see if there is anything broken. * graph_editor was using iterations=1000 as default. Was there a reason? If yes, do we want to set this up as default value for all layouts? * What should be the default layout algorithm? * Planar layout when the graph is planar * acyclic if acyclic * spring otherwise * The spring option for graded layouts does not work: the plot get completely squished horizontally. Could someone please help me debug this? sage: G = posets.[wiki:IntegerPartitions](3).hasse_diagram() sage: G.plot(layout="acyclic_dummy", spring = True) To be compared with: sage: G.plot(layout="acyclic_dummy") * Find a better name for acyclic_dummy. Once the spring option will be functional, this could be set to the default value, and the layout renamed to acyclic_spring. * Choose a good option name for the direction of growth of acyclic layout, and a good default value. Merge this with the option for tree layout (tree_orientation). orientation = "up" (as for tree) ? rankdir = "BT" (as in graphviz)? * A lot of code is doing things very similar to dot2tex. Maybe things could be merged. * Implement the various options for both latex constructions (tikz or dot2tex) * Implement the default layout of standard graphs using a default_layout method rather than at construction time. Notes: - Up to fixing a couple things after this discussion, the patch should be essentially ready. As much as possible, I'd rather have it not rot away again. Quick comments and reviews would be most welcome! - I am a bit worried about conflicts with #7608. Indeed, besides its main changes which are well localized and far from what #7004 touches, the patch up on #7608 does trivial edits almost everywhere in the graph code (apparently fixing spurious end of line spaces). I would suggest to either remove those trivial edits from #7608, or to rebase it on #7004 (which will be much easier than the converse). Thanks in advance! Nicolas -- Nicolas M. ThiƩry "Isil" <nthi...@users.sf.net> http://Nicolas.Thiery.name/ -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org