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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Graph edges are visible through the nodes in the background #2431

Closed
fbarl opened this issue Apr 6, 2017 · 0 comments · Fixed by #2795
Closed

Graph edges are visible through the nodes in the background #2431

fbarl opened this issue Apr 6, 2017 · 0 comments · Fixed by #2795
Assignees
Labels
bug Broken end user or developer functionality; not working as the developers intended it component/ui Predominantly a front-end issue; most/all of the work can be completed by a f/e developer

Comments

@fbarl
Copy link
Contributor

fbarl commented Apr 6, 2017

edges-rendered-over-nodes

Two solutions that came to my mind so far:

  1. Clipping the edges so that they are only rendered outside of the shapes they connect. The idea sounds simple, but in practice I see three obstacles that added together show the deficiency of this approach:
    a. SVG outward clipping is not that straightforward and it would require us to express rect and circle elements as paths.
    b. It also sounds like a render-heavy thing to do, clipping every edge with (at least) two different paths.
    c. For this to work perferctly, we'd actually also need to clip the edge with all the nodes that intersect its path, or potentially all the nodes, since it's not easy to say which ones are on its path :/
  2. Another approach would be to never actually change the node shape opacity, but to either change their colors to better match the background or to add a non-reactive semi-transparent DOM element between the background and foreground nodes. Either way, the rendering order should then be something like background edges -> background nodes -> foreground edges -> foreground nodes so that the foreground edges are not shown behind the background nodes. Since we can't explicitly control the rendering order, but it follows implicitly from the SVG DOM elements order, this would require breaking the current grouping of nodes vs. edges and making both of these render in a mixed order from one component. The challenge is how to mix them in a React-friendly way, so that e.g. their motion doesn't break when they get reordered, but so far this looks doable!
@fbarl fbarl added accuracy Incorrect information is being shown to the user; usually a bug bug Broken end user or developer functionality; not working as the developers intended it component/ui Predominantly a front-end issue; most/all of the work can be completed by a f/e developer labels Apr 6, 2017
@fbarl fbarl self-assigned this Apr 6, 2017
@rade rade removed the accuracy Incorrect information is being shown to the user; usually a bug label May 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Broken end user or developer functionality; not working as the developers intended it component/ui Predominantly a front-end issue; most/all of the work can be completed by a f/e developer
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants