ObjectProfile / Roassal3

The Roassal Visualization Engine
MIT License
97 stars 52 forks source link

check new libraries for Forcebaselayout #258

Closed akevalion closed 3 years ago

akevalion commented 4 years ago

Review these links and select the useful code for RSForcebaseLayout

https://github.com/cytoscape/cytoscape.js-euler

https://github.com/cytoscape/cytoscape.js-cola

akevalion commented 4 years ago

For https://github.com/cytoscape/cytoscape.js-euler

Euler is similar to RSForceBaseLayout

I used the example https://cytoscape.org/cytoscape.js-euler/ image

And I have created this visualization: http://ws.stfx.eu/2VFW7KZGQKXS image

Euler uses a lot of methods related to animations. But for roassal3 we already have a package to manage this kind of animations.

akevalion commented 4 years ago

For https://github.com/cytoscape/cytoscape.js-cola. This is a connector for a more complex layout https://github.com/tgdwyer/WebCola.

Users of WebCola can use tree.js, cytoscape.js, svg.js or d3js to run 2D or 3D visualizations. This javascript project has:

Typically a Constraint looks like:

{
    "type": "alignment",
    "axis": "x",
    "offsets": [
        {"node": "1","offset": "0"},
        {"node": "2", "offset": "0"},
        {"node": "3", "offset": "0"}
    ]
}

Cola API for this example https://github.com/tgdwyer/WebCola/blob/master/WebCola/examples/unix.html

d3cola
                .avoidOverlaps(true)
                .convergenceThreshold(1e-3)
                .flowLayout('x', 150)
                .size([width, height])
                .nodes(nodes)
                .links(edges)
                .jaccardLinkLengths(150);

Produces image

tinchodias commented 4 years ago

I like from this WebCola example that lines don't overlap over boxes (nodes) as GraphViz. Maybe we can try to implement the A* algorithm to have it in RS3. Sorry if this comment is off-topic.

bergel commented 4 years ago

I am not sure how A* algorithm helps doing a layout. It seems to be an algorithm to search for path no?

tinchodias commented 4 years ago

You are right, I'm not sure if it fits the requirement. I had that idea because maybe after the force layout algorithm finds places for the nodes, then a pass of this algorithm on each edge could the polygon or bezier to avoid overlapping the nodes.

bergel commented 4 years ago

Interesting idea!

akevalion commented 3 years ago

I think we can close this issue