My message concerns two needs-work tickets for which I'm involved
#7004 (http://trac.sagemath.org/sage_trac/ticket/7004) and #8431
(http://trac.sagemath.org/sage_trac/ticket/8431).
The main question is about the trichotomy plot/plot3d/latex which are
possible to render a python object.
1) Let G be a Graph object.
- one can get a Plot object by doing G.plot() and plot(G)
- one can get a Plot3d object using G.plot3d() but not plot3d(G)
- one can get a Latex object one can not use G.graphlatex() but to
get the latex string one must do latex(G) but can not do G.latext() !
As those three stands at the same level (nice picture or rendering),
can we have a unified framework for them ? (perhaps latex is to be
considered at another level. But for graphs, all three are intended to
draw pictures)
Neither the _repr_ method nor the __str__ method of the LatexObject is
the latex code...
2) Let G be the same graph.
- one can write show(G) or G.show() and a 2d picture pops up.
- one can write view(G) (but not G.view()) and a 2d picture pops up
Why do not we have a show3d and a G.view() possibility ?
3) Let G be the same graph. There are intersecting options for plot,
plot3d and latex (for example: vertex/edge labels, vertex/edge
colors, ...). Do we want to have a set of common options together with
specialized one ?
Cheers,
Vincent
Those are good questions and suggestions. The latex support for
combinatorial graphs developed last summer was just a start and not
much has been done with it. So it is "immature" to put it kindly.
I've not abandoned it, but it will probably be late spring before I
will return to it. It would be great to provide as much consistency
as possible with the other methods and with dot2tex, etc.
I've looked at #7004. There are parts I could safely review, but
other parts I don't feel comfortable with. Any chance it could be
chunked up into a few coherent parts that might be easier to review?
Rob
Thanks for your interest in this huge patch. I think that #7004
becomes too big to be understandable (moreover it is not ready for
review !). I do not have so much time to do it right now (and it is
too much work). Perhaps it could be a good idea to put a proposal on
graph drawing for Google Summer of Code ? There is a lot of things to
improve in this direction
- interaction layout <-> plot : (no control on loops, no control on
the size of the labels of the vertices, no size control on the label
of the edges, no control on the limit of the graph, ...). Networkx/
matplotlib does better work than Sage (http://networkx.lanl.gov/
gallery.html)
- the plot / plot3d / latex consistency as explained above.
- work on plot options (for example, edge_colors accept only a
dictionnary (color -> list of edges) which is really non natural. One
would prefer a function (label -> color) or a more general function
(edge -> color). The latter seems to be the best option.).
- direct dot, ps, svg, gml outputs (plaintext format) without calling
latex which sometimes crashes because of memory overload.
- the graph_editor. There could be in Sage a java interactive editor
for both 2d and 3d graphs as jmol is used vor visualization ! This
could allow vertex labels, colors, ...
Vincent
Just to make sure: I very much hope that a reasonable subset of the
current #7004 can go in Sage as soon as possible, before it rots
again. Even imperfect, it already is very useful (actually critical)
to several of us.
Cheers,
Nicolas
--
Nicolas M. Thi�ry "Isil" <nth...@users.sf.net>
http://Nicolas.Thiery.name/