Repository navigation
fix: highlight_edge, highlight_path and highlight_vertex in 3D - #71
Merged
Merged
Conversation
highlight_edge asked for the artist of a 2D axes whatever the axes were, so on a 3D graph it added a flat FancyArrowPatch to a 3D axes and the figure could not be drawn (highlight_path therefore failed too, and worked in 0.6.5): the dimension is now that of the axes. highlight_vertex drew its marker with plt.plot(x, y), which on a 3D axes is at z = 0: it uses the z of the vertex. A 3D graph plotted with force_2d is highlighted in 2D. There were no tests of highlighting in 3D. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 18 |
| Duplication | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #71 +/- ##
==========================================
+ Coverage 97.28% 97.54% +0.26%
==========================================
Files 4 4
Lines 1581 1586 +5
==========================================
+ Hits 1538 1547 +9
+ Misses 43 39 -4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Highlighting on a 3D graph did not work in 1.0, although
highlight_pathdid in 0.6.5. Found while checking that plotting is unchanged by the lazy-import change (#70): the 2D figures I rendered before and after were pixel-identical, but 3Dhighlight_pathraisedAttributeError: 'FancyArrowPatch' object has no attribute 'do_3d_projection'in both, so it predates that PR.Cause
highlight_edgepassed the dimension2to_edge_artistwhatever the axes were, so on a 3D graph a flatFancyArrowPatchwas added to a 3D axes. Adding it succeeded; drawing the figure raised.highlight_pathcalls it. (This came in with the arrows in feat: plot() draws arrowheads, parallel edges and loops; clearer option names #51; 0.6.5 drew lines.)highlight_vertexusedplt.plot(x, y), which on a 3D axes puts the marker at z = 0.Fix
3 if ax.name == "3d". So a 3D graph plotted withforce_2d=Trueis highlighted in 2D.highlight_vertexplots[x], [y], [z]on a 3D axes.Tests
There were none of highlighting in 3D.
tests/test_highlight_3d.pydraws the figure (that is where it failed) for both kinds of graph: an edge, a loop, a parallel edge, a path (checked for the artists it adds), a vertex (at its z) and several by name, aforce_2dplot; and the 2D vertex marker and edge are unchanged.771 tests pass, mypy clean. The eight figures I rendered for the comparison: the five 2D ones are pixel-identical to before, the 3D ones that failed now draw.
🤖 Generated with Claude Code