Coder Social home page Coder Social logo

digirati-co-uk / canvas-panel Goto Github PK

View Code? Open in Web Editor NEW
33.0 8.0 11.0 3.3 MB

Prototype covering the specification of Canvas Panel, and supporting components for composing bespoke IIIF viewers and lightweight experiences, conforming to the IIIF Presentation 3 specification.

Home Page: https://canvas-panel.digirati.com/

License: MIT License

JavaScript 52.09% CSS 19.12% HTML 16.89% Shell 0.22% SCSS 11.69%
javascript iiif iiif-presentation iiif-presentation-3 react fesk

canvas-panel's People

Contributors

4d4mm avatar dependabot[bot] avatar eelkevdbos avatar ionab avatar renovate-bot avatar renovate[bot] avatar stephenwf avatar tomcrane avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

canvas-panel's Issues

Annotations with float coordinates don't show

Example annotation:

{
  "@id": "https://ra-exhibition-pmc.dlc.services/pmc/annotationlist/c9495f6c815358306e84dd121bc16ae7/6",
  "@type": "oa:Annotation",
  "motivation": "oa:linking",
  "on": "https://presley-pmc.dlc.services/iiif/raa/Vol10/canvas/c3#xywh=887.0800000000002,446.95288888888933,1377.0555555555554,165.24666666666656",
  "resource": {
    "@id": "https://ra-exhibition-pmc.dlc.services/index/exhibitors/B#Francesco%20Bartolozzi+%28Engraver%29",
    "label": "Bartolozzi, Francesco (Engraver) Exhib. 1769-1799"
  }
}

Event model: Following links

Following links/displaying enlarged images within the annotation pop-up will be dealt with by the surrounding page through an event model (to be agreed during development)

The fibers that are currently making up the prototype are not locked into any sort of event model, so its open to any event bus or model thats required.

Popups not scrollable

In non-fullscreen view popup annotations that go outside the viewing area are cropped with no ability to scroll down the text. Seems to be like this across all browsers on desktop.

Render (optional) transcriptions in transparent layer for text selection

Painting the text into an invisible but selectable layer on top of the canvas (as you can do in a PDF), so that users can magically cut and paste text out of a IIIF resource.

CanvasPanel can support multiple modes of rendering textual content - somewhere else, in cooperation with the containing app, or directly, with various degrees of visibility.

Related to #176

Scroll plugin - move explore button

Related to #108

Explore button is too prominent on the page, making it look like a call to action, instead of breaking out of the space. Needs to better show that it unlocks the scrolling behaviour and allows free roaming of the image.

Handle content with IIIF auth services

Another example of where CanvasPanel needs to collaborate with the containing application.

CP has done the scene evaluation and knows what content requires an auth interaction, but it isn't responsible for the UI for initiating that auth interaction. But it can still orchestrate it - or collaborate with an auth flow component to orchestrate it.

Annotation pop-ups must be able to house rich media

Annotation pop-ups must be able to house rich media: HTML text and images for this iteration, with the capacity for audio and video in future iterations.

Questions around formatting of this type of annotation

  • Single or multiple bodies
  • Should annotation body be HTML, or some other structure
  • Are the images IIIF images or just static links to images

Slideshow mobile fullscreen - gestures

There should be 3 available gestures on the mobile fullscreen mode:

  • swipe left and right to navigate next and previous
  • pinch to zoom
  • tap to view detail on the current slide

More generic name for patchwork plugin?

Not hugely important but would it be more meaningful to rename the patchwork plugin to something like "annotated zoom" i.e. the functionality it provides rather than the first object. Will be rather strange to keep on calling it patchwork plugin for completely different objects!

[build] Ruby environment

From the build logs:

** WARNING **
Using custom ruby version 2.2.3, this will slow down the build.
To ensure fast builds, set the RUBY_VERSION environment variable, or .ruby-version > file, to an included ruby version.
Included versions: 2.2.9 2.4.3 2.3.6

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Error type: Preset name not found within published preset config (monorepo:angularcli). Note: this is a nested preset so please contact the preset author if you are unable to fix it yourself.

Safari: Fullscreen API not working correctly

