[annotator-dev] annotations on pages with many images

Randall Leeds tilgovi at hypothes.is
Mon Jun 4 06:10:48 UTC 2012


On Sun, Jun 3, 2012 at 7:53 AM, Klaus E. Werner <keewerner at gmail.com> wrote:
>
> Dear lists,
>
>
> I'm preparing a couple of HTMLs (basically digitized, OCR'ed and proofread
> books) which should be annotatable using YUMA and which will contain many
> images, say between 50 and 300 at a time.
>
> Johnny's site (http://socialreading.cxware.net/) seems to be a working
> example for multiple images annotations, though at the moment there are only
> 2.
>
>
> My questions are:
>
> - are there any other examples for multiple images on a HTML?
>
>
> And more in general:
>
> - would it be wise to load all image annotations on page load?  Probably
> not, because the user anyway sees only 1-2 at a time and has to scroll down
> the text to see the other images, right?
>
> - should YUMA therefore, in a multi-image szenario, load only as soon as an
> image is inside the viewport (difficult to implement) or after a click on or
> below the image? i.e. more or less manually?
>
>
> Many thanks for any input!
>
> --
> Klaus E. Werner
>

As general advice, I would say just load it all at the start and deal
with performance problems when they actually occur. Don't prematurely
optimize.
The overhead of the extra data about the annotations is likely not a
problem until you hit very large numbers. Deal with that when you get
there.

You might load the data, but not manipulate the DOM all immediately.
Perhaps do so in chunks of 10 or 100 to give the browser time to
recalculate layout, repaint and deal with user events so that you
don't block the javascript thread. I think annotator does something
similar with the highlights.

-R




More information about the annotator-dev mailing list