-
Notifications
You must be signed in to change notification settings - Fork 719
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
Support additional link types #174
Comments
Looking at d3-shape's curveStep looks to possibly give us a context-agnostic way to create an orthogonal link. Some useful examples to visualize other curve types:
While curveStep is probably what we would want for an orthogonal link, I could see benefit in curveStepAfter and curveStepBefore. Not sure if we would also need a separate horizontal vs vertical version. |
@hshoff: some progress https://codesandbox.io/s/n3w687vmqj Current using |
@hshoff Take a look at https://n3w687vmqj.codesandbox.io/ We now have step, curve, line, and the existing "diagonal" link types for both cartesian and polar layouts and horizontal or vertical orientations. I broke them out as I'm going to try to find some more time to knock out the |
@techniq wow! looks great, would love to add these to vx |
I've been buried at work lately but I'll try to get a PR soon. I started on the elbow type but having trouble getting the math right. I'll probably wait to implement it until I get a PR for the others out. |
Add support for step, curve, and line links. Issue #174
…potentially support <canvas> in the future. Expose "source" and "target" props for each as well. Issue airbnb#174. Issue airbnb#41
Creating a separate issue to track, mentioned in #172.
It would be nice to support more link types, similar to vega (see tree example, radial tree example), such as:
Orthogonal
Curve
also possible
Elbow (45deg)
Implementation
I'm not sure if all of these should be separate components like
LinkHorizontal
,LinkVertical
, andLinkRadial
(LinkHorizontalOrthogonal
?) or by adding atype
prop (or something) such as<LinkHorizontal type="orthogonal" />
where type could beline
,diagonal
,curve
,orthogonal
,elbow
, etc.I took a quick look at how vega supports the different linkpath types, which are implemented using simple svg path line/curve commands. I envisioned doing something similar, and is typically how I see other d3 implementations, although this would break canvas support (d3 uses it's
context
to abstract the canvas/svg from my understanding. It looks like there is an open issue on d3-shape to add orthogonal support, but there hasn't been any response to the original request.Personally I've only ever used svg with d3, so I would be fine with only support svg. Thinking more about it, I don't see how a react wrapper could produce canvas, except using react-konva or react art.
The text was updated successfully, but these errors were encountered: