Comments (5)
Thanks for the quick reply! Your explanation of how the ordering algorithm works was quite helpful.
We found a workaround by re-ordering a selected annotation to the "top" of the SVG so the label is always visible (and reseting it to its original position when deselecting). This preserves clickability and readability in our use case.
from annotorious.
Hi!
Thanks! Yes, the shuffling is intentional - and I'm afraid there's no way to change it in Annotorious, except by forking it.
Annotorious sorts the shapes by size, and then stacks them so that the largest shape is at the bottom (added to the SVG first), and the smallest shape is at the top (added last). This way, no large shape will overlap a smaller shape, and all the shapes remain clickable.
If forking is an option for you, however: the change would be fairly minimal, I believe. Shouldn't take much more than commenting out this section in the annotation layer (or, alternatively, remove every call to redraw()
).
The other alternative would be to switch to the OpenSeadragon version of Annotorious. This doesn't do any reshuffling, because it handles hit/hover detection in a different way (by querying a spatial index instead of relying on mouse events.)
Hope this helps!
from annotorious.
Hi @rsimon, quick follow-up question:
We switched to the OpenSeadragon version of Annotorious to be able to use zooming. You mentioned that
it handles hit/hover detection in a different way (by querying a spatial index instead of relying on mouse events.)
I just wanted to confirm that the order of .a9s-annotation
elements in the SVG no longer affects hovering and clicking? This seems to be the behavior we observed during testing.
from annotorious.
Hi, yes that's right. The order of the SVG elements in the DOM is irrelevant to hit detection in the OSD version.
from annotorious.
Thanks for confirming! This is really useful, we no longer need to reset annotations "to its original position when deselecting" anymore.
from annotorious.
Related Issues (20)
- Support for multiple `targets` attached to the same `Annotation` HOT 4
- Why the `AnnotationBodyIdentifier` is used? 🤔 HOT 2
- Missing ID for selected annotation in headless mode HOT 1
- Allow using the `Store` methods with the `TextAnnotation` model
- Rename the `AnnotoriousPlugin` cleanup callback `unmount` -> `destroy`
- Make `AnnotoriousPlugin` a generic container for any specific annotation types
- OpenSeadragon: filtering does not work after drawing an annotation HOT 5
- `AnnotoriousPlugin` component doesn't reapply the `plugin` on its change HOT 4
- Want to know why updates go into formatter twice after annotation dragging
- AnnotationBody 'purpose' field not getting auto-complete
- 'ImageAnnotator' only refers to a type, but is being used as a value here.
- I want the editor to support drop-down options, and I want the author to adopt them HOT 1
- Editor positioning problem, eager to know how the editor positioning is dynamically positioned next to the box HOT 2
- An error occurs in anno.addAnnotation(annotation); HOT 3
- More control over React ImageAnnotator div HOT 1
- Safari rendering bug - box around annotation isn't removed HOT 1
- No way to remove an annotation that has no body
- Issues when displaying annotations with SVG <path> selector HOT 5
- Unmemoized `AnnotoriousContext` state forces too frequent re-renders for its children HOT 2
- How to customize more drawing tools? HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from annotorious.