简体   繁体   中英

Cytoscape.js layout not running

I can't make layout running from scipt. I added these lines

var lay = cy.layout({name:'grid'})
lay.run()

But nothing happens. If I manually go to a browser console after page rendering and run that same commands everything works. I expect this to be a newbie JS question so any direction towards relevant info is also appreciated.

这是运行布局的简单一行语句,如下所示。

cy.layout({ name: 'circle' }).run();

Looks like layout should be synchronized with graph placement, for example

$.getJSON(
  "http://path/to/json-with-nodes",
  function (data) {
    cy.json(data);
    lay = cy.layout({name:'random'});
    lay.run();
  }
);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM