Skip to content

Draw functions wraps display - #8255

Open
mjschwenne wants to merge 14 commits into
networkx:mainfrom
mjschwenne:draw-wraps-display
Open

mjschwenne wants to merge 14 commits into
networkx:mainfrom
mjschwenne:draw-wraps-display

Conversation

@mjschwenne

Copy link
Copy Markdown
Contributor

This PR updates the following functions to use display for the actual drawing.

  • draw_networkx_nodes
  • draw_networkx_edges
  • draw_networkx_labels
  • draw_networkx_edge_labels

The goal here is to avoid having two implementations for all the drawing code but having all the draw functions use display. To accomplish this, I needed to add a series of compatibility keyword arguments to change things like the returned object and force display to always use fancy arrow patches.

With regard to breaking changes, nearly everything should be internal to the functions except that from draw_networkx_edges, two attributes (edge width and edge color) may now return arrays with one more dimension then before, i.e. [3, 3, 3] instead of 3. I'm not sure what caused the change, but since attributes are individualized now I tried to pass a scalar if possible but it didn't change how the widths and colors were reported. Looking at the changes in the test file should provide a more concrete example of this change.


Unfortunately, I think that my time as a networkx maintainer is at its end. My graduate studies are currently preventing me from being able to spend any time on networkx, even attending the developer meetings, and will be for a long time. I will try to be available for bug fixes on the code that I've contributed, but it's hard to make any guarantees.

I've learned a lot about open source software, and how to use and manage large source code repositories from working with networkx and the excellent team of maintainers on the project.

@mjschwenne mjschwenne added type: Maintenance Visualization Related to graph visualization or layout close ? and removed close ? labels Sep 6, 2025
@dschult

dschult commented Sep 6, 2025

Copy link
Copy Markdown
Member

Thanks @mjschwenne!!
Sorry to hear you will be out of action here for a long time. Best wishes on all your future projects! We'll be watching your career from afar. :) Thanks for all you've done!

Comment thread networkx/drawing/tests/test_pylab.py Resolved
@rossbar

rossbar commented Sep 8, 2025

Copy link
Copy Markdown
Contributor

Sorry to hear you will be out of action here for a long time. Best wishes on all your future projects! We'll be watching your career from afar. :) Thanks for all you've done!

Wholeheartedly agree - thanks for all your contributions @mjschwenne ! And if you're ever looking for a way to procrastinate, say while authoring a thesis, NX will always be around 🙃

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: Maintenance Visualization Related to graph visualization or layout

Development

Successfully merging this pull request may close these issues.

5 participants