npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-iiif-viewer

v1.0.2

Published

A React component library built on [OpenSeadragon](https://openseadragon.github.io/) for displaying high resolution images with deep zooming capabilities on mobile and desktop. Check out the interactive [Demo](https://eslawski.github.io/react-iiif-viewer/

Downloads

6

Readme

React IIIF Viewer

A React component library built on OpenSeadragon for displaying high resolution images with deep zooming capabilities on mobile and desktop. Check out the interactive Demo!

example

What is IIIF?

IIIF (pronounced “Triple-Eye-Eff”) is an open set of technical specifications that aim to provide uniformity to the way image-based resources are presented and delivered to end users.

IIIF images are delivered via a IIIF compatible image server. This server is responsible for breaking down large images into small tiles. The browser then makes requests for these tiles as the user zooms/pans around the image. As the user zooms in deeper, high resolution tiles are requested in order to maintain quality and performance. Fetched tiles are stitched together in real-time resulting in seamless user experience.

Where do I get these IIIF compatible images?

The Getty hosts thousands of images available for free use via their Open Content Program. Or, if you would like to create your own IIIF images, you can host a small number for free at iiifhosting.com.

Installation

Install via npm:

$ npm install react-iiif-viewer --save

Components

Viewer

A basic viewer that displays one image at a time.

import { Viewer } from "react-iiif-viewer"

<Viewer iiifUrl="https://data.getty.edu/museum/api/iiif/635494/info.json" />

| prop | required | type | default | description | |-----------|----------|--------|---------|------------------------------------------------------------------| | iiifUrl | yes | string | N/A | The IIIF image url to display. Changes to this prop will also update the currently displayed image. | | width | no | string | 800px | A css dimension for the width of the viewer (500px, 100%, etc.) | | height | no | string | 500px | A css dimension for the height of the viewer (500px, 100%, etc.) |

MultiViewer

A viewer that displays a collection of IIIF images via an expandable/collapsable thumbnail drawer.

import { MultiViewer } from "react-iiif-viewer"

<MultiViewer iiifUrls={[
    "https://data.getty.edu/museum/api/iiif/635494/info.json",
    "https://data.getty.edu/museum/api/iiif/671108/info.json",
    "https://data.getty.edu/museum/api/iiif/194801/info.json",
    "https://data.getty.edu/museum/api/iiif/268179/info.json"
]}/>

| prop | required | type | default | description | |------------|----------|----------|---------|------------------------------------------------------------------| | iiifUrls | yes | [string] | N/A | An array of IIIF image urls to display | | width | no | string | 800px | A css dimension for the width of the viewer (500px, 100%, etc.) | | height | no | string | 500px | A css dimension for the height of the viewer (500px, 100%, etc.) |

Development

After cloning the repo, install its dependencies:

$ cd react-iiif-viewer
$ npm install

This project uses Parcel for bundling and running of a development server.

To run the demo application with hot reloading:

$ npm run start-demo

The unit tests are written using react-testing-library.

To run them:

$ npm test

Future Improvements

  1. Implement custom full screen experience for iPhones since they don't yet support the Full Screen API
  2. CI pipeline with automatic publishing to Github pages
  3. Error states when image fails to load
  4. Error states when unable to fetch certain thumbnails
  5. Performance considerations when dealing with lots of images
  6. Ability to provide extra OpenSeadragon configs
  7. Add prettier code formatter
  8. Provide ability to render with thumbnail drawer open initially