Code Samples

Code samples

In addition to the viewer matrix we now link to code samples and component libraries that supported cookbook recipes. The aim is to give readers of the cookbook code which they can use to re-create the recipe that they are reading. For components it is useful for readers to be able to see how the recipe is supported before deciding whether to integrate the component into their software.

Which libraries are included?

Currently only iiif-prezi is supported but we welcome additions of both code samples and components that support at least one recipe. If you would like to add a project to the list on this page please provide a pull request to the Cookbook repository. Note submissions should meet the following requirements:

  • Support for the IIIF version 3.0 Presentation API
  • Have a public instance available that we can link to.
  • Support at least 1 cookbook recipe
  • Components should demonstrate how to initiate the component with the supplied Manifest in a Code Sandbox or other tool.

Code samples matrix

The possible values for viewer support are YES, NO or Partial. Check the recipe to see the full behaviour of the viewer to check it achieves the required function in the way you expect.

Basic Recipes

Recipe iiif-prezi3
Simplest Manifest - Single Image File YES
Simplest Manifest - Audio YES
Simplest Manifest - Video YES
Support Deep Viewing with Basic Use of a IIIF Image Service YES
Internationalization and Multi-language Values (label, summary, metadata, requiredStatement) YES
Simple Manifest - Book YES
HTML in Annotations YES
Simple Collection NO
Missing Images in a Sequence NO
Addressing a Spatial Region NO
Image in Annotations NO

IIIF Properties

Recipe iiif-prezi3
Embedding HTML in descriptive properties (label, summary, metadata, requiredStatement) YES
Rights statement (rights, requiredStatement) YES
Viewing direction and Its Effect on Navigation (viewingDirection) YES
Book 'behavior' Variations (continuous, individuals) (behaviorimage) YES
Load a Preview Image Before the Main Content (placeholderCanvas) NO
Audio Presentation with Accompanying Image (accompanyingCanvas) NO
Begin playback at a specific point - Time-based media (start) YES
Metadata on any Resource (metadata) NO
Providing Alternative Representations (rendering) NO
Linking to Web Page of an Object (homepage) NO
Linking to Structured Metadata (seeAlso) NO
Image Thumbnail for Manifest (thumbnail) NO
Displaying Multiple Values with Language Maps (label, summary, metadata, requiredStatement) NO
Load Manifest Beginning with a Specific Canvas (start) NO
Navigation by Chronology (navDate) YES
Acknowledge Content Contributors (provider) NO

Structuring Resources

Recipe iiif-prezi3
Table of Contents for Book Chapters (structures) NO
Table of Contents for A/V Content NO
Multi-volume Work with Individually-bound Volumes NO
Multiple Volumes in a Single Bound Volume NO
Multiple Choice of Images in a Single View (Canvas) NO
Foldouts, Flaps, and Maps (behavior) NO
Composition from Multiple Images NO

Image Recipes

Recipe iiif-prezi3
Simplest Manifest - Single Image File YES
Image and Canvas with Differing Dimensions YES
Support Deep Viewing with Basic Use of a IIIF Image Service YES
Simple Manifest - Book YES
Viewing direction and Its Effect on Navigation (viewingDirection) YES
Image Rotation Two Ways NO
Load Manifest Beginning with a Specific Canvas (start) NO
Missing Images in a Sequence NO

Audio/Visual Recipes

Recipe iiif-prezi3
Simplest Manifest - Audio YES
Simplest Manifest - Video YES
Load a Preview Image Before the Main Content (placeholderCanvas) NO
Audio Presentation with Accompanying Image (accompanyingCanvas) NO
Begin playback at a specific point - Time-based media (start) YES
Providing Access to Transcript Files of A/V Content (rendering) YES
Table of Contents for A/V Content NO
Table of Contents for Multiple A/V Files on a Single Canvas (start) NO
Table of Contents for Multiple A/V Files on Multiple Canvases NO
Using Caption and Subtitle Files in Multiple Languages with Video Content NO
Using Caption and Subtitle Files with Video Content NO

Annotation Recipes

Recipe iiif-prezi3
Annotating a specific point of an image NO
Simple Annotation — Tagging YES
Redirecting from one Canvas to another resource (Hotspot linking) NO
Tagging with an External Resource NO
Annotation with a Non-Rectangular Polygon (Updated) NO
Simplest Annotation NO
Embedded or referenced Annotations NO
Linking external Annotations targeting a Canvas to a Manifest NO
Annotate specific images or layers NO

Geo Recipes

Recipe iiif-prezi3
Represent Canvas Fragment as a Geographic Area in a Web Mapping Client NO
Locate a Manifest on a Web Map NO
Locate Multiple Canvases on a Web Map NO