How to export all graph data including position info from cytoscape js graph?

2,854 views
Skip to first unread message

sl yls

unread,
Oct 9, 2014, 2:19:55 PM10/9/14
to cytoscap...@googlegroups.com
I created cytoscape js graphs for my project, but some graphs is too complex to elegantly display. I am thinking whether we can ask people to layout the graph manually and save this graph. My problem is how can we export human manually layout graph? Is anyone who have a good idea? Thanks.

Keiichiro Ono

unread,
Oct 9, 2014, 4:12:07 PM10/9/14
to cytoscap...@googlegroups.com
Here is how:

1. Load your network into Cytoscape 3.1.1 (or 3.2.0 nightly build)
2. Apply layout, move nodes, edit styles, etc.
3. Select File-->Export --> Network and View...
4. Select .cyjs format and name your file
5. Press OK.

This generates a Cytoscape.js-readable JSON file including (x, y)
position of nodes. Optionally, you can export Visual Styles into a
JSON file and use it with the network JSON.

Kei
> --
> You received this message because you are subscribed to the Google Groups
> "cytoscape-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to cytoscape-disc...@googlegroups.com.
> To post to this group, send email to cytoscap...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cytoscape-discuss.
> For more options, visit https://groups.google.com/d/optout.



--
===================================

Keiichiro Ono
http://keiono.github.io/

===================================

Keiichiro Ono

unread,
Oct 9, 2014, 4:20:39 PM10/9/14
to cytoscap...@googlegroups.com
By the way, if you need to export multiple network JSON files at once,
you can use Cytoscape 3.2.0 nightly build and use "Export as
Interactive Web Visualization" option:

This generates web application from your networks. And in data
folder, it has all of your networks in Cytoscape.js-style JSON.

http://wiki.cytoscape.org/Cytoscape_3/UserManual/Publish



OR, you can use cyREST:

http://apps.cytoscape.org/apps/cyrest


Install it from the App store and access the following URL using
node.js, python, R, curl, web browser, etc.

http://localhost:1234/v1/networks.json

This generates array of your networks in Cytoscape.js compatible JSON.


Note that both options require Java 7.


Kei

sl yls

unread,
Oct 15, 2014, 5:11:27 PM10/15/14
to cytoscap...@googlegroups.com
Thanks Kei for your reply, but my question is how to export data from graph in my web graph which was made via cytoscape js library (not cytoscape software). I want to export all node, edge data and their position in the graph.

Keiichiro Ono

unread,
Oct 15, 2014, 7:31:21 PM10/15/14
to cytoscap...@googlegroups.com
That's simpler:

http://js.cytoscape.org/#core/export/cy.json

And this JSON can be used in BOTH cytoscape.js and Cytoscape desktop.

Kei
Reply all
Reply to author
Forward
0 new messages