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

pg.progress-bars

v0.2.1

Published

Multiple progress bars module for angular js

Downloads

9

Readme

progress-bars Build Status

Changes history you can find here

Main features

  • Independent from $digest cycle (don't run unnecessary cycles)
  • Can place many progress bars on one page
  • Full control of each bar
  • Custom progress-bar container
  • Simple customization via css

Demo

You can see demo on this page

Installation

  • Via bower (preferred way)
bower install --save pg.progress-bars

Usage

  1. Add module as dependency to your app:
angular.module('your-app', ['pg.progress-bars']);
  1. Add progress bar directive to template:
<pg-progress-bar name="some-name"></pg-progress-bar>
  1. Now you can inject ProgressBarsStorage service and get full control of your progress bars.
    Just get it by name:
var progressBar = ProgressBarsStorage.get('some-name');

progressBar.start();

setTimeout(function () {
    //async result
    progressBar.done();
}, 1500);
  1. Default progress bar styles you can find in demo/styles.css (at the bottom of file).

Module's components

progressBar directive

Directive will be replaced by its template. For customization different progress bars you can add classes to it. It will be merged with template classes.

Usage

<pg-progress-bar name="main"></pg-progress-bar>

Directive params

|Name|Binding Type|Default value|Description|Example| |----|------------|-------------|-----------|-------| |name|@||You must specify name of each progress bar for get it then through ProgressBarsStorage|<pg-progress-bar name="main"></pg-progress-bar>| |minimum|@|8|Minimum value from which started progress bar|<pg-progress-bar name="main" minimum="25"></pg-progress-bar>| |speed|@|250|Speed of each width increasing|<pg-progress-bar name="main" speed="500"></pg-progress-bar>| |trickleRate|@|2|Multiplier of each increasing of width when progress bar is running|<pg-progress-bar name="main" trickle-rate="5"></pg-progress-bar>| |trickleSpeed|@|300|Multiplier of each increasing of width when progress bar is running|<pg-progress-bar name="main" trickle-rate="5"></pg-progress-bar>| |animation|@|'ease-out'|Type of css animation|<pg-progress-bar name="main" animation="linear"></pg-progress-bar>|

Base progress bar template structure

<div class="progress__container"><div class="progress__bar"></div></div>

Full example

<pg-progress-bar
    name="main"
    minimum="15"
    speed="350"
    trickle-rate="4"
    trickle-speed="400"
    animation="linear">
</pg-progress-bar>

ProgressBar factory

Don't use it directly, it will be constructed when you use html <pg-progress-bar></pg-progress-bar> directive. Then you can get instance of ProgressBar class from ProgressBarsStorage and use methods.
You can combine method calls to chain (only for non-get methods). Example:

progressBar.start().inc().inc();

Public methods description

|Method|Params|Returns|Description|Example| |------|------|-------|-----------|-------| |start||this|Start progress bar. It will constantly increase its width value prior to calling done or stop method|progressBar.start()| |stop||this|Stop increasing value of width|progressBar.stop()| |done||this|Complete progress bar work|progressBar.done()| |get||{number} - width value|Get current width of progress bar|progressBar.get()| |set|{number} value|this|Set width of progress bar|progressBar.set(45)| |inc|{number} [value]|this|Increase value of progress bar to specified value or random value if it not specified|progressBar.inc(); progressBar.inc(15)| |isInProgress||{boolean} - is running value|Whether running or not progress bar now|progressBar.isInProgress()|

ProgressBarsSettings provider

You can use this methods only in config block. All methods returns this so you can chaining methods calls. For default values I used BEM methodology class naming convention.

|Method|Params|Default Value|Description|Example| |------|------|-------------|-----------|-------| |setContainerClass|{string} className|progress__container|Set container's class.|ProgressBarsSettingsProvider.setContainerClass('progress-container')| |setBarClass|{string} className|progress__bar|Set progress bar's class.|ProgressBarsSettingsProvider.setContainerClass('progress-bar')| |setShowingClass|{string} className|progress__container_showing|Set container's class which will be added when progress bar is running.|ProgressBarsSettingsProvider.setShowingClass('progress-bar-showing')|

ProgressBarsStorage service

This service has only one public method: get. With this method you can get ProgressBar instance and use its methods.
Example:

var mainProgressBar = ProgressBarsStorage.get('main');
var completed = false;

mainProgressBar.start();

var getInterval = setInterval(function () {
    if (completed) {
        clearInterval(getInterval);
    }

    console.log(mainProgressBar.get());
}, 1000);

setTimeout(function () {
    mainProgressBar.done();
    completed = true;
}, 5000);