Skip to content

Edges appending to only one instance of Svelvet container #513

@gonzaloaune

Description

@gonzaloaune

Description

If you have more than one Svelvet app container and you have Edges on your Nodes, the Edges are only appended to the first instance of the Svelvet app due to this line

const newContainer = document.querySelector(`.svelvet-graph-wrapper`);

Reproduction

https://stackblitz.com/edit/vitejs-vite-3df9v8?file=package.json,src%2FApp.svelte

  1. Create 2 instances of Svelvet apps with Edges, Anchors and Nodes
  2. See the first one will have double the Edges
  3. See the subsequent instances of Svelvet apps not drawing the Edges

System information

svelte: ^4.2.12 => 4.2.12
svelte-loader: ^3.2.0 => 3.2.0
svelvet: 10.0.2 => 10.0.2

Additional information

No response

👨‍👧‍👦 Contributing

  • 🙋‍♂️ Yes, I'd love to make a PR to fix this bug!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions