-
-
Notifications
You must be signed in to change notification settings - Fork 45
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
Cannot read properties of null (reading 'removeChild') #174
Comments
Hi, hm, hard to tell what's going on there. But in any case: you would't change anything about the annotation. On the one hand because the annotation object isn't directly tied to the SVG; on the other hand, the internal state is (roughly...) immutable. Whatever you get back through the API is just clones of the data objects. If you want to change an annotation, you'd need to alter the annotation like above, but then re-add the annotation using |
@dianamarginean note sure what the use case is here and what you really are trying to accomplish, but I'm pretty sure you can't just swap the SVG from the DOM element, the annotation is an internal structure/object and the SVG (rendered) is just its representation. What we do is something like this (works but might not be the prettiest code!), Get a current one and modify (or start from scratch), (see Also, DOM wise: Existing SVGs can not be modified (most of the time) via simply replacing a value/string. There is a whole SVG way. See here https://github.com/esmero/format_strawberryfield/blob/97e4111829bb8fba388e713ba26a7ae636dc8f17/js/iiif-openseadragon_strawberry.js#L233-L240 |
Thanks @DiegoPino, yes that's exactly the right way to do it. Also reminds me - I really need to check your OpenCV features! (And in general: good to see you around here :-) |
thank you guys |
Hi @dianamarginean since you are using Annotorious with OSD in Angular can you help me with my problem? |
hi.
I'm using Annotorius with OSD in my angular project and come across the following error.
So this happened after I added an event on mouse move where I get the currently selected annotation, change its svg and then select the annotation again( this last step was added only because the changes were not visible just only after the selection was made. I don't know why...)
Any Ideas how to get rid of the error or how to change a svg in real time from ts file?
The text was updated successfully, but these errors were encountered: