iVis-at-Bilkent / cytoscape.js-cise

An implementation of the circular layout algorithm by Dogrusoz et al. as a Cytoscape.js extension
MIT License
31 stars 13 forks source link

Error if there is only one small cluster #36

Closed canbax closed 3 years ago

canbax commented 3 years ago

I'm using the below layout options.

{
    "name": "cise",
    "clusters": [
        [
            "n2",
            "n1045152",
            "n1076797",
            "n1045573",
            "n1045238"
        ]
    ],
    "randomize": false,
    "animate": "end",
    "refresh": 10,
    "animationDuration": 500,
    "fit": true,
    "padding": 30,
    "nodeSeparation": 10,
    "idealInterClusterEdgeLengthCoefficient": 1.4,
    "allowNodesInsideCircle": true,
    "maxRatioOfNodesInsideCircle": 0.1,
    "springCoeff": 0.45,
    "nodeRepulsion": 4500,
    "gravity": 0.25,
    "gravityRange": 3.8,
    "packComponents": true
}

with the graph attached as a JSON file small-graph.txt

I get the error below.

core.js:6210 ERROR TypeError: Cannot read property 'getInnerNodePushCount' of undefined at CiSELayout.clusterEnlargementCheck (cytoscape-cise.js:2053) at CiSELayout.runSpringEmbedderTick (cytoscape-cise.js:2031) at Layout.tick (cytoscape-cise.js:3735) at tick (cytoscape-cise.js:4396) at multitick (cytoscape-cise.js:4420) at Layout.run4state (cytoscape-cise.js:4211) at Layout.run (cytoscape-cise.js:4229)

Please also note that I'm calling eles.layout on all the existing elements.

smarek commented 3 years ago

Do you use master or devel branch? I've just hit this with allowNodesInsideCircle: true, on devel, not happening with this setting set to false

hasanbalci commented 3 years ago

We make the development in develop branch and from time to time we merge it to master branch and release the extension. This issue is currently valid for develop branch.

smarek commented 3 years ago

@hasanbalci thank you for confirmation, i've just been trying to test your solution in #28 and hit this, so I wanted to point out the possible scope of this issue.

ugurdogrusoz commented 3 years ago

Seems fixed. @canbax please verify and close.

canbax commented 3 years ago

Thank you. I no longer see this error.