Closed matthiasbock closed 11 years ago
I had a look at the code. There are incompatibilities between the d3 layouter nodes array format and that of jSBGN. Furthermore there is a problem with coordinate scaling. Suppose the jSBGN is exported in a larger screen and imported in a smaller one, the graph will appear to be zoomed in and sparse. Another problem with coordinates is that the values that d3 operates on and what biographer exports in the jSBGN are different and a lot of interconversion will have to be done.
I know that for the end user we should fix the bug, but the small improvement does not justify the effort.
I have now circumvented the problem by disabling d3 layout for jSBGN model import completely. This requires imported jSBGN models to be pre-layouted, but I guess we can assume that in practice the models used with BooleSim anyway are exports from previous sessions with BooleSim (and therefore are layouted) or from software, which does export layouted node positions into jSBGN for us.
Exporting a network to jSBGN works; it includes node positions. Example:
However it seems, on import the node coordinates embedded in jSBGN are not used to position the nodes accordingly on the canvas. The positioning appears random instead. They should be though, because the Export dialog says "Export graph and model", which somehow implies that the next time the user imports his or her network the nodes will be where they were placed.
Side note: jSBGN format is apparently currently not recognized by "infer format".