fix(relationships): draw avatars on graph nodes and fan multi-edges#42
Merged
Merged
Conversation
Two visible issues in the relationship graph, matching how the web viewer handles them. Avatars weren't shown: nodes were plain coloured circles with an initial. Each node's avatar_url is now loaded through the app's configured Coil loader (so relative URLs resolve and the credential-free image client is used), centre- cropped, and clipped to the node circle with the node colour as a ring border. It falls back to the colour + initial while loading or when a node has no avatar. Multiple relationships between the same two nodes drew on top of each other, and their labels stacked at the shared midpoint. Edges that share a node pair are now fanned into quadratic-Bezier curves (a lone edge stays straight), and each sibling's label is nudged along the edge so they separate lengthwise instead of overlapping. Directed arrowheads follow the curve's tangent at the target.
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.
Fixes the two issues reported on the relationship graph, matching how the web viewer handles them.
Avatars weren't shown
Nodes were plain coloured circles with an initial. Each node already carries
avatar_url, so it is now loaded through the app's configured Coil loader (relative URLs resolve viaRelativeUrlInterceptor, and it uses the credential-free image client from #39), centre-cropped to a square, and clipped to the node circle with the node colour drawn as a ring border. It falls back to the colour + initial while loading or when a node has no avatar. Loads run off-canvas intoImageBitmaps and land in a snapshot state map, so the canvas redraws as each arrives.Overlapping multi-edges
Multiple relationships between the same two nodes drew on top of each other (a single straight line) and their labels stacked at the shared midpoint, so "partner / protector / source" piled up. Now:
t), so the labels separate lengthwise instead of colliding at the midpoint. That is what makes them readable on a near-vertical edge, where a purely sideways offset would still overlap the wide label boxes.Verification
:app:assemblePlayRelease :app:testPlayReleaseUnitTestgreen.Not in scope
The force simulation is still O(n^2) on the main thread (tracked separately, #172); this PR is only the two visual fixes.