Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

#2842 Don't draw invalid svg paths for curved edges #2844

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nathanal
Copy link

@nathanal nathanal commented Aug 25, 2023

Description

Fix svg output in #2842 (one node is inside another) by not drawing the edge when it is truncated too much.

Previously, computeThatThing's condition never failed, as rt was only passed when negative. We now pass the arc length and return a large negative angle if it fails. This should register as excessive truncative and be marked not to be drawn.

Used #2608 and a jumping off point in investigation.

Checklist

  • Merged with master beforehand

Added tests?

  • 馃憤 yes
  • 馃檯 no, because they aren't needed

Simple (but big) gexf file to test some cases testing.zip. It got a bit out of hand, but wasn't too smart (just a straight up permutation of various angles, distances, sizes). Smaller version of the above zip extended_alldir.zip

Nearly all cases can be considered edge cases (i.e. overlapping nodes).

I've pushed a sample of the above examples cases into a unit test.

Added to documentation?

  • 馃憤 README.md
  • 馃憤 API Changes
  • 馃憤 Additional documentation in docs
  • 馃憤 Relevant code documentation
  • 馃檯 no, because they aren鈥檛 needed

Update: the force push was just squashing my commits together

@nathanal nathanal force-pushed the github2842 branch 2 times, most recently from dd01a47 to 016425d Compare August 31, 2023 02:04
@nathanal nathanal marked this pull request as draft September 2, 2023 15:57
@nathanal nathanal marked this pull request as ready for review September 4, 2023 12:15
- Don't draw edge when completely truncated.
- computeThatThing condition previously never failed as rt is negative
- Pass arc angle to computeThatThing for extra precision
- Return large negative value so we know edge is totally truncated
- Don't reposition edge labels when edge totally truncated
- Add edge label edge case for two nodes in the same position
- Don't change angle of arrow if edge totally truncated (avoid NaN in polyline)
- Add "unit" test for svg export of edge cases.
  Added to PreviewExport, not PreviewPlugin, to avoid relying
  on details of plugin set up. Downside: pdf isn't easily tested
  as exceptions are caught too early.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant