Repository navigation
fix(atlas): draw one graph arrow per distinct relationship - #2049
Merged
nathanschmid08 merged 1 commit intoNov 27, 2026
Merged
Conversation
The model keeps one edge per source location, so a page that renders the same component twice gave atlas --graph and inspect --graph two identical arrows, each with its own linkStyle index. Collapse edges by (from, to, kind) before rendering, in both Mermaid and DOT output. When one copy is certain and another only possible, the certain one decides the arrow style, so a proven relationship is not drawn dashed. Closes Avenx-JS#2045 Signed-off-by: Noah Khomer <108771853+noahkhomer18@users.noreply.github.com>
nathanschmid08
self-requested a review
November 27, 2026 13:24
Member
|
@all-contributors please add @noahkhomer18 for code |
Contributor
|
I've put up a pull request to add @noahkhomer18! 🎉 |
Member
|
Hi @noahkhomer18 , Thanks for the PR. I appreciate it very much. Nice to see you at Avenx 😉 I just finished up my review and it looks really good, therefore I will merge your PR now. Thanks again and enjoy the weekend! |
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.
What this changes
renderAtlasGraphnow draws one arrow per distinct(from, to, kind). The model keeps one edge per source location, which is right for the text output and forloc, but the graph drew every one of them, so a page that renders the same component twice got two identicalrendersarrows and twolinkStylelines. Bothavenx atlas --graphandavenx inspect --graphgo through this function, and so does the DOT output.When one copy of a relationship is
certainand another onlypossible, the certain one decides the arrow, so a proven relationship is not drawn dashed just because a weaker copy was found first. Different kinds between the same pair (rendersandimports, say) still get an arrow each.Related issue
Closes #2045
How was this verified?
The real CLI, before and after. I copied
test/fixtures/atlas-app, madecart.page.jsrender<CartList />twice, and ranavenx atlas --graph --focus page:Cart.diff main.txt branch.txt:The duplicate arrow is gone and the
linkStyleindexes stay contiguous. Nothing else in the output changed.New test,
test/unit/atlasGraphDuplicateEdges.test.js: tworendersedges from different lines give one arrow, animportsedge between the same pair keeps its own,linkStyleindexes match the arrows, the DOT output has the same edge count, and apossiblecopy followed by acertainone gives one solid arrow. Withgraph.jsreverted tomainit fails withrepeated component usage draws one renders arrow.npx prettier --checkflags one line ingraph.js(theatlasKindAliasesmap, line 14), which it flags onmaintoo, so I left it alone. The block I wrote and the new test are formatted.Checklist
npm testpasses (unit, integration and system tiers, run one by one above)npm run lintpasses