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 🙏

© 2026 – Pkg Stats / Ryan Hefner

openvg-canvas

v1.1.7

Published

Canvas on node-openvg

Readme

node-openvg-canvas

Canvas implementation on node-openvg

This module implements a HTML5 Canvas on OpenVG (node-openvg). It is targeted to the raspberry-pi. By using the OpenVG APIs on the Raspberry PI, all graphics code will run on the GPU with hardware acceleration.

This library aims for API compatibility with node-canvas where it applies / makes sense. While node-canvas is targeted to create images off screen, node-openvg-canvas is targeted to on screen usage, but not yet for user interaction.

Currently there are only plans to implement the 2d context. Implementing the 3d context (web gl) should be possible by mapping OpenGL/ES.

0. Installation

This module is targeted for node 0.8.x. Node >= 0.8.10 will compile out of the box on the raspberry.

Fetch the source:

git clone https://github.com/luismreis/node-openvg-canvas.git

Build the package:

cd node-openvg-canvas
npm install

To test:

export PATH=$PWD/bin:$PATH
examples/swissClock.js

1. Documentation

Canvas implementation status (by WHATWG Canvas IDL class/interface definition)

  • CanvasRenderingContext2D
    1. state - save/restore (done)
    2. matrix transformations: scale, transform, etc (done)
    3. compositing - alpha, composite operation (done)
    4. image smoothing (done)
    5. stroke/fill style
    6. gradients (done)
    7. patterns (to do)
    8. shadows (to do - after v. 1.0)
    9. clear/fill/stroke rect (done)
    10. beginPath, fill, stroke /default path/ (done)
    11. fill, stroke /custom path/ (to do)
    12. focus ring (no plan to implement)
    13. scrollPathIntoView (no plan to implement)
    14. clip/reset clip (to do)
    15. isPointInPath (to do - after v. 1.0 - help appreciated)
    16. fill/stroke/measure text (done)
    17. drawImage (done)
    18. hit regions (no plan to implement)
    19. create/get/put image data (done)
  • CanvasDrawingStyles
    1. drawing styles - line width, cap, join, miter limit (done)
    2. dashed lines (to do)
    3. text - font, textAlign, textBaseline (done)
  • CanvasPathMethods (only implemented for the context's currentDefaultPath)
    1. closePath() (done)
    2. moveTo, lineTo (done)
    3. quadraticCurveTo, bezierCurveTo (done - untested)
    4. arcTo (to do)
    5. rect (done)
    6. arc (done)
    7. ellipse (done - rotation parameter ignored)
  • CanvasGradient (done)
  • CanvasPattern (to do)
  • TextMetrics (done)
  • HitRegionOptions (no plan to implement)
  • ImageData (done)
  • Path (to do)

Differences from the HTML5 Canvas object / node-canvas

The HTML5 Canvas is used inside the browser runtime, so, its rendering is controlled automatically (and implicitly) by the browser.

node-canvas code explicitly calls toBuffer or similar functions to render images.

Code running on node-openvg-canvas must explicitly swap display buffers, to do so, either call vg.egl.swapBuffers from node-openvg or use the included requestAnimationFrame shim (for more information look at the clock examples) that does this after calling your paint (callback) function.

License

(The MIT License)

Copyright (c) 2012 Luis Reis

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.