vue-cytoscape icon indicating copy to clipboard operation
vue-cytoscape copied to clipboard

Layout not working after created

Open gioppoluca opened this issue 4 years ago • 1 comments

I'm adding nodes in the "created" hook of VUE after an API call. I execute the:

this.$refs.cyRef.instance.layout({
        name: 'breadthfirst',
        avoidOverlap: true, // prevents node overlap, may overflow boundingBox if not enough space
        directed: true,
      }).run();
this.$refs.cyRef.instance.resize();

right after the last node added but nothing happens If I add a new node through a button and reapply the layout I get the layout applyed, but at the "created" the nodes are all piled up in the same spot. How is possible to make cytoscape react to the population of nodes coming up from API at the start of a page?

gioppoluca avatar Jul 09 '20 17:07 gioppoluca

Hi, could you try this proposed solution? https://github.com/rcarcasses/vue-cytoscape/issues/57#issuecomment-684045652

daddycocoaman avatar Aug 31 '20 21:08 daddycocoaman