eeditiones / tei-publisher-components

Web components used by TEI Publisher and apps generated by it
https://cdn.tei-publisher.com/
GNU General Public License v3.0
18 stars 14 forks source link

FR: thumbnail strip with labels for pb-facsimile #85

Open tuurma opened 2 years ago

tuurma commented 2 years ago

extend pb-facsimile reference strip feature with a way to specify a label for each of the thumbnails, like it is done in e.g. Ginzberg edition

image
line-o commented 1 year ago

Notes from our discusssion

Strip shows all facsimiles given to it

List of thumbnails

Communicates with OSD

Must allow to pass in additional metadata

Must be placeable at a different locations on the page

The new custom-element <pb-facsimile-strip [base-uri=“{base}”]>

We were looking at two use cases:

tuurma commented 1 year ago

Use cases:

Source of facsimiles and their labels

facs-strip as an overview: all facsimiles available in the current transcription fragment

facs-strip as edition navigation

Let's imagine an edition organized in lengthy chapters (like Bible). The document view is organized with facing transcription/facsimile panels and page by page navigation. Nevertheless, to assist navigation, thumbnails strip with opening pages for each chapter is available at all times at the bottom.

Organization of the strip

css properties:

linking/events sent from the thumbnail

other concerns

JoernT commented 1 year ago

may i suggest to name the component 'pb-facs-thumbs'? '-strip' is a bit underspecified IMO

JoernT commented 1 year ago

further i suggest to create some usage examples (along with possible attributes)- how will the element used on the page? This avoids confusion during development.

e.g.

<pb-facs>
    <pb-facs-strip slot="top"></pb-facs-strip>
</pb-facs>

or

<pb-facs id="my-facs">

</pb-facs>
 <pb-facs-strip viewer="my-facs"></pb-facs-strip>

i guess containment (first example) is more sensible and eases the positioning. However the positioning would be rather an enhancement to <pb-facs> providing appropriate slots (left, right, top, bottom) that a part of <pb-facs-strip.

Hope that makes sense

line-o commented 1 year ago

name the component 'pb-facs-thumbs'

Naming thing is hard, so we should think about a good name. I think your suggestion does make sense but I also think that strip as in comic-strip is well understood as a series of images.

I would think that thumbs is better if we want to add a grid view.

line-o commented 1 year ago
<pb-facs>
    <pb-facs-strip slot="top"></pb-facs-strip>
</pb-facs>

Very interesting suggestion @JoernT - I like it for easy placement. I believe the goal is to also be able to put the thumbnails view anywhere on the page. Definitely the pb-facs-strip can exist on a page of its own without a pb-facs-viewer as a means of navigating a text. @tuurma @wolfgangmm did I get that right?

JoernT commented 1 year ago

Even if contained in a slot it could be positioned anywhere with position=fixed.

And i agree that the components should at least be thought of as being independent of pb-facs

tuurma commented 1 year ago

Typical markup when the list of thumbnails is retrieved from the pb-view, so the same as the list that pb-facsimile gets

         <main>
            <pb-view id="view1" src="document1" 
               subscribe="transcription" emit="transcription" 
               wait-for="#facsimile #thumbnails"/>
            <pb-facsimile id="facsimile" base-uri="https://apps.existsolutions.com/cantaloupe/iiif/2/" 
               subscribe="transcription"/>
            <pb-image-strip id="thumbnails" base-uri="https://apps.existsolutions.com/cantaloupe/iiif/2/" 
               subscribe="transcription" emit="transcription"
               layout="horizontal" label-position="top"/>

         </main>
tuurma commented 1 year ago

Markup example when the list of thumbnails comes from an API endpoint and there's no facsimile viewer as such, thumbnails act as a navigation control

         <main>
            <pb-view id="view1" src="document1" 
               subscribe="transcription" emit="transcription" 
               wait-for="#facsimile"/>
            <pb-load id="references" source="api/thumbnails/{doc}" 
               auto="auto"
               load-once="load-once"
               emit="transcription"
               wait-for="#thumbnails"/>
            <pb-image-strip id="thumbnails"  
               base-uri="https://apps.existsolutions.com/cantaloupe/iiif/2/"
               emit="transcription"
               layout="horizontal" label-position="top"/>
         </main>
tuurma commented 1 year ago

Re naming @joern @juri, pb-facsimile already calls it reference-strip, following OpenSeaDragon's convention, so I'd perhaps keep it. It's more neutral than facsimile or thumbs.

wolfgangmm commented 1 year ago

image

pb-facs-strip reacts to the same events as pb-facsimile. Both components are independent, i.e. they can appear alone on a page and manage their own lists of facsimiles.

The existing code which causes pb-facsimile to scan for images upon pb-update event is removed!

Event handling

Backwards compatibility

Should not be an issue as we plug into existing events. Users should not notice the change. Just updating pb-components will switch them to the new event flow.

juri commented 1 year ago

Re naming @joern @juri, pb-facsimile already calls it reference-strip, following OpenSeaDragon's convention, so I'd perhaps keep it. It's more neutral than facsimile or thumbs.

Wrong Juri. Hi again, @line-o!

line-o commented 1 year ago

Moi @juri

wolfgangmm commented 1 year ago

Specify label on pb-facs-link, simple case:

<pb-facs-link facs="my-image.tif" label="Green Elephant">Page 14</pb-facs-link>

Complex case: use template to allow block-level content:

<pb-facs-link facs="my-image.tif">
    Page 14
    <template class="label">
        <h3><pb-link path="other-doc.xml">Green Elephant</pb-link></h3>
        <p>An image of a green elephant</p>
    </template>
</pb-facs-link>
line-o commented 1 year ago

@wolfgangmm I would assume that the image strip component also listens on pb-show-annotation events by others (say: click on a pb-facs-link) emitted on the channel its subscribed to in order to highlight the currently shown facsimile.

line-o commented 1 year ago

@wolfgangmm Very good schematic BTW. That makes it easier to reason about. We also haven't finished the discussion on how the image strip component is notified of the list of pb-facsimile-links that are present in a pb-view.

line-o commented 1 year ago

or is that with pb-load-facsimile?

wolfgangmm commented 1 year ago

@line-o yes, pb-facs-link emits pb-load-facsimile upon initialization to inform the pb-facsimile and/or pb-facs-strip about the existance of this image.

And also yes, pb-facs-strip could react to pb-show-annotation to highlight the current thumb.