Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

canvas-dial

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

canvas-dial

a dial indicator

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

canvas-dial

A simple dial or gauge implemented in HTML5 Canvas and designed to be performant and flexible.

API

new Dial(element, options) create a new dial, owning a single DOM element. Options are listed below

dial.draw(value) update the dial to show a new value.

Options

  {
    // the width & height of the gauge canvas element
    diameter: 20,
    // the width of the stroke indicating the gauge's background
    // and foreground values
    width: 8,
    // the outer width of the gauge
    outer: 15,
    // the gap at the bottom of the gauge, if any
    gap: 10,
    // the strokeStyle of the background that indicates
    // the total range of the gauge
    background: '#eee',
    // the strokeStyle of the dial - the part that shows data
    foreground: '#00f',
    // the minimum value in the scale.
    min: 0,
    // the value from which the gauge starts. 0 is common
    // for absolute values, 0.5 can be useful for things like
    // saturation/desaturation
    start: 0.5,
    // the maximum value represented by the gauge
    max: 1
  }

Keywords

FAQs

Package last updated on 21 Oct 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc