Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setAnnotations() does not remove existing connections #16

Open
reckart opened this issue Oct 11, 2022 · 1 comment
Open

setAnnotations() does not remove existing connections #16

reckart opened this issue Oct 11, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@reckart
Copy link
Contributor

reckart commented Oct 11, 2022

With the connections plugin installed, calling

      this.recogito.setAnnotations(webAnnotations)

Does not cause existing connections to be removed - e.g. such from a previous call to recogito.setAnnotations(...).

The problem can be worked around using

      for (const connection of this.connections.canvas.connections) {
        connection.remove()
      }
      this.connections.canvas.connections = []
      this.recogito.setAnnotations(webAnnotations)

But tbh, I would expect that recogito.setAnnotations() and recogito.clearAnnotations() would both propagate to the connections plugin and clean up there as well.

@rsimon
Copy link
Member

rsimon commented Oct 11, 2022

Yikes - indeed. Set annotations doesn't currently clear the canvas in the connections plugin:
https://github.com/recogito/recogito-connections/blob/main/src/NetworkCanvas.js#L241-L245

And clearAnnotations isn't currently intercepted by the connections plugin:
https://github.com/recogito/recogito-connections/blob/main/src/index.jsx#L46-L47

Thanks for reporting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants