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

graphpaper

v0.6.0

Published

A client side package for creating a graphpaper style grid using WebGL.

Readme

#Graphpaper

A javascript module to create HTML elements that display graphpaper like grids. Graphpaper uses WebGL to render grids onto canvas elements.

##Getting started

Include the script

<script src="graphpaper.min.js"></script>

Create a graphpaper and attach it to the DOM

document.body.appendChild(new Graphpaper().element);

Graphpaper

Alternatively, use the npm package, along with something like Browserify.

npm install graphpaper --save

##Examples

Basic
Animate
Scroll and Zoom (Click and drag to scroll. Use + and - to zoom.)

##Usage

The constuctor returns a new Graphpaper object. Using new is optional.

var graphpaper = new Graphpaper();

The object has an element property that references a DOM canvas element on which the graphpaper is rendered.

The constructor accepts a properties object. Each property will override the default property value.

var graphpaper = new Graphpaper({cellWidth: 5, cellHeight, 5});

To change properties after the graphpaper has been created you can use the setProps function.

graphpaper.setProps({offsetX: 4, offsetY: 4});

Changing a property using the setProps function will cause the graphpaper to re-render. The

The graphpaper can be forced to re-render at any time using draw. However this isn't necessary with normal usage.

graphpaper.draw(); 

Properties

| name | default | description | ---- | ------- | ----------- |.width | 601 | The pixel width of the canvas element. |.height | 801| The pixel height of the canvas element. |.cellWidth | 10| The pixel width of each cell. |.cellHeight | 10| The pixel height of each cell. |.majorRows | 10| Number of cells in a major row. |.majorCols | 10| Number of cells in a major column. |.minorColor | [0.0, 1.0, 0.0, 0.2]| An array of normalized RGBA values. The line color for cells. |.majorColor | [0.0, 1.0, 0.0, 0.6]| An array of normalized RGBA values. The line color for major rows and columns. |.offsetX | 0| The left pixel offset of cells. |.offsetY | 0| The top pixel offset of cells. |.alpha | 1| The global alpha value. Alpha components of majorColor and minorColor are multiplied by this value.