Reconfigure Adigraph interface from NetworkX to Latex#5702
Reconfigure Adigraph interface from NetworkX to Latex#5702dschult wants to merge 31 commits intonetworkx:mainfrom
Conversation
vertex -> node, vertices -> nodes PEP8 spacing and tabs pytest function instead of class (class not needed here -- no imports) Moved author info to CONTRIBUTORS.rst as our new standard converted list comprehension done for side-effects to for-loop. switch to f-strings from string-format calls update setup.py to remove conflicts
Also pep8 formatting
Check not multigraph. Add example Change variable name `file` to `latex_code` inline if/else for __init__ setup
rossbar
left a comment
There was a problem hiding this comment.
I've only taken a high-level look so far, focusing mostly on the interface options. I definitely like the functional interface with to_latex and write_latex and prefer it to the OO interface of the Adigraph class. In fact, I'd advocate to keep the Adigraph and AdigraphCollection classes private, at least initially. IMO it makes more sense for the user to be able to set the node/edge attributes on the networkx graph objects then use the functions to convert to the LaTeX output rather than introduce new classes with more interfaces for users to learn.
(matches adigraph and avoids using random seeds in tests
|
I have taken the functional approach for
I think the result is much easier to read and perhaps to understand, though the docs are not checked yet and I'd like to add tests for the many corner cases. Thoughts? |
|
I've cleaned up the docs and added more tests. I think this is ready to merge I'm torn between |
|
I've updated the LaTeX interface to allow either Adigraph output, or TikZ output. TikZ allows any valid tikz options, with inputs for
I'd like feedback on whether to include both of these, or only the TikZ version. The only advantage I can think of for the adigraph interface is that you can store the values in different attributes on each node or edge. You only get 2 style features: color, width. But you can store them as "blue" and 3 rather than having to store them as a combined single attribute for options: "blue,line width=3". Also, if anyone has suggestions for TikZ features to add/test that would be cool too. |
|
I'm going to close this with a redirection to #6238 |
This builds on PR #5639 and proposes a new interface focusing on
I have put it in a separate PR because I want feedback on the interface. I like the functions here, but handling the options for node_color/edge_width/etc feels kludgy.
With two PRs we can more easily compare the two interfaces.
Suggestions?
The Adigraph interface is split into two classes: