Skip to content

Layout not working after created #61

Open
@gioppoluca

Description

@gioppoluca

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions