• Stars
    star
    252
  • Rank 161,312 (Top 4 %)
  • Language
    JavaScript
  • License
    Other
  • Created over 13 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

πŸ“š IIIF-compatible document image viewer

Diva.js Build Status

Diva.js (Document Image Viewer with AJAX) is a JavaScript book image viewer designed to present multi-page documents at multiple resolutions.

Version 6.0 contains many new features and improvements:

  • Compatibility with IIIF Presentation API version 2.1 and 3.
  • Small footprint, zero dependencies. Can be deployed with just a JavaScript and a CSS file.
  • Rewritten in ES6 for compatibility with the new JavaScript module system.
  • New plugins: Metadata, Image Manipulation

Overview

There are two components to a functioning Diva system:

  1. A IIIF Manifest that will be displayed.
  2. The Diva.js plugin. The embedded web application that displays the images in a browser.

Details

Using IIIF

Diva.js is an image viewer compatible with IIIF Presentation API versions 2 and 3. Simply supply the path to a valid IIIF Manifest and Diva will display the document as described by the metadata (see Installing).

Installing

From a CDN (hosted)

If you prefer to use a hosted version of Diva, copy and paste the following into the <head> of any webpage to include all the files necessary to use Diva.js.

<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/diva.js/6.0.2/css/diva.css" />
<script src="//cdnjs.cloudflare.com/ajax/libs/diva.js/6.0.2/js/diva.js"></script>

Locally (release package)

Download the latest release of Diva. In the diva.js directory you can find a pre-compiled version. The build directory contains the files necessary to use Diva. Simply include build/diva.css and build/diva.js in the <head> of your webpage, as shown in the HTML source of the example index page.

From npm

You can also run npm install diva.js in order to install Diva as a node package. Then, Diva will be located under node_modules/diva.js/, and you can access the build directory the same as above.

Basic setup

HTML

After including the necessary files, the most basic Diva viewer is instantiated with one (IIIF) required parameter and several optional settings parameters. Diva must target a parent div, in this case diva-wrapper:

<div id="diva-wrapper"></div>

<script>
    let diva = new Diva('diva-wrapper', {
        objectData: "http://www.example.com/manifest.json"
        // possible settings
    });
</script>
  • objectData: The URL (absolute or relative) to the document's .json file, or a IIIF Manifest

The diva-wrapper selector points to a div element within which the document viewer will appear.

JavaScript

If you wish to include the Diva viewer component into your own JavaScript app, this can be done easily by just importing Diva beforehand.

import Diva from './path/to/source/diva.js';

let diva = new Diva('diva-wrapper', {
    objectData: "http://www.example.com/manifest.json"
    // possible settings
});

There are a large number of settings that can be enabled/disabled for this Diva instance. See Settings for a comprehensive list.

See Installation for full instructions.

Building from source

If you wish to install from source, first you must install node.js and npm. Then, check out the code from our GitHub repository. Once you've obtained the code, change to the project directory and run npm install to fetch all development dependencies.

The full installation gives you access to the un-minified JavaScript source, the plugins, the documentation, and our unit-tests.

npm run develop          // Runs a server at localhost:9001 and automatically builds and reloads upon changes
npm run build:develop    // Compiles the Javascript and SASS source and places it in the build/ directory
npm run lint             // Lints the Javascript source with JSHint
npm test                 // Runs the unit tests and outputs a report to the console
npm run build:production // Builds the release package

Run npm run develop and navigate to http://localhost:9001 in your web browser to see a basic Diva instance.

See Installation for more information.

Getting help

Help for Diva.js is available through this repository's wiki, in the form of code documentation, installation instructions and usage tips. You can also submit an issue!

Cross-site Requests

You may receive an error that looks something like this:

XMLHttpRequest cannot load http://example.com/demo/imagefiles.json. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8000' is therefore not allowed access.

This is a security precaution that all browsers use to prevent cross-site request forgeries. If you receive this message it is because your objectData parameter and the server used to serve the Diva page are not at the same server address.

To fix this you must ensure that the Diva HTML page, and the location pointed to by the objectData page are being served by the same server, or you must create an exception using the Access-Control-Allow-Origin header on your server to explicitly white-list the objectData location.

Let Us Know

We're developing Diva.js as part of our research in Distributed Digital Music Libraries. If you use it in your project, it would be great if you could let us know.

More Repositories

1

salami-data-public

Ruby
87
star
2

libmei

C++ library and Python bindings for the Music Encoding Initiative format
C++
61
star
3

Rodan

🐲 A web-based workflow engine.
CSS
46
star
4

Neon.js-Legacy-

🎼 JavaScript Music Notation Editor
JavaScript
42
star
5

jSymbolic2

2nd Version of jSymbolic
Java
29
star
6

Neon

A web-based MEI neume editor.
TypeScript
25
star
7

aruspix

A music recognition system and editor
C++
23
star
8

SALAMI

SALAMI Project Code
MATLAB
20
star
9

tripoli

IIIF document validation with correction.
Python
18
star
10

jMIR

A mirror of Cory McKay's jMIR suite of tools
Java
17
star
11

cantus

πŸ” Searching with Optical Music Recognition technology and the Cantus Database
JavaScript
15
star
12

IIIF-AV-player

