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 🙏

© 2025 – Pkg Stats / Ryan Hefner

canvaszoomify

v1.1.1

Published

Huge Image Zoom Widget with HTML Canvas

Downloads

2

Readme

Canvas Zoomify

Huge Image Zoom Widget with HTML Canvas

Getting Started

Website: http://adamcavendish.github.io/CanvasZoomify/.

  • Step 0:

Prepare the image:

python CanvasZoomifySlicer.py 'images/Huge1.jpg' 'img/Huge1-slices/' 'MyHugeSlice' 4 4 2

Meaning of the command line arguments:

CanvasZoomifySlicer usage: python CanvasZoomifySlicer.py [RawImagePath] [BaseDir] [Prefix] [Levels] [SliceRows] [SliceCols]

Output:

{
    "isDebug": false,
    "levelValues": [1, 2, 4, 8],
    "rowsPerLevel": 4,
    "colsPerLevel": 2,
    "tileWidth": 100,
    "tileHeight": 37,
    "tilesBasePath": "examples/img/Huge1-slices/",
    "tileNamePrefix": "MyHugeSlice",
    "tileImageType": "jpg",
}
  • Step 1:

Add following div into your html code:

CanvasZoomify just need an element, so choose your own class or id is fine

<div class="mycanvaszoomify"></div>
  • Step 2:

Add a new CanvasZoomify to your js code:

var cz = new CanvasZoomify($('.mycanvaszoomify'), /* config json */);

Just use the python script's output as the config, and it'll just work!

var cz = new CanvasZoomify(
  $('.mycanvaszoomify'),
  {
    "isDebug": false,
    "levelValues": [1, 2, 4, 8],
    "rowsPerLevel": 4,
    "colsPerLevel": 2,
    "tileWidth": 100,
    "tileHeight": 37,
    "tilesBasePath": "examples/img/Huge1-slices/",
    "tileNamePrefix": "MyHugeSlice",
    "tileImageType": "jpg",
  }
);

Default Configurations for CanvasZoomify

Any config will be its default values if not set

{
    "isDebug": false,       // enable or not debug mode
    "levelValues": null,    // level values, must be 2^n, also the level directories name (required)
    "rowsPerLevel": null,   // number of tile rows each level (required)
    "colsPerLevel": null,   // number of tile colums each level (required)
    "tileWidth": null,      // the width of each tile (required)
    "tileHeight": null,     // the height of each tile (required)
    "tilesBasePath": null,  // the base path of the tile files (required)
    "tileNamePrefix": null, // the tile files prefix name (required)
    "tileImageType": "jpg", // the tile image type, usually "jpg"
    "tiles": null,          // use the default generated tile file path

    "width": 640,           // the canvas width
    "height": 480,          // the canvas height
    "offsetX": 0,           // the starting image offset in x axis
    "offsetY": 0,           // the starting image offset in y axis
    "scale": 0,             // the starting image scale, 0 for auto mode: Scale to fit the image in the canvas
    "scaleStep": 1.1,       // each pinch or mouse scroll, will cause `scale = scale * scaleStep`
    "scaleMax": 16.0,       // the max scale, setting it to null will enable infinite scale

    "afterInit": function() {},      // triggered right after CanvasZoomify initialization

    "onCz_update": function(ev) {},  // triggered every time the canvas updates its parameter
    "onCz_clear": function(ev) {},   // triggered every time the canvas clears
    "onCz_repaint": function(ev) {}, // triggered every time the canvas repaints

    "onPanstart": function(ev) {},   // triggered every time the canvas is at its panning start
    "onPanmove": function(ev) {},    // triggered every time the canvas is moved by panning
    "onPinchstart": function(ev) {}, // triggered every time the canvas is at its pinching start
    "onPinch": function(ev) {},      // triggered every time the canvas is scaled by pinching

    "onMousedown": function(ev) {},  // triggered every time the canvas is on its mousedown
    "onMouseup": function(ev) {},    // triggered every time the canvas is on its mouseup
    "onMousemove": function(ev) {},  // triggered every time the canvas is on its mousemove
    "onMousewheel": function(ev, customDeltaScale) {},    // triggered every time the canvas is scaled by mouse wheel
    "onDOMMouseScroll": function(ev, customDeltaScale) {} // triggered every time the canvas is scaled by mouse wheel (only for firefox)
}

Documentation

You can browse the documentation online at http://adamcavendish.github.io/CanvasZoomify/. You can also get an offline version of the documentation by checking out the gh-pages branch. To avoid overwriting the current directory, you can clone the gh-pages branch into a subdirectory like doc/html:

git clone https://github.com/adamcavendish/CanvasZoomify.git --branch=gh-pages doc/html

After issuing this, doc/html will contain exactly the same static website that's available online. Note that doc/html is automatically ignored by Git so updating the documentation won't pollute your index.