iVis-at-Bilkent / sbgnviz.js

A web based visualization tool for process description maps in SBGN
http://www.cs.bilkent.edu.tr/~ivis/SBGNViz_sample_app/
GNU Lesser General Public License v3.0
35 stars 14 forks source link

Statesandinfos refactoring #187

Closed metincansiper closed 6 years ago

metincansiper commented 7 years ago

State variables and units of information objects in SBGNViz can not be serialized to JSON objects (that breaks CWC) because of 2 main reasons:

  1. They include references to their parent nodes and the parent nodes include reference to them. That creates a circular reference.
  2. They are instances of complex JS objects that includes prototyping.

The changes proposed by this PR are made to solve these problems. This PR required making other PRs (with much smaller changes) for chise.js, newt and iVis-at-Bilkent/cytoscape.js. I will create that PRs after this one.

Information about how to use the changed classes are given at the top of classes.js file as a comment.

ugurdogrusoz commented 7 years ago

@royludo Do you mind reviewing this if you get a chance?

metincansiper commented 7 years ago

I also see a syntax error and added its fix (https://github.com/iVis-at-Bilkent/sbgnviz.js/pull/187/commits/68784540b0afb89653bc088fa0f9bb85696fb144) to this PR as well.

royludo commented 6 years ago

@ugurdogrusoz I have mixed feelings about this. Essentially, it forever prevents us from using more structured objects in the element's data. Cytoscape guys didn't design the data field to store complex objects, but still, it worked. And some OO structure would really help organize things better, in my opinion. We lose some useful design possibilities because of these serialization problems.

ugurdogrusoz commented 6 years ago

@kinimesi what do you think?

ugurdogrusoz commented 6 years ago

@royludo You are probably right that we are getting away from a more structured design that you worked hard for but looks like the cyclic dependency introduced by this change is preventing OHSU guys from building their collaborative editor.