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
CSS in an Annotation NO
Missing Images in a Sequence NO
Addressing a Spatial Region YES
Grouping Annotations into Collections NO
Image in Annotations NO
Multiple Choice of Audio Formats in a Single View (Canvas) 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) YES
Audio Presentation with Accompanying Image (accompanyingCanvas) YES
Begin playback at a specific point - Time-based media (start) YES
Metadata on any Resource (metadata) YES
Linking to Web Page of an Object (homepage) YES
Linking to Structured Metadata (seeAlso) YES
Image Thumbnail for Manifest (thumbnail) NO
Displaying Multiple Values with Language Maps (label, summary, metadata, requiredStatement) YES
Load Manifest Beginning with a Specific Canvas (start) NO
Navigation by Chronology (navDate) YES
Acknowledge Content Contributors (provider) YES

Structuring Resources

Recipe iiif-prezi3
Table of Contents for Book Chapters (structures) YES
Table of Contents for A/V Content YES
Alternative Page Sequences NO
Multi-volume Work with Individually-bound Volumes YES
Multiple Volumes in a Single Bound Volume NO
Multiple Choice of Images in a Single View (Canvas) YES
Foldouts, Flaps, and Maps (behavior) YES
Composition from Multiple Images YES
Adding Thumbnail Navigation and no-nav to a Video Resource 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) YES
Audio Presentation with Accompanying Image (accompanyingCanvas) YES
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 YES
Table of Contents for Multiple A/V Files on a Single Canvas (start) YES
Table of Contents for Multiple A/V Files on Multiple Canvases YES
Using Caption and Subtitle Files in Multiple Languages with Video Content YES
Scholarly Annotation of a Poetry Reading NO
Using Caption and Subtitle Files with Video Content YES
Multiple Choice of Audio Formats in a Single View (Canvas) 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 YES
Annotation with a Non-Rectangular Polygon YES
Simplest Annotation NO
Embedded or referenced Annotations NO
Linking external Annotations targeting a Canvas to a Manifest NO
Annotate specific images or layers NO
Annotating in Multiple Languages NO
Rendering Multiple Media Types on a Time-Based Canvas 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 YES
Locating an Item in Place and Time NO