Bendable links
Hi Daniel, is it possible to draw links that are bended? So when I have a graph where all of the nodes have defined x and y, links and also have defined positions, where they break? I couldn't find it in the documentation.

Or would it be possible to draw some links with arrows and some without arrows (and have not visible nodes between them) to implement that?
Sorry if the question was asked somewhere, I couldn't find any information about that.
You can make curved links using link.type configuration, however I'm not sure if that is exactly what you are looking for.
const config = {
link: {
type: 'CURVE_SMOOTH'
}
}
More info here: https://danielcaldas.github.io/react-d3-graph/docs/index.html#link-type
@terahn Thank you for your answer. I've seen this option but what I actually meant is bending/breaking the line is defined places. Something like defining link this way: { source: "node1" target: "node2" type: "STRAIGHT" breakPoints: [ [x:12, y:10], [x:15, y: 9] ] }
Or, if that's impossible, implementing it by drawing links with hidden nodes between them and without arrows. That's where the second question comes from: can I draw arrows only for some links?
@danielcaldas I'd like to tackle this issue, Add an option for a link to receive array of breakPoints, then make buildLinkPathDefinition draw the link according to its source node (x, y) and its target node (x, y) and the breakPoints, this will work perfectly on static graph.
But when moving nodes around is possible we have two options (I can think of...):
- When a node moves across the graph, draw it again with its source node (x, y) and its target node (x, y) and the
breakPointsreceived. - When a node moves across the graph, call a callback from the user, that receives its new/unchanged source node (x, y), and its new/unchanged target node (x, y) of all the links connected to the moved node. (3. Support both of those options)
What do you think? I guess I want to start with a PR that receives breakPoints for a link, without implementing the callback behavior mentioned, waiting for you input on this :)
Hey, @lironhl let's move this discussion over to the Pull Request. I would also like to ask you to elaborate more on what issues you're facing while dragging nodes.