There are some errors when viewing the documentation on mobile safari, related to the fullscreen API. cannot call on of undefined or something similar. Also potentially related, the V&A example does not load at all (probably caused by this error) and on safari desktop its very unstable, sometimes causing crashes. Lots of RAF requests (~60k per frame) might be related to OSD.

Stylable through CSS with customisable markers

Stylable through CSS with customisable markers

This should happen intrinsically with the way we are building. Will integrate BEM-js with customisable class names, to cover the multiple instances on a single page requirement.

Also applies to other requirements for CSS

CSS styling for the above

Slideshow editor - point of interest

Can the editor have an intuitive way to control the initial point of interest coordinates for the image. This will control the initial zoom level to help avoid slideshow layouts with black bars outside of the image area.

Suggestion is a preview window for the editor which has the pan and zoom controls. The editor can then move the image to the desired position and then a save button can store those coordinates in the manifest.

Happy to chat if this isn't clear.

Write up notes for Reading vs Viewing

Canvas panel as a component to drive reading - for people who are going to spend a long time reading a text. I need to write up my notes into a narrative then see how that fits in with Canvas Panel features (could be Canvas Panel inside the UV, or in any ad-hoc bookreader UI).

Then do more work on the developer narrative.

Consider APIs for content requiring interaction with containing app

While the behaviour of CanvasPanel for many scenes is completely deterministic, some content requires, or would benefit from, user interaction.

Examples:

When there is a Choice (oa:Choice), CanvasPanel needs to supply that information somehow to the containing app, so that the containing app can generate the UI to offer the choice to the user; when the user chooses, that containing app needs to notify CP of the choice that was made. It's not CanvasPanel's job to provide that UI, but it is CP's job to make that UI and associated code trivially easy for someone knocking up a quick viewer.

More generally, with many linked annotation lists / otherContent, the containing app needs to offer UI to the user to control the visibility by list, and/or by motivation, and/or by language.

And then, there is all the anno content that is available but not desirable to render directly on the canvas. As a developer who wants to make innovative user interfaces quickly, I'm relying on CanvasPanel to do all the heavy lifting for display - but I am prepared to handle some of that display in my app, because not all the anno content should be painted onto the canvas. I don't know in advance what content the canvas bears, CP helps me process it. So it has features that are not just about it drawing pixels, but about processing content.

Example - for supplementing content in P3 (or text transcriptions in a linked annolist with otherContent), I might want to display the text off to the side, where it is selectable.

So, I need to be notified by CanvasPanel of the availability of this textual content, or query CP for the availability of the content; I want to get the content, so that I can render it.

