Repository navigation
Issue #99: Add label_type option to Express API draw() - #111
Merged
john-boyer-phd merged 3 commits intoOct 13, 2026
Merged
john-boyer-phd merged 3 commits into
john-boyer-phd merged 3 commits into
Conversation
Adds label_type ('default', 'label', 'index') to PGraph.draw() and planarity.draw(). 'index' labels vertices with the numeric indexes used by ascii(); other values raise ValueError. Includes tests and an example.
…o planarity_functions.py Co-authored-by: Aric Hagberg <aric.hagberg@gmail.com>
john-boyer-phd
approved these changes
Oct 13, 2026
john-boyer-phd
left a comment
Member
There was a problem hiding this comment.
Thank you for adding this Aric, it's delightful to have the flexibility to get an image version of the textual rendition. Although I accidentally omitted mentioning it in the issue, I added generating this new image variant to the express API example draw.py (and I spruced up what it says when run on the command line). I also replaced your label_type docstring in planarity_functions.py with your better version that was in planarity.pyx. I added a co-authored-by line because it was your docstring that I copied over ^_^
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds label_type ('default', 'label', 'index') to PGraph.draw() and planarity.draw(). 'index' labels vertices with the numeric indexes used by ascii(); other values raise ValueError. Includes tests and an example.
Addresses #99
Type of change
Please check only relevant options:
Changes
Added
Updated
planarity/express/planarity.pyx-PGraph.draw()gains alabel_typeparameter (default'default').'default'and'label'show the original vertex labels as before;'index'shows the numeric vertex indexes.planarity/express/planarity_functions.py-planarity.draw()acceptslabel_type.tests/test_express_api_draw_labels.py- Tests for eachlabel_typevalue at both the function and method level.Testing
pytest -vv), including the newlabel_typetests