zenodo / zenodo-rdm

Zenodo, powered by InvenioRDM
https://zenodo.org/
GNU General Public License v2.0
36 stars 25 forks source link

mirador: added annotations support for previewer #879

Closed 0einstein0 closed 2 weeks ago

0einstein0 commented 2 weeks ago

Closes Issue https://github.com/zenodo/zenodo-rdm/issues/876

InvenioRDMAdapter

/** */
export default class InvenioRDMAdapter {
  /** */
  constructor(canvasId, annotations) {
    this.canvasId = canvasId;
    this.annotations = annotations
    this.readOnly = true;
  }

  /** */
  get annotationPageId() {

    // assume for now that canvas.jpg has an associated canvas.jpg.short.wadm 
    // ideally have an endpoint in /api/iiif which is more flexible

    let filename = this.canvasId.split('/').pop()
    let url = this.annotations[filename];
    return url;
  }

  /** */
  async all() {
    return (await fetch(this.annotationPageId)).json();
  }
}

Annotation in Files

Screenshot 2024-06-19 at 15 45 04

Annotations in Media Files

Screenshot 2024-06-19 at 13 44 09

No Annotations

Screenshot 2024-06-19 at 13 50 52