GithubHelp home page GithubHelp logo

clevelus / docview Goto Github PK

View Code? Open in Web Editor NEW

This project forked from speranskydanil/docview

0.0 0.0 0.0 20.46 MB

Image viewer for large collections

License: Other

JavaScript 84.25% CSS 15.75%

docview's Introduction

Docview

Image viewer for large collections

DEMO

Dependencies

Features

  • Grid, Filmstrip, Inspect and Flip-Book modes
  • Fullscreen mode
  • Zooming pages
  • Switching pages
  • Rotating pages
  • Download & Print
  • Intellectual loading of images, determining the viewport, and loading only what you are looking at.
  • Nice UX

Usage

Basic

<link href="docview.css" rel="stylesheet">
<script src="docview.js"></script>
<div class="docview"></div>
var docview = new Docview({
  div: '.docview',
  zooms: [82, 164, 328, 492, 656, 818, 984, 1146],
  pages: [
    {id: 1, w: 1200, h: 1740},
    ..
  ],
  pageUrl: function(id, zoom) {
    return ['/pages', id, zoom, id + '.jpg'].join('/');
  }
});

Options

div - container for Docview

div: '.docview'

translation - you can change text for tooltips, the default values are written below

translation: {
  grid: 'Grid',
  filmstrip: 'Filmstrip',
  inspect: 'Inspect',
  flipbook: 'Flip-Book',
  fullscreen: 'Fullscreen',
  zoomOut: 'Zoom Out',
  zoomIn: 'Zoom In',
  dim: 'Dim',
  prevPage: 'Previous Page',
  nextPage: 'Next Page',
  rotateLeft: 'Rotate Left',
  rotateRight: 'Rotate Right',
  download: 'Download',
  print: 'Print'
}

zooms - widths for zooms

  zooms: [82, 164, 328, 492, 656, 818, 984, 1146]

pages - pages to display; id, width and height have to be specified

pages: [
  {id: 1, w: 1200, h: 1740},
  ..
]

pageUrl - function which returns url for a page by it's id and zoom

pageUrl: function(id, zoom) {
  return ['./data', parseInt(id) % 10, zoom + '.jpg'].join('/');
}

mode - initial mode ('grid' (default), 'filmstrip', 'inspect', 'flip-book')

mode: 'grid'

index - initial page, default 0

index: 0

zoom - initial zoom, default 0

zoom: 0

Events

dv-change - triggered when mode, index or zoom is changed

dv-dim - triggered when dim button is clicked

Author (Speransky Danil): LinkedIn | GitHub | StackOverflow

docview's People

Contributors

speranskydanil avatar

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.