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 🙏

© 2024 – Pkg Stats / Ryan Hefner

revolve.js

v1.3.0

Published

A precision analog clock-and-gauge control in standard JavaScript.

Downloads

7

Readme

Revolve.js

A precision analog clock-and-gauge library, animated and skinnable, in 500 lines of standard JavaScript with no dependencies.

Demo

Visit the Revolve.js website or check out the /examples folder for code examples.

Installation

Install with Yarn or NPM:

yarn install revolve.js

# -- or --

npm install revolve.js

Or download the revolve.js file directly.

Use

See the /examples folder for live code examples.

In HTML

The quickest way to use the library is to link to the revolve.pkgd.js file and add a canvas element with the data-revolve attribute set to either clock or gauge.

<head>
  <!-- yada yada -->
  <script src="dist/revolve.pkgd.js" type="text/javascript"></script>
  <!-- other stuff -->
</head>
<body>
  <canvas width="256" height="256" data-revolve="clock" data-theme="dark"></canvas>
</body>

With JavaScript

Alternately, call the Revolve.clock or Revolve.gauge method directly in JavaScript.

Revolve.clock( can.getContext("2d"), opt );
Revolve.gauge( can.getContext("2d"), opt );

Specifying a Theme

Revolve.js ships with over a dozen predefined themes and the ability to define your own. The current predefined themes are:

To use a theme, specify the theme name in the options object...

Revolve.clock(ctx, { theme: 'office' } );
Revolve.gauge(ctx, { theme: 'pressure' } );

...or use the data-theme attribute on a Revolve.js canvas:

<canvas width="256" height="256" data-revolve="clock" data-theme="office"></canvas>
<canvas width="256" height="256" data-revolve="gauge" data-theme="pressure"></canvas>

Every Revolve.js clock and gauge is driven by an editable JSON theme description.

Features

  • Robust on-screen rendering of analog clocks and gauges with HTML canvas.
  • Precision alignment and geometrical positioning of clock elements.
  • Continuous and discrete animation with millisecond precision.
  • Custom clock and gauge axes (for example, to implement a [pressure gauge][1]).
  • Scalable graphics at any size or level of zoom.
  • Multiple predefined themes, from classic office clocks to speedometers.
  • JSON-driven theming system allows clock and gauge customization to the pixel.
  • Clean ES6 JavaScript with a permissive MIT license and no dependencies.
  • Dedicated project website at https://revolvejs.org.
  • Package-friendly via Yarn and/or NPM; supports AMD, CommonJS, and browser-global approaches.

Changelog

See CHANGELOG.md for full release info.

  • v1.3.0 New theme (theory), better positioning and resizing support.
  • v1.2.0 Improve build packaging.
  • v1.1.0 Add unitless theme & GitHub Package support.
  • v1.0.0 Initial public release.

License

The Revolve.js library is licensed under the terms of the MIT license. Go crazy. See LICENSE.md for details.

Copyright (c) 2019 | James M. Devlin | All rights reserved