Skip to content

Instantly share code, notes, and snippets.

@jendiamond
Last active July 2, 2019 23:00
Show Gist options
  • Save jendiamond/5c0b31a7a64f0cb12bf8a77223d6f796 to your computer and use it in GitHub Desktop.
Save jendiamond/5c0b31a7a64f0cb12bf8a77223d6f796 to your computer and use it in GitHub Desktop.

Ticket-URS-411

Turn on two-up viewer for multi-page works in UV

Determine if UV can just be configured to use the two-up view for multiple page works

If there is a UV config for this, turn it on

If this requires some change in the IIIF manifest or changes in some other places make some notes about what that would require

ACCEPTANCE

  • Paginated works display 2-up like the David Copperfield example here

  • The necessary changes are implemented in ursus (UV)

  • The same changes are implemented in californica (UV)

http://access.bl.uk/item/viewer/ark:/81055/vdc_00000004216E#?c=0&m=0&s=0&cv=5&xywh=-121%2C0%2C4234%2C2687


@awallace added a comment - 6 days ago
UV is configured in https://github.com/UCLALibrary/ursus/blob/master/config/uv/uv-config.json

The options are not documented but I think they correspond to this doc:
https://github.com/UniversalViewer/universalviewer/blob/master/src/extensions/uv-seadragon-extension/config/en-GB.json


@jendiamond added a comment - 4 days ago
https://github.com/UniversalViewer/universalviewer/wiki/About


JBuilder

With JBuilder you can expose only the fields you want to expose.

https://www.youtube.com/watch?v=nliMIUDtPyY https://rubygems.org/gems/jbuilder/versions/2.7.0

https://github.com/rails/jbuilder Jbuilder gives you a simple DSL for declaring JSON structures that beats manipulating giant hash structures. This is particularly helpful when the generation process is fraught with conditionals and loops. Here's a simple example:

To define attribute and structure names dynamically, use the set! method:

json.set! :author do
  json.set! :name, 'David'
end

# => {"author": { "name": "David" }}

viewingHint

https://iiif.io/api/presentation/2.1/#viewinghint
A hint to the client as to the most appropriate method of displaying the resource. This specification defines the values specified in the table below. Other values may be given, and if they are, they must be URIs.

Any resource type may have one or more viewing hints.

https://iiif.io/api/presentation/2.1/#viewinghint

Value Description
individuals Valid on collection, manifest, sequence and range. When used as the viewingHint of a collection, the client should treat each of the manifests as distinct individual objects. For manifest, sequence and range, the canvases referenced are all distinct individual views, and should not be presented in a page-turning interface. Examples include a gallery of paintings, a set of views of a 3 dimensional object, or a set of the front sides of photographs in a collection.
paged Valid on manifest, sequence and range. Canvases with this viewingHint represent pages in a bound volume, and should be presented in a page-turning interface if one is available. The first canvas is a single view (the first recto) and thus the second canvas represents the back of the object in the first canvas.
continuous Valid on manifest, sequence and range. A canvas with this viewingHint is a partial view and an appropriate rendering might display either the canvases individually, or all of the canvases virtually stitched together in the display. Examples when this would be appropriate include long scrolls, rolls, or objects designed to be displayed adjacent to each other. If this viewingHint is present, then the resource must also have a viewingDirection which will determine the arrangement of the canvases. Note that this does not allow for both sides of a scroll to be included in the same manifest with this viewingHint. To accomplish that, the manifest should be “individuals” and have two ranges, one for each side, which are “continuous”.
multi-part Valid only for collections. Collections with this viewingHint consist of multiple manifests that each form part of a logical whole. Clients might render the collection as a table of contents, rather than with thumbnails. Examples include multi-volume books or a set of journal issues or other serials.
non-paged Valid only for canvases. Canvases with this viewingHint must not be presented in a page turning interface, and must be skipped over when determining the page sequence. This viewing hint must be ignored if the current sequence or manifest does not have the ‘paged’ viewing hint.
top Valid only for ranges. A Range with this viewingHint is the top-most node in a hierarchy of ranges that represents a structure to be rendered by the client to assist in navigation. For example, a table of contents within a paged object, major sections of a 3d object, the textual areas within a single scroll, and so forth. Other ranges that are descendants of the “top” range are the entries to be rendered in the navigation structure. There may be multiple ranges marked with this hint. If so, the client should display a choice of multiple structures to navigate through.
facing-pages Valid only for canvases. Canvases with this viewingHint, in a sequence or manifest with the “paged” viewing hint, must be displayed by themselves, as they depict both parts of the opening. If all of the canvases are like this, then page turning is not possible, so simply use “individuals” instead.

"viewingHint":"individuals", "viewingHint": "paged"


https://iiif-commons.github.io/manifesto/classes/_viewinghint_.manifesto.viewinghint.html

--

iiif Workshop: Example Manifests : 2.3.8 (Presentation)

https://ronallo.com/iiif-workshop/presentation/example-manifests.html

National Gallery of Art

https://media.nga.gov/public/manifests/nga_highlights.json

{  
"@context":"http://iiif.io/api/presentation/2/context.json",
"@id":"https://media.nga.gov/public/manifests/nga_highlights.json",
"@type":"sc:Manifest",
"logo": "https://www.nga.gov/content/dam/ngaweb/imgs/NGAEB.jpg",
"label":"National Gallery of Art Collection Highlights",
"metadata":[  
   {  
      "label":"Description",
      "value":"Highlights from the collection of the National Gallery of Art"
   }
],
"description":"A selection of highlights from the National Gallery of Art",
"guid":"e61700b6-7cb9-4c14-92ab-4246a345ec71",
"viewingDirection":"left-to-right",
"viewingHint":"individuals",
"sequences":[  
   {  
      "@id":"https://media.nga.gov/public/manifests/sequence/normal.json",
      "@type":"sc:Sequence",
      "label":"Normal Order",
      "canvases":[  
         {  
            "@id":"https://media.nga.gov/public/manifests/canvas/106382.json",
            "@type":"sc:Canvas",
            "label":"Self-Portrait",
            "height":402,
            "width":307,
            "images":[  
            ...
            
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment