cytoscape / py2cytoscape

Python utilities for Cytoscape and Cytoscape.js
https://py2cytoscape.readthedocs.io
MIT License
178 stars 45 forks source link

cyclient.network.export not returning position of nodes #98

Open maurodlt opened 4 years ago

maurodlt commented 4 years ago

Cytoscape: 3.7.2

CyRest: v1

Java: 1.8.0_232

I am exporting my cytoscape network to a file, so I can open it in a browser using cytoscape.js.

However, the file that the cytoscape.network.export method outputs does not contain the position of the nodes. Primarily, I was just recalculating their position using cytoscape.js, but this workaround is not working properly.

Shouldn't the cytoscape.network.export method also return the position of the nodes?

Thanks!

Code: cytoscape.network.export(OutputFile=saveFileName, options='cyjs')

error: returning file

var networks = {"From cyREST": { "format_version" : "1.0", "generated_by" : "cytoscape-3.7.2", "target_cytoscapejs_version" : "~2.1", "data" : { "shared_name" : "From cyREST", "name" : "From cyREST", "SUID" : 32610, "__Annotations" : [ ], "selected" : true }, "elements" : { "nodes" : [ { "data" : { "id" : "32815", "shared_name" : "bn:03304206n", "peso" : 1.0, "name" : "bn:03304206n", "SUID" : 32815, "dicionario" : "fluorescence+spectrum", "id_original" : "bn:03304206n", "selected" : false } }, { "data" : { "id" : "32814", "shared_name" : "bn:03690097n", "peso" : 1.0, "name" : "bn:03690097n", "SUID" : 32814, "dicionario" : "pathway", "id_original" : "bn:03690097n", "selected" : false } }, { "data" : { "id" : "32813", "shared_name" : "bn:00091165v", "peso" : 1.0, "name" : "bn:00091165v", "SUID" : 32813, "dicionario" : "opens", "id_original" : "bn:00091165v", "selected" : false } }

what I expected :

var networks = {"From cyREST": { "format_version" : "1.0", "generated_by" : "cytoscape-3.7.2", "target_cytoscapejs_version" : "~2.1", "data" : { "shared_name" : "From cyREST", "name" : "From cyREST", "SUID" : 7105, "__Annotations" : [ ], "selected" : true }, "elements" : { "nodes" : [ { "data" : { "id" : "7182", "shared_name" : "bn:00059470n", "peso" : 1.0, "name" : "bn:00059470n", "SUID" : 7182, "dicionario" : "transplantation", "id_original" : "bn:00059470n", "selected" : false }, "position" : { "x" : 119.07734971186693, "y" : -94.44902563095093 }, "selected" : false }, { "data" : { "id" : "7181", "shared_name" : "bn:01361897n", "peso" : 1.0, "name" : "bn:01361897n", "SUID" : 7181, "dicionario" : "precursor+cell", "id_original" : "bn:01361897n", "selected" : false }, "position" : { "x" : 124.65753464839037, "y" : -37.36738348007202 }, "selected" : false }