cytoscape / cytosnap

A Node.js package that renders images of Cytoscape.js graphs on the server using Puppeteer
MIT License
58 stars 11 forks source link

`cose` layout doesn't work #15

Closed n-kort closed 5 years ago

n-kort commented 7 years ago

The graph does not render properly when using the cose layout:

cose

This image was generated by the test runner, the nodes are all grouped at 0x0.

Any tips on getting this to work?

maxkfranz commented 7 years ago

Have you specified initial positions or used randomize: true? Force-directed layouts tend not to work with all nodes starting at (0, 0).

n-kort commented 7 years ago

The randomise option is set, but the results are the same either way. Don't think it's possible to set initial positions in our case.

maxkfranz commented 7 years ago

Cose works on Node, but it looks like it doesn't work on Phantom. Maybe webworker support is bad in Phantom. It might be better with 3.0

maxkfranz commented 7 years ago

https://github.com/cytoscape/cytosnap/issues/16

maxkfranz commented 7 years ago

For now, you could run CoSE on a headless instance of Cytoscape (on Node) and then just pass in cy.elements().jsons() to Cytosnap with the preset layout.

n-kort commented 7 years ago

Thanks @maxkfranz, that seems to work a lot better. Oddly I couldn't get the nodes to actually stay within the bounds I'd set... Have witched to the spread layout instead.