cytoscape / cytoscape-jupyter-widget

Cytoscape.js based network visualizer for Jupyter Notebook
38 stars 14 forks source link

Cytoscape() not generating a cytoscape layout #6

Open sshameer opened 5 years ago

sshameer commented 5 years ago

Hi,

Firstly, thank you for developing this widget.

I'm having trouble getting the widget to work. In your example (WidgetDemo1), according to the figure Cytoscape() results in a layout. When I run my code it does returns a cyjupyter.cytoscape.Cytoscape object, but instead of a cytoscape layout I get a long an alphanumeric string like the one below: Q3l0b3NjYXBlKGRhdGE9eydlbGVtZW50cyc6IHsnbm9kZXMnOiBbeydkYXRhJzogeydpZCc6ICdub2RlIDEnfX0sIHsnZGF0YSc6IHsnaWQnOiAnbm9kZSAyJ319LCB7J2RhdGEnOiB7J2lkJzrigKY=

I also tried it with my own network.

import json
from cyjupyter import Cytoscape

#import network
f_net = open("/home/sanu/Cytoscape_v3.7.1/tempData/PlantCoreMetabolism_v1_2_3.cyjs")
f_style = open("/home/sanu/Cytoscape_v3.7.1/tempData/styles.json")
network = json.load(f_net)
style = json.load(f_style)

Cytoscape(data=network,visual_style=style[0]["style"],layout={"height":"700px"})

and got the following output Q3l0b3NjYXBlKGRhdGE9e3UnZWxlbWVudHMnOiB7dSdub2Rlcyc6IFt7dSdwb3NpdGlvbic6IHt1J3knOiAxMjgwOS40OTEyMzgyNjg1NTgsIHUneCc6IC03NTQwLjQ3NzkzMjE5NzUwNzV9LCDigKY=

Am I missing something. Please help. Thanks in advance.