A proof-of-concept, annotating a IIIF manifest with Zooniverse classification data.
Generates IIIF Annotation Collections from Zooniverse project builder data exports, and publishes them on GitHub Pages.
Run it locally with
npm install
npx eleventy --serve
Or browse work in progress at
The workflow subjects must have been created from an IIIF manifest (see https://github.com/zooniverse/Panoptes-Front-End/pull/6095.) Currently, only In The Spotlight uses that feature, so the code here is specific to its two workflows.
You will need to download classifications exports for the In The Spotlight workflows from the 'Data Exports' page in the Project Builder.
_data/config.js
and make sure that the manifest URL points to the correct manifest._data/dates.csv
and_data/titles.csv
._data/consensusDates.csv
._data/
directory and push to GitHub.Builds are run by Eleventy and managed by GitHub Actions. Merging a change to the data files in the _data
directory will build a new collection of JSON files.
_data
contains the source data files:
config.json
: the URL of the source manifest, and the dimensions of the Zooniverse images, which are needed to scale annotations back up to the original canvas.consensusDates.csv
: CSV output from the Caesar text reducer for the Dates workflow.dates.csv
: a workflow classifications export for the Dates workflow, stripped of volunteers' personal data.titles.csv
: a workflow classifications export for the Titles workflow, stripped of volunteers' personal data.Output templates are in the annotations
directory:
annotations/consensusDates
index.11ty.js
: publishes an annotation collection at /annotations/consensusDates.json
dates.11tydata.js
: parse the CSV text annotations into an array of date annotations, with IDs.dates.11ty.js
: loops over the default sequence of canvases in the manifest (manifest.sequences[0].canvases
), printing out a JSON AnnotationPage
with one date annotation item for each canvas.annotations/dates
index.11ty.js
: publishes an annotation collection at /annotations/dates.json
dates.11tydata.js
: parse the CSV classifications into an array of date annotations, with IDs.dates.11ty.js
: loops over the default sequence of canvases in the manifest (manifest.sequences[0].canvases
), printing out a JSON AnnotationPage
with date annotation items for each canvas.annotations/titles
index.11ty.js
: publishes an annotation collection at /annotations/titles.json
titles.11tydata.js
: parse the CSV classifications into an array of title annotations, with IDs. Each classification contains multiple drawings, so the final result is flattened into a single array of performance titles.titles.11ty.js
: loops over the default sequence of canvases in the manifest (manifest.sequences[0].canvases
), printing out a JSON AnnotationPage
with title annotation items for each canvas.