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

Force directed parameters seems to not have any impact #24

Closed EliotRagueneau closed 4 months ago

EliotRagueneau commented 3 years ago

I am trying to use your layout because it seems absolutely wonderful, but the different parameters related to the force-directed par of the layout seems to have 0 effects on the end result. This is problematic because I have networks really divided, so I would like to increase gravity so that they are more "concentrated".

Without force-directed parameters With drastically different force-directed parameters

Did I do something wrong while using it, or are they simply not working?

ugurdogrusoz commented 3 years ago

@EliotRagueneau Gravity has an effect only within a certain range. A better solution to nicely packing your disconnected components is to use the packing facility supported by the latest CiSE in the "development branch" (not yet released). Please see the "packComponents" option.

Also, you should make sure that "randomize" is true (non-incremental layout, starts from random positions) when you're laying out your graph for the first time! Any succeeding layout where there are any incremental changes to the graph (new nodes/edges, removed nodes/edges), make sure "randomize" is false (incremental layout, respecting current positions).

Component packing works nicely with both incremental and non-incremental layout. However, you need to make sure that you use this "cytoscape-layout-utilities" extension properly as explained in the develop branch README and as applied in the develop branch demo.

EliotRagueneau commented 3 years ago

Thank you so much, it's much better using those options! Screenshot 2021-05-06 at 17 41 09 I believe you are aware of this, but the function for clusters (which is really useful!) doesn't work when you're using packComponents, I guess you will fix that later ^^ (In the meantime I calculate the clusters prior to running the layouts, it's working really well like that).

Develop version also seem to be slower than the master version, but I'm sure once released it's gonna have better performances ^^

Another small problem found is then with compound nodes, when the upper nodes are the clusters, it's a bit broken right now, but once again, I'm sure it will be fixed when you will release all those nice new features! Screenshot 2021-05-06 at 17 44 08

Maybe I could contribute to the project if you need some help, I would be happy to do so in my free time.

EliotRagueneau commented 3 years ago
Actually, after a bit more testing, I can tell you that the performance issue comes from the packComponents option with compound nodes: packComponents: false packComponents: true
compound: false 2985ms 2786ms
compound: true 2767ms 11262ms

Might be hard to optimise that if it is coming from "cytoscape-layout-utilities" :/ Anyway, thank you very much for your answers and your help, my project will be much better thanks to you! For now, I'll just disable the compound option with the cise layout

EliotRagueneau commented 3 years ago

One last issue about the current dev version:

It has a strange behaviour with allowNodesInsideCircle: Screenshot 2021-05-06 at 18 32 28 As you can see, the node spacing inside clusters becomes irregular with my options

{
    name: 'cise',
    fit: true,
    padding: 30,
    allowNodesInsideCircle: true,
    randomize: true,
    packComponents: true
  }

In addition, performances get worse with packComponents

Personnally I will simply not use allowNodesInsideCircle for now, but I just wanted to give you all the strange thing I found so far regarding your current develop version, just in case you were not aware of them.

ugurdogrusoz commented 3 years ago

Thanks for the thorough testing.

EliotRagueneau commented 3 years ago

Hi,

Sorry if I didn't express myself correctly about the clustering, I meant that you allow to put in clusters options either the whole clustering as an array, or a function that provides the cluster id for each node. Well, this function does not work with packComponents, so currently I have to use the array version, and I have to calculate this array before using the layout.

Here's the JSON used to build the data https://pastebin.com/dl/HRe94uJn, the clusters are based on the species (each species is a cluster). Hope this will help you

herencalik commented 3 years ago

Hello,

Thank you for providing us the data, however, the link doesn't seem to be working. Might there be a typo?

EliotRagueneau commented 3 years ago

Is this one working ? https://pastebin.com/HRe94uJn

herencalik commented 3 years ago

Yes, actually both of the links work. In fact, it seems restricted here so VPN solved the problem. Sorry for that.

EliotRagueneau commented 3 years ago

No worries, and thank you for being that responsive!

PS: You're doing a really great job, this layout is really awesome

ugurdogrusoz commented 3 years ago

@EliotRagueneau So, if you turn packing on and provide a function for cluster info, you have these overlapping clusters. But if you turn packing on and provide the cluster info as arrays, this does not happen, correct?

EliotRagueneau commented 3 years ago

No, function for cluster info simply doesn't work with packing. The only way to make it work is by providing cluster info as an array.

Then with the array, no matter the options, I often get clusters inside other clusters, even though it's more easy to spot when you have NodeInsideCircle, since it's complicating even more the layout.

