-
Notifications
You must be signed in to change notification settings - Fork 477
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
Implement SvgLayersGroup and SvgEdgesLayer in plexus #419
Implement SvgLayersGroup and SvgEdgesLayer in plexus #419
Conversation
Signed-off-by: Joe Farro <joef@uber.com>
Signed-off-by: Joe Farro <joef@uber.com>
Signed-off-by: Joe Farro <joef@uber.com>
Signed-off-by: Joe Farro <joef@uber.com>
Signed-off-by: Joe Farro <joef@uber.com>
Codecov Report
@@ Coverage Diff @@
## master #419 +/- ##
==========================================
- Coverage 91.6% 91.58% -0.03%
==========================================
Files 176 176
Lines 3991 3991
Branches 920 920
==========================================
- Hits 3656 3655 -1
- Misses 297 298 +1
Partials 38 38
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly minor points, but one more significant question about how a pure component wrapper would affect setOnEdge
in SvgEdgesLayer.tsx
. That question is about a TODO so it doesn't affect this PR per se, but may impact the next PR.
setOnContainer: { style: { cursor: 'default', opacity: 0, strokeWidth: 4 } }, | ||
// eslint-disable-next-line no-console | ||
setOnEdge: (...args) => ({ | ||
onMouseOver: () => this.onEdgeEnter(args[0]), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you only want one arg, why not remove the rest from above and the [0]
from here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or does TS complain if the length of the prop doesn't match?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call. Will do in the next PR.
Implement SvgLayersGroup and SvgEdgesLayer in plexus Signed-off-by: vvvprabhakar <vvvprabhakar@gmail.com>
Which problem is this PR solving?
Adding the components for rendering edges to the budding layer functionality in plexus.
Short description of the changes
Add components for rendering edges to plexus:
SvgDoc
- An SVG document, this will be used by other componentsSvgLayersGroup
– A group of layers, right now it only supports the edges layerSvgEdgesLayer
– A layer of edgesSvgDefEntry
– The definition of markers, for arrow heads on the end of an edge (or at the start)SvgEdge
– The edges, themselvesAlso, add the util type
TNonEmptyArray
.Examples from the demo
↓ Layer group version
Using a layer group to render visible edges and then a layer of edges above that layer with a wider but transparent stroke to catch mouse events over a larger UI element.
↓ Standalone layer version
Configuring the graph using an edge layer, directly, without a wrapping
SvgLayersGroup
.Note: If there is more than one layer it's more efficient to use the group so the layers are transformed all at once instead of one at a time (for zoom).
Note: This version uses
neato
edges.