Skip to content

Configure minimum space between nodes in dynamic graphs - #1792

Merged
david-yz-liu merged 4 commits into
Courseography:masterfrom
r-weng:investigate-graphviz-attributes
Aug 9, 2026
Merged

Configure minimum space between nodes in dynamic graphs#1792
david-yz-liu merged 4 commits into
Courseography:masterfrom
r-weng:investigate-graphviz-attributes

Conversation

@r-weng

@r-weng r-weng commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Proposed Changes

This pull request uses nodesep to configure minimum space between nodes in dynamic graphs.

This doesn't entirely fix the arrowhead issue I mentioned a few presentations ago (where some arrowheads do not appear properly connected to their respective dotted lines due to the lack of an additional line segment), but it mitigates it. See screenshots below, and notice how (1) the arrow from MAT148H1 to the and node and (2) the arrow from MAT158H1 to the and node change.

...

Screenshots of your changes (if applicable) Screenshot 2026-08-08 at 4 23 01 PM (without `nodesep`) Screenshot 2026-08-08 at 4 21 53 PM (with `nodesep`)

Type of Change

(Write an X or a brief description next to the type or types that best describe your changes.)

Type Applies?
🚨 Breaking change (fix or feature that would cause existing functionality to change)
New feature (non-breaking change that adds functionality)
🐛 Bug fix (non-breaking change that fixes an issue)
🎨 User interface change (change to user interface; provide screenshots) X
♻️ Refactoring (internal change to codebase, without changing functionality)
🚦 Test update (change that only adds or modifies tests)
📦 Dependency update (change that updates a dependency)
🔧 Internal (change that only affects developers or continuous integration)

Checklist

(Complete each of the following items for your pull request. Indicate that you have completed an item by changing the [ ] into a [x] in the raw text, or by clicking on the checkbox in the rendered description on GitHub.)

Before opening your pull request:

  • I have performed a self-review of my changes.
    • Check that all changed files included in this pull request are intentional changes.
    • Check that all changes are relevant to the purpose of this pull request, as described above.
  • I have added tests for my changes, if applicable.
    • This is required for all bug fixes and new features.
  • I have updated the project documentation, if applicable.
    • This is required for new features.
  • If this is my first contribution, I have added myself to the list of contributors.
  • I have updated the project Changelog (this is required for all changes).

After opening your pull request:

  • I have verified that the CircleCI checks have passed.
  • I have requested a review from a project maintainer.

Questions and Comments

I tried playing around with other splines configurations (as listed in the link below), which allow edges to be diagonal or rounded. This fixed the arrowhead issue, but the existing configuration, ortho, looked the cleanest and most consistent with the main graph, especially as the number of nodes and edges increased.

https://graphviz.org/docs/attrs/splines/

I also was not able to use dot attributes to set coordinates for the graph (I don't think it's possible).

@coveralls

coveralls commented Aug 8, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 0

Coverage increased (+0.007%) to 58.602%

Details

  • Coverage increased (+0.007%) from the base build.
  • Patch coverage: 1 of 1 lines across 1 file are fully covered (100%).
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 4286
Covered Lines: 2563
Line Coverage: 59.8%
Relevant Branches: 1009
Covered Branches: 540
Branch Coverage: 53.52%
Branches in Coverage %: Yes
Coverage Strength: 155.62 hits per line

💛 - Coveralls

@r-weng
r-weng requested a review from david-yz-liu August 8, 2026 20:49
@r-weng
r-weng marked this pull request as draft August 8, 2026 20:50
@r-weng

r-weng commented Aug 8, 2026

Copy link
Copy Markdown
Contributor Author

Drafting because I just noticed the MAT137 to or edge 😭

@r-weng

r-weng commented Aug 9, 2026

Copy link
Copy Markdown
Contributor Author

Drafting because I just noticed the MAT137 to or edge 😭

I don't think this can be fixed just by configuring Graphviz dot attributes. The closest I got to fixing the edge and arrowhead issues was changing the splines configuration from ortho to curved, but it looks a bit messy for bigger graphs, as shown below.

Screenshot 2026-08-08 at 9 13 09 PM

@r-weng
r-weng marked this pull request as ready for review August 9, 2026 01:17
@david-yz-liu
david-yz-liu merged commit 501be99 into Courseography:master Aug 9, 2026
4 checks passed
@david-yz-liu

Copy link
Copy Markdown
Contributor

Thanks @r-weng! I appreciate the investigation into this, and I do think the graph looks a bit nicer with the minimum nodesep set. I agreed that the ortho setting was cleanest and most consistent with the existing hand-crafted Courseography graph.

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.

3 participants