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

ng-progress-arc

v2.6.1

Published

AngularJS directive for displaying a circular progress meter.

Downloads

1,113

Readme

angular-progress-arc

An AngularJS directive for displaying a circular progress meter.

Demo

Features

  • Displays a circular progress meter.
  • Utilises SVG for rendering.
  • Adjustable dimensions, color and thickness.
  • No additional dependencies outside of AngularJS.

Installation

This module can be installed using bower:

bower install angular-progress-arc --save

Otherwise, simply add the angular-progress-arc.min.js file to your project.

Usage

Include the script in your application and include the angular-progress-arc module as a dependency in your application module.

angular.module('myApp', ['angular-progress-arc']);

Add a progress-arc element to your application as required.

<progress-arc
    size="{integer}"
    stroke="{string}"
    stroke-width="{integer}"
    complete="{expression}"
    counter-clockwise="{string}"
    background="{string}">
</progress-arc>

Attributes

  • size defines the pixel width and height for the svg element. This defaults to 200.
  • stroke defines the color of the progress arc. This should be a valid stroke property for an SVG circle element. This defaults to black.
  • stroke-width defines the width of the progress arc line in pixels. This should be a value between 1 and size / 2. This defaults to 20.
  • complete is an expression that should evaluate to a float value between 0.0 and 1.0; where 0.0 is an empty progress arc, and 1.0 is a full ring.
  • counter-clockwise is a boolean value that will render the progress arc in a counter-clockwise direction. Any value Javascript would recognise as true will be treated as such, with the exception of the literal string false which will be treated as a boolean false.
  • background defines the color of the ring background. If not defined, no background is rendered.

Styling

As well as using attributes of the directive element, a progress arc can be styled using CSS.

// Use a more complex selector in your application to avoid styling other SVG elements.
circle {
    stroke: rgba(0, 0, 0, 0.1);
    stroke-linecap: round;
}

The stroke-dashoffset property is used to render the position of the progress arc, so adding a transition for this property will result in smoother transitions between progress values.

circle {
    transition: stroke-dashoffset 0.1s linear;
}

If you use CSS for styling, avoid setting the following properties that are used to calculate the progress arc position:

  • stroke-width
  • stroke-dasharray
  • stroke-dashoffset

Defaults

This module provides a service for configuring application-wide defaults for progress-arc directives. To change default values, inject the progressArcDefaultsProvider into your module's config method:

myApp.config(['progressArcDefaultsProvider', function (progressArcDefaultsProvider) {
    progressArcDefaultsProvider
        .setDefault('background', '#aaa')
        .setDefault('size', 300);
});

The values you can configure this way are size, strokeWidth, stroke and background.

License

angular-progress-arc is licensed under the MIT license. See LICENSE for details.