Compound nodes cause incorrect mid-target-arrow direction
See original GitHub issueBug report
Environment info
- Cytoscape.js version : 3.2.1
- Browser version : Chrome Version 61.0.3135.4 (Official Build) dev (64-bit)
Current (buggy) behaviour: Mid arrow directions seem to render incorrectly (and inconsistently - not just opposite) when one of the source/target is a compound (parent) node.
Desired behaviour: Render them consistently and correctly
Minimum steps to reproduce Here’s a minimal example: http://jsbin.com/qaciwemefi/9/edit?html,output Notice that two edges are pointing toward node 15, and one is pointing away from it. They should all be pointing away from it - unless I’m terribly mistaken.
And here’s the code since it’s relatively small:
let elements1 = [
{data:{id:1}},
{data:{id:8}},
{data:{id:11}},
{data:{id:15}},
{data:{id:"child", parent:15}}, // comment out this line and then the 15->1 and 15->11 arrow directions will be fixed
{data:{id:"15-1", source:15, target:1}},
{data:{id:"15-8", source:15, target:8}},
{data:{id:"15-11", source:15, target:11}}
];
let cy1 = cytoscape({
container: div1,
elements: elements1,
style: [
{
selector: 'node',
style: {
'content': 'data(id)',
}
},
{
selector: 'edge',
style: {
'width': 3,
'mid-target-arrow-shape': 'triangle',
'arrow-scale':2,
}
}
]
});
Thanks for your work on this incredible library! I’m having so much fun with it.
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Grab compound nodes when a child node is grabbed ...
In my case I have some child node inside compound node, I want to make child node not individually movable and want to...
Read more >DaVinci Resolve Compound Nodes: Efficiently Managing Looks
Let's jump over to the video below for a break down of how to use compound nodes in this way.
Read more >12. Styles — Cytoscape User Manual 3.9.1 documentation
Whether or not nodes are selectable. If this is false, users cannot select nodes. Avoid changing this property directly through the Style panel....
Read more >Shared nodes not being copied inside Compound nodes
Hi, not sure if this is specific to just DR17 (I'm on b8), but let me explain a problem I'm having. On a...
Read more >Compound Node · Documentation - support-thepixelfarm.co.uk
There must also be a pfCreateNode function to define the contents of the compound node. The single parameter to this function is a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Use
curve-style: unbundled-bezier; control-point-distance: 0;
(orcurve-style: straight
in 3.3).Compounds can not use the default haystack edge type, so they fall back on bezier edges. However, bezier edges are bundled. That means they have to share the same direction, and that direction is automatically determined in order to maintain consistency as the graph changes. So basically, you have to use an unbundled bezier for now so that the natural source-target direction is used.
The dist only gets updated for a release.
You need to build yourself from source. I just tested it, and it’s working OK.