New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

js-meters

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

js-meters

Create a javascript meter and animate it.

latest
Source
npmnpm
Version
2.5.0
Version published
Maintainers
1
Created
Source

js-meters

Create a javascript meter and animate it.

Installation

npm install --save js-meters

Usage

HTML

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>js meters</title>
    <script type="text/javascript" src="./dist/js-meters.js"></script>
  </head>
  <body>
    <h1>jQuery Meter</h1>
    <div id="jquery-meter"></div>
    <script type="text/javascript">
      var meter = new jsMeters.jqueryMeter({
        id: 'jquery-meter',  //id of DOM element to which to attach the meter
        radiusOuter: 100,
        radiusInner: 80,
        part: 3,
        whole: 5,
        strokeWhole: '#ddd',
        strokePart: 'red',
        strokeWidth: 20
      });
      meter.renderInitialMeterState().animateMeter();
    </script>
  </body>
</html>

jQuery Meter

import {jqueryMeter} from "js-meters/src/jquery/jquery-meter"

const meter = new jqueryMeter({
  id: 'jquery-meter',  //id of DOM element to which to attach the meter
  radiusOuter: 100,
  radiusInner: 80,
  part: 3,
  whole: 5,
  strokeWhole: '#ddd',
  strokePart: 'red',
  strokeWidth: 20
});

meter.renderInitialMeterState().animateMeter();

Events

  • meter:animation:start: Triggered when meter animation starts. Bound to the meter $el.
  • meter:animation:done: Triggered when meter animation is done. Bound to the meter $el.

Angular Meter Component

(Not bundled)

//app.module.ts
import { BrowserModule } from '@angular/platform-browser'
import { NgModule } from '@angular/core'
import { AppComponent } from './app.component'
import { ngMetercomponent } from "js-meters/src/angular/meter.component"

@NgModule({
  declarations: [
    AppComponent, 
    ngMeterComponent
  ],
  imports: [
    BrowserModule   
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }
//app.component.ts

@Component({
  selector: "ng-meter-container",
  template: `
    <ancb-meter [meter]="meter"></ancb-meter> 
  `
}) 
export class AppComponent {
  meter: Object = {
      radiusOuter: 100,
      radiusInner: 80,
      part: 3000,
      whole: 5000,
      strokeWhole: '#ddd',
      strokePart: 'red',
      strokeWidth: 20
    }
}

FAQs

Package last updated on 02 Jul 2017

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