But maybe I want to invoke a special CP mode that draws the text on top of the canvas, fitted to the anno boxes, so that it is selectable (a cool feature: #180)

All these things involve my containing app knowing about what canvaspanel has for a given canvas, sometimes obtaining that content through API on CP (rather than having to process the canvas itself again from scratch), sometimes taking care of the display externally and other times telling CP how to display it.

Example - I'd want to use CP to create something as simple as this:

https://github.com/tomcrane/wellcome-today/blob/gh-pages/viewer-min.html
(http://tomcrane.github.io/wellcome-today/viewer.html) and add support for displaying the text.

Ghost annotations showing up when paging through

When rendering annotations, they should double check that they should be rendered (another check of the canvas target). May be related to React 16 async? To replicate, quickly page through annotation lists, you will see annotations appearing that shouldn't. They disappear after a re-render.

Moving and zooming viewport when selected

The viewport will move and zoom in a certain amount when an annotation is selected
Configurable zoom speed on transition between zoomed out view and close-up

Since we are framing annotations (see diagram in #1 ) in a bounding box, we will zoom into fit the whole box into the viewport. There will be configuration for:

  • Padding around bounds of image
  • Speed of transition when zooming in
  • Speed of transition when zooming out

Projection layer type

So far the layers on the canvas have been relative to the canvas itself, but we may need layers that are relative to the viewer or viewport when it makes sense (such as box selector layer for example). In this case we want a projection painted onto the canvas where the real element is, and a way to relay back the position of the canvas to the this layer.

Top Layer - viewport
Cube - projection layer, moves with viewport
Bottom layer - canvas, relays projected co-ordinates to projection

image

Annotations placed as markers on an image

Annotations will be placed as markers on an image

In order to maintain a responsive design, we've decided to represent the regions of the image using annotation boxes with a height, width, X and Y. This will be displayed to the user as a pin.

screen shot 2018-01-18 at 15 58 50

  1. X co-ordinate of the annotation, from the target
  2. Y co-ordinate of the annotation, from the target
  3. Width of the annotation, from the target
  4. Height of the annotation, from the target
  5. X position of pin, driven by configuration (50%)
  6. Offset at the top, driven by configuration (3.5% of canvas height)
  • Dotted line won't be visible, driven by configuration
  • Area in dotted line might be click-able to view annotation (?)

Responsive design

Designed responsively: on desktop, the annotation body should appear in the top left when a marker is selected. In mobile view, annotations should appear at the bottom, to avoid obscuring the image. Annotation may take up entire canvas in mobile view - (If this is possible through configurable CSS, this functionality is not required)

A lot of this will be configurable with CSS, but we will include basic positioning examples.

Full-screen option

Full-screen option. Mobile view will require configurable prompt to enter full-screen mode before zoom/scroll functionality is enabled (to avoid competing event listeners).

This can use some of the tech from Galway viewer to initially show an high quality image and load the OSD when zoom has started, with the addition of a prompt for mobile view.

Static image viewer / viewport doesn't support annotations

Currently annotations can't be placed on the static image viewport. It's also diverged form the OSD viewport, so they are not swappable anymore. This should be updated to stub out the missing functionality or make functional in a way that makes sense for the static image viewport (cropping image instead of zooming to for example.)

Slideshow mobile fullscreen

There should be a fullscreen mode for the slideshow viewer on mobile, to launch a slideshow-like experience.

Fixed size option crashes safari

I think Safari is really struggling with the scaling up and scaling down in a single operation. Need to look into a different approach for fixed sized zooming (like resizing elements individually).

Scene evaluation

For the backlog...

OpenSeadragon is probably not going to be the best renderer for a canvas that contains audio and video. Especially an audio only, duration only Canvas! And what about mixed scenes?

Maybe some Canvases include an image that has an image service, but OSD (or rather, a deep zoom interaction) is still not the best choice to render it.

At some point CanvasPanel should be a general purpose renderer, invoking whatever components are required for the scene. This is hard. In the UV for example, an AV scene may require the dash.js library for mpeg-dash, or the hls.js library for HLS; it may need to play an mp4 and render an image; it needs to draw text. I don't know what the best answer to this is, but CP is a good place to explore it.

Write a developer narrative user story

Typical developer scenarios for people making viewers quickly and simply.

They want to pass canvases for CP to render.

They might want to support image choice in their UIs.

They might want to render the text content of the canvas.

What would a really simple viewer look like?

Starting point: http://tomcrane.github.io/wellcome-today/viewer-no-dep.html

This tiny viewer has no dependencies. Can we turn it into a deep zoom viewer that can display image choice UI, render complex scenes, display the text alongside, by referencing CP and writing a bit more (simple) code?

Multiple bundles

For plugins should create multiple bundles:

  • React + ReactDOM + OpenSeadragon
  • Just React + ReactDOM (bring your own seadragon)

These should be part of the build and available in the UMD folder.

Define the scope / boundaries of CanvasPanel

We need to establish a clear stance on CP's architecture, so that its relationship to other components is well understood.

Other components may be inner components of CanvasPanel, like OpenSeadragon
Other components may be outer components that use CanvasPanel, like a viewer, or Annotation Studio

It would be rare to use CP on its own. It's not a viewer, except in the very simple sense that an img tag is a viewer for images and OpenSeadragon is a viewer for TilesSources.

Given a manifest, you need some notion of a containing app to see anything, because CP has no idea what a manifest is. But the point of CP is, that containing app could be very very simple.

For things like the V&A viewers, it's not clear where CP ends and the viewer begins.

[improvement] Add configurable manifest caching

Currently, manifests are cached with 'force-cache' as fetch option. Making this configurable would allow for more dynamic applications that for example add annotations to the manifest in real time.

Firefox 58.0.2 - Fullscreen mode does not work

If select a annotation and then full screen

The annotation box remains visible but the screen goes blank, when click on blank screen the canvas appears in the bottom left corner

Need to press esc to get out of full screen

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.