IIIF Audio/Video Player
JavaScript
13
star
13

Pixel.js

πŸ–Œ A web-based pixel classification and correction platform
JavaScript
9
star
14

vida.js

Verovio Image Display Assistant
JavaScript
8
star
15

VerovioEditor

Implementation of co-existing Verovio Engraver (RISM) and MEI Editor (DDMAL).
JavaScript
7
star
16

musiclibs

🎸 Searching IIIF Manifests
JavaScript
6
star
17

ddmal.github.io

Distributed Digital Music Archives & Libraries Lab Website
HTML
6
star
18

ichago

Modified chicago bibtex format
TeX
6
star
19

CantusDB

A new site for Cantus Database running under Django.
Python
5
star
20

barlineFinder

Barline Finder
Python
5
star
21

text_alignment

Aligns correct transcripts to text images using a "messy" OCR and Needleman-Wunsch sequence alignment
Python
5
star
22

mei-test-set

MEI Test Set
HTML
5
star
23

felix_quartets_got_annotated

The String Quartets by Felix Mendelssohn. Corrected from an OMR output, and annotated by a community of experts.
Shell
5
star
24

Gamera

Unofficial Gamera Mirror
C++
5
star
25

jMei2Midi

jMei2Midi Maven Project
Java
4
star
26

DjangoDemoApplication

Demo Training Application
Python
4
star
27

ACE

A musical metalearning classification framework
Java
4
star
28

meix.js

Browser-based MEI editor.
JavaScript
4
star
29

liberusualis

The one place to find all the latest and greatest in the LU code base
Python
4
star
30

Nomr

Glyph OnLine Database - An online repository of searchable glyphs for Optical Music Recognition
Python
4
star
31

homr

HMM optical music recognition for neume notation.
Python
4
star
32

document-preprocessing-toolkit

Gamera document preprocessing toolkit
C++
4
star
33

key_modulation_dataset

A dataset of key modulations that have been annotated in different music theory books
Python
4
star
34

Flexible_harmonic_chorale_annotations

Bach and Praetorious Chorale Music
4
star
35

mei-mapping-tool

Web-based app to map squiggles to MEI snippets
JavaScript
3
star
36

prosopography

Python
3
star
37

UtilityClasses

Utilities for jSymbolic and ACE
Java
3
star
38

rodan-client

πŸ‰ A client for Rodan. Dig it.
JavaScript
3
star
39

linkedmusic-website

website for LinkedMusic Partnership Grant
HTML
2
star
40

e2e-omr-resources

Python
2
star
41

Andrew-Hughes-Chant

A collection of chants compiled by the legendary musicologist Andrew Hughes.
Python
2
star
42

Digital-prosopography

Prosopography project using Gate and RDF
Java
2
star
43

CMN-MEI_to_MensuralMEI_Translator

Python
2
star
44

Interactive-Classifier

πŸ”– A web interface for the Gamera Interactive Classifier.
JavaScript
2
star
45

js-image-suite

JavaScript Image Processing Suite
JavaScript
2
star
46

CantusEditor

meix.js editor customized for the Cantus Ultimus project
JavaScript
2
star
47

ISMIR-Conf

Virtual conference website for ISMIR 2020
JavaScript
1
star
48

VIM

The Virtual Instrument Museum website repository
Python
1
star
49

Paco_classifier

Python
1
star
50

Third-Party-Jars

Third Party Jars for jMIR suite
1
star
51

MEI_encoding

Rodan job for encoding pitch-finding and lyric alignment output into an MEI file of a manuscript page.
Python
1
star
52

MEI-2011-Updater

A small script for updating MEI to 2011
1
star
53

git_and_github_2021

An illustrative repository to learn about git and github.
1
star
54

west.js

Webworker/Events System Test
JavaScript
1
star
55

jSymbolic-JAR

THE jSymbolic JAR
1
star
56

e2e-omr-documentation

User documentation for an end-to-end optical music recognition workflow in Rodan.
Ruby
1
star
57

SIMSSA-Licensing

SIMSSA/DDMAL Licensing info for software, documentation, and symbolic scores
Python
1
star
58

jmei-search

Neume searching algorithms for MEI files
Java
1
star
59

barlineGroundTruth

Ground Truth editor for barline finder.
Python
1
star
60

HHP-EventsEditor

Human History Project: Events Editor
JavaScript
1
star
61

RodanClient-deprecated-

ES6 Rodan Client
JavaScript
1
star
62

diagonal_neume_slicing

A tool for splitting a neume into diagonal components based on diagonal projection
Python
1
star
63

Calvo_classifier

Repository of the Rodan wrapper for Calvo classifier
Python
1
star
64

Tutorial

A tutorial application
Python
1
star
65

mei.js

Javascript component with pub/sub events system.
JavaScript
1
star
66

hadoop-mei

Count the number of notes in an MEI corpus using Hadoop
Java
1
star
67

MIRAI

MIRAI project site
HTML
1
star
68

docker-simssadb

Containerization of Elvis-Project/simssadb
Shell
1
star
69

aOMR

Python
1
star
70

ismir-remote-conference

Repository with suggestions on best practices and tools for remote conference attendance and participation.
1
star
71

crazytonalstuff

Website of the Computational Tonal Studies (CTS) group
1
star