Screenshot 2021-05-07 at 14 34 11 For example, this screenshot has been produced with the following options:

{
    name: 'cise',
    fit: true,
    padding: 30,
    allowNodesInsideCircle: false,
    randomize: true,
    packComponents: true,
    clusters: [
      [
          "EBI-7916335",
          "EBI-7916387"
      ],
      [
          "EBI-1545818",
          "EBI-1545751",
          "EBI-541267",
          "EBI-1545845"
      ],
      [
          "EBI-1545762",
          "EBI-541307",
          "EBI-541321",
          "EBI-4426557",
          "EBI-541366",
          "EBI-4436798",
          "EBI-4424563",
          "EBI-1392127",
          "EBI-541381",
          "EBI-16890309",
          "EBI-16882503",
          "EBI-16946521",
          "EBI-16957889",
          "EBI-1810670",
          "EBI-16886194",
          "EBI-4455632",
          "EBI-16882482",
          "EBI-4431169",
          "EBI-16949315",
          "EBI-16945159",
          "EBI-16957271",
          "EBI-16956496",
          "EBI-16913889",
          "EBI-16882948",
          "EBI-16894943",
          "EBI-16893645",
          "EBI-16950521",
          "EBI-16953214",
          "EBI-4463452",
          "EBI-16753594",
          "EBI-541400",
          "EBI-2257898",
          "EBI-2257975",
          "EBI-16956097",
          "EBI-17066712",
          "EBI-16914575",
          "EBI-16929962",
          "EBI-16754362",
          "EBI-16901618",
          "EBI-16902452",
          "EBI-17080750",
          "EBI-16754134",
          "EBI-4450582",
          "EBI-541600",
          "EBI-541351",
          "EBI-4429530",
          "EBI-4430753",
          "EBI-4432023",
          "EBI-4430765",
          "EBI-4439121",
          "EBI-4424847",
          "EBI-4434651",
          "EBI-4424427",
          "EBI-16756869",
          "EBI-25506855",
          "EBI-25521272",
          "EBI-15681313",
          "EBI-4430993",
          "EBI-4424098",
          "EBI-4426585",
          "EBI-4426168",
          "EBI-4426504",
          "EBI-4427898",
          "EBI-1998719",
          "EBI-1100634",
          "EBI-963686",
          "EBI-1536925",
          "EBI-2119299",
          "EBI-1792431",
          "EBI-4424877",
          "EBI-4426901",
          "EBI-3133156",
          "EBI-531132",
          "EBI-2118417",
          "EBI-3387154",
          "EBI-4443010",
          "EBI-4465325",
          "EBI-4465331",
          "EBI-4430840",
          "EBI-4441246",
          "EBI-979475",
          "EBI-2297412",
          "EBI-4441249",
          "EBI-4424175",
          "EBI-4427398",
          "EBI-4444060",
          "EBI-4426649",
          "EBI-4427424",
          "EBI-4430035",
          "EBI-2292496",
          "EBI-4427395",
          "EBI-4425055",
          "EBI-4453767",
          "EBI-4472393",
          "EBI-4453099",
          "EBI-3133404",
          "EBI-4424482",
          "EBI-4424691",
          "EBI-4424503",
          "EBI-4424157",
          "EBI-307174",
          "EBI-4435148",
          "EBI-4441648",
          "EBI-4449554",
          "EBI-697501",
          "EBI-4446992",
          "EBI-4424568",
          "EBI-4466599",
          "EBI-4454548",
          "EBI-4437877",
          "EBI-4443654"
      ],
      [
          "EBI-15689882"
      ],
      [
          "EBI-1116104",
          "EBI-863137",
          "EBI-1127833",
          "EBI-545828",
          "EBI-1122941",
          "EBI-1118992",
          "EBI-9133821",
          "EBI-1120616",
          "EBI-562488",
          "EBI-541886",
          "EBI-551191",
          "EBI-561722",
          "EBI-1112775",
          "EBI-371008",
          "EBI-370963",
          "EBI-548960",
          "EBI-369221",
          "EBI-542092",
          "EBI-1131877",
          "EBI-545774",
          "EBI-1117994",
          "EBI-1124942",
          "EBI-1127454",
          "EBI-1113447",
          "EBI-1112893",
          "EBI-551481",
          "EBI-369487",
          "EBI-557681",
          "EBI-1117136",
          "EBI-557426",
          "EBI-553321",
          "EBI-369251",
          "EBI-543439",
          "EBI-543939",
          "EBI-544851",
          "EBI-543017",
          "EBI-545956",
          "EBI-543515"
      ],
      [
          "EBI-25567776"
      ],
      [
          "EBI-25601589",
          "EBI-5235612",
          "EBI-22758731",
          "EBI-11523345",
          "EBI-744081",
          "EBI-8099743",
          "EBI-11320284",
          "EBI-1051165",
          "EBI-347996",
          "EBI-6509505",
          "EBI-3905054",
          "EBI-79165",
          "EBI-727004",
          "EBI-2513582",
          "EBI-2548605",
          "EBI-1045507",
          "EBI-2800236",
          "EBI-741977",
          "EBI-723127",
          "EBI-357253",
          "EBI-21776319",
          "EBI-3905236",
          "EBI-355861",
          "EBI-12102178",
          "EBI-7205010",
          "EBI-746103",
          "EBI-77889",
          "EBI-3909537",
          "EBI-6929619",
          "EBI-720214",
          "EBI-747605",
          "EBI-1044712",
          "EBI-524064"
      ],
      [
          "EBI-15633769"
      ],
      [
          "EBI-21397",
          "EBI-21563",
          "EBI-2710",
          "EBI-29427",
          "EBI-26138",
          "EBI-7903",
          "EBI-13224",
          "EBI-2464632",
          "EBI-3809",
          "EBI-22211",
          "EBI-22178",
          "EBI-8648",
          "EBI-2332",
          "EBI-14344",
          "EBI-21449",
          "EBI-7699",
          "EBI-10420",
          "EBI-8603",
          "EBI-8627",
          "EBI-26482",
          "EBI-5222",
          "EBI-8666",
          "EBI-8591",
          "EBI-2989",
          "EBI-24159",
          "EBI-2344281",
          "EBI-28528",
          "EBI-16817",
          "EBI-2343154",
          "EBI-25172",
          "EBI-28706",
          "EBI-912262",
          "EBI-14166",
          "EBI-32965",
          "EBI-8394",
          "EBI-13275",
          "EBI-2447",
          "EBI-29516",
          "EBI-7218",
          "EBI-6475",
          "EBI-9890",
          "EBI-2218",
          "EBI-3027",
          "EBI-8659",
          "EBI-15864",
          "EBI-9182",
          "EBI-9186",
          "EBI-9195",
          "EBI-11476",
          "EBI-19530",
          "EBI-26411",
          "EBI-20212",
          "EBI-28914",
          "EBI-20589"
      ],
      [
          "EBI-21245803",
          "EBI-21245777"
      ],
      [
          "EBI-862771"
      ],
      [
          "EBI-3406532",
          "EBI-191805",
          "EBI-148693",
          "EBI-95916",
          "EBI-174123",
          "EBI-107815",
          "EBI-150802",
          "EBI-15120231",
          "EBI-82519",
          "EBI-186595",
          "EBI-497828",
          "EBI-174007",
          "EBI-88132",
          "EBI-15141584",
          "EBI-15135466",
          "EBI-15109101",
          "EBI-26696235",
          "EBI-15107521",
          "EBI-15106509",
          "EBI-15106535",
          "EBI-15107367",
          "EBI-85165",
          "EBI-15130484",
          "EBI-15107089",
          "EBI-131659",
          "EBI-190674",
          "EBI-167567",
          "EBI-149544",
          "EBI-180189",
          "EBI-151445",
          "EBI-176113",
          "EBI-151014",
          "EBI-101869",
          "EBI-6173284"
      ],
      [
          "EBI-11172266"
      ],
      [
          "EBI-9685715",
          "EBI-9685670"
      ],
      [
          "EBI-2799605"
      ],
      [
          "EBI-4319195"
      ]
   ]
}
EliotRagueneau commented 3 years ago

Hi, I just noticed another odd performace with packComponents: When changing from a force layout to cise layout, it's taking about 3s. When changing from a circular layout to cise layout: it's taking about 40s, most of it from setShifts4PackingComponents, himself due to 2 calls to i.packComponents, according to Chrome performance recorder. I don't know if this help :/

ugurdogrusoz commented 3 years ago

Overlap of components is due to layout utilities extension (see this issue). We hope to improve the performance with both modifications to this extension (see this issue) and with improvements to packing (see this issue). These improvements might take a while though. Will notify as they are done through this issue.

hasanbalci commented 3 years ago

@EliotRagueneau Function for cluster info should be working now with packing in the develop branch. #37

ugurdogrusoz commented 4 months ago

@EliotRagueneau we just released version 2.

EliotRagueneau commented 4 months ago

Thanks a lot !