On Tue, Sep 29, 2009 at 1:05 PM, Nicolas M. Thiery
<nicolas.thi...@u-psud.fr> wrote:
>        Hi Kjell,
>
> On Tue, Sep 29, 2009 at 09:36:57AM +0200, Kjell Magne Fauske wrote:
>> >> import dot2tex
>> >> texcode = dot2tex.dot2tex(testgraph, debug=True)
>
> Speaking of this: I have another use case for which is not (yet!)
> covered by the new shiny interface, namely calling dot2tex only to
> extract out the node layout information, as a dictionary of the form {
> node_name : [x,y] }.  Here is how I currently cheat around:
>
>        from dot2tex.dot2tex import DotConvBase
>
>        class TrivialDotConv(DotConvBase):
>            def do_nodes(self):
>                pass
>
>            def do_edges(self):
>                pass
>
>        conv = (TrivialDotConv({}))
>        conv.convert(dotdata)
>
>        return dict( (node.name, map(int, node.attr['pos'].split(','))) for 
> node in conv.nodes )
>
> Would you consider adding this feature to the shiny interface, so that
> one could do something like:
>
>        > dotdata = r"""
>        digraph {
>            "a" [label=" ", texlbl="$1$"];
>            "b" [label=" ", texlbl="$2$"];
>            "c" [label=" ", texlbl="$3$"];
>            a -> c
>            b -> c
>        }
>        """
>        > dot2tex.dot2tex(dotdata, format = "positions")
>
>        {'a': [8, 66], 'b': [42, 66], 'c': [25, 10]}
>

Done. Thank you for the suggestion.
A new release of dot2tex, version 2.8.7 is now available for download.
You can see the full release notes here:
http://groups.google.com/group/dot2tex-users/browse_thread/thread/39901faaf5b5aa4d

I have not documented the new feature yet, but I have implemented it
as you suggested:

dot2tex.dot2tex(dotdata, format = "positions")


>
> Oh, and a last point: in order to include a test-suite in the upcoming
> dot2tex sage package, I tried running the test-script, and got some
> errors/warnings. Am I doing something wrong?
>

The tests now run if all the dependencies are available. I fixed a bug
that prevented the poltab example from compiling.

Regards,
Kjell Magne Fauske

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sage-combinat-devel" group.
To post to this group, send email to sage-combinat-devel@googlegroups.com
To unsubscribe from this group, send email to 
sage-combinat-devel+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-combinat-devel?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to