cytoscape / cytoscape.js

Graph theory (network) library for visualisation and analysis
https://js.cytoscape.org
MIT License
10.09k stars 1.64k forks source link

Calling cytoscape with a json containing compound nodes causes TypeError #806

Closed jhonatandarosa closed 9 years ago

jhonatandarosa commented 9 years ago

Steps to reproduce:

  1. Save a json from some graph with compound nodes (http://jsbin.com/gist/5b192c88616af2f75344?js,output)
  2. load the saved json ( $('#cy').cytoscape(JSON.parse(json)))

TypeError occurs Uncaught TypeError: Cannot read property 'bypass' of undefined

The property giving the error was height.

maxkfranz commented 9 years ago

Can't reproduce exactly; maybe this is related? https://github.com/cytoscape/cytoscape.js/issues/813

jhonatandarosa commented 9 years ago

I think it was related. With the code from 2.3.8 on the debug page it occurs, but can't reproduce with the code from master too

maxkfranz commented 9 years ago

I'm getting other errors though when I go through steps like on #813. I suspect there is another issue with style serialisation and/or style application on compound nodes in specific cases...

maxkfranz commented 9 years ago

I think you can workaround the issue for now by using your own, separate JSON style and assigning with that to initOptions.style in every instance. The serialised one is going down a path with a bug, it seems.

maxkfranz commented 9 years ago

Also related: #817

I think these should all fix the issue overall.

Would you please try master or this snapshot and confirm it goes OK for you?

Snapshot: http://js.cytoscape.org/download/cytoscape.js-snapshot-8631d477ec-1422987551340.zip

jhonatandarosa commented 9 years ago

Sure, I can test it tomorrow morning.

maxkfranz commented 9 years ago

Cool; closing for now since it works for me and I want to have the milestone ready for release ASAP.

We can reopen if you notice anything wrong. Thanks

jhonatandarosa commented 9 years ago

Thanks Max. It works perfectly

maxkfranz commented 9 years ago

Good; time to release then