Comments (4)
Oh-oh... I think this issue appeared in the 1st place because I was using the Annotorious
+ TextAnnotator
components in a wrong way... 👁️👁️👁️
I was trying to use the same annotator instance across mutliple pages at the same time. I thought that I can use filter
to display only relevant annotations on a certain page, but I didn't consider that filter
doens't remove the annos from the positions recalculation
! So each page change my customly made ranges were getting needlesly revived on irrelevant content and destroyed 🤯
And I haven't mentioned the jittering that was happening on a page change when the filter was trying to remove the old highligths and display the new ones not quickly enough...
Morevover, that approach didn't allow me to use a static plugin, leading to all sorts of magic I described above...
So... The solution I found was to force the re-render of the Annotorious
! It destroy the annotator
instance and allows each page work with the annotator from scratch! No more monkey patching of the already monkey patched methods or redundant revivals 🎉
from annotorious.
Ah - sorry. Need to find some time later to read through this in detail. Just briefly (if this is of interest at all!). If you need to work with multiple anno instances in parallel - register common selection or lifecycle handlers, delete/update annotations regardless on which annotator they live etc. - there's a utility that can handle most of the plumbing for you:
https://github.com/annotorious/annotorious/tree/main/packages/annotorious-react-manifold
But as I said: not sure if this is even a use case for you.
from annotorious.
Fortunately, I think that having just a single annotator instance per page should be enought. And it makes the code more straightforward anyway 😅
from annotorious.
I was just wondering "why does the A9S have 2 React implementations?" 😅
But turns out the manifold should be used for handle multiple annotator instances instead...
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
- 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.