Responsive and slick progress bars

Overview

ProgressBar.js


Demo animation


Responsive and slick progress bars with animated SVG paths. Use built-in shapes or create your own paths. Customize the animations as you wish.

Documentation is hosted at readthedocs.org.

Shortcuts

Build status

Build Status Build status and browser tests for current master

Sauce Test Status

Contributing

See documentation for contributors.

Thanks

This project is a grateful recipient of the Futurice Open Source sponsorship program.

Comments
  • The instance of the ProgressBar Shape/Path should be accessible from the step function.

    The instance of the ProgressBar Shape/Path should be accessible from the step function.

    Unless i missed something, when using ProgressBar.Path there is no way to get the reference to itself from the step function supplied in instantiation unless using some round about referencing method. I would propose this also be passed as an argument to step or merged in to the state provided to step.

    Example usage would be to animate a progress bar on an irregular shaped custom path (like an arc) and also animate some text like a counter (similar to what is built in to circle and line) and might be achieved with the following:

    var svgPath = document.getElementById('svgPath'),
          counter = document.getElementById('counter');
    
    var p = new ProgressBar.Path(svgPath, {
          duration: 800,
          from: { strokeOffset: svgPath.getTotalLength() },
          to: { strokeOffset: 0 },
          attachment: { path: svgPath, counter: counter },
          // here self would be a ref to the ProgressBar.Path instance
          step: function (state, attachment, self) {
              attachment.path.setAttribute('strokeOffset', state.strokeOffset);
              attachment.counter.innerHTML = (self.value()*100);
          }
    });
    
    p.animate(0.75);
    
    opened by prodigitalson 11
  • Allow HTML in progress text

    Allow HTML in progress text

    This edit needs to be compiled into the final JS files - but basically this lets you add HTML inside the progress text dynamically. I encountered this problem when I needed the text to contain a number and below it another number and in a different color & smaller.

    opened by ghost 10
  • Demo suggestions

    Demo suggestions

    I'm working on a new demo page for the project. I'd be open to add your demos to the new site. If you want to suggest a demo, comment to this issue with:

    • Link to JSFiddle, you can fork this: http://jsfiddle.net/kimmobrunfeldt/a1osxLdj/3/
    • Short description, max 27 chars
    • Your name

    Example of submission below. Demos will be attributed to the creator of course.

    Current visual design of the new page looks like this:

    demo

    pending input 
    opened by kimmobrunfeldt 8
  • Seek to a specific point

    Seek to a specific point

    Hey, that's a wonderful library. I was wondering if there's a seek to a specific point in the progress bar function? Or you could guide me and I could write one if there isn't?

    feature idea 
    opened by RonCan 8
  • Add trailWidth and centerTail options

    Add trailWidth and centerTail options

    Allow users to specify trail width and center tail on the path. screen shot 2014-11-19 at 1 14 35 pm

    Sample usage:

            var progressBar = new ProgressBar.Circle(document.getElementById("container"), {
                strokeWidth: 10,
                color: "#fb7d08",
                trailColor: "#9797a5",
                trailWidth: 1,
                centerTrail: true
            });
    
            progressBar.set(0.3);
    
    
            var progressBar2 = new ProgressBar.Circle(document.getElementById("container"), {
                strokeWidth: 10,
                trailWidth: 1,
                trailColor: "#9797a5",
                centerTrail: true,
                color: "#6cb519"
            });
    
    opened by MayaLi 8
  • Ability to make a stacked progress bar?

    Ability to make a stacked progress bar?

    Is it possible to have multiple measurements in one progress bar? For example, if I want a bar to be empty, and if one button is clicked, it fills up X% green, and if I click a different button, the same bar fills up Y% yellow?

    EDIT: This is called a stacked progress bar

    help wanted feature idea pull request welcome 
    opened by cassidoo 7
  • Can't read property 'length' of null

    Can't read property 'length' of null

    When I'm changing my bar animate(), it somethings throws this error at me. Not on circles, but on line. After digging into the source code, it seems to pointing at shifty.js line 1251.

    Error code below, cut off the path of my files dir ##only:

    \node_modules\shifty\dist\shi…:1251 Uncaught TypeError: Cannot read property 'length' of null getFormatChunksFrom @ node_modules\progressbar.js\node_modules\shifty\dist\shi…:1251 (anonymous function) @ \node_modules\progressbar.js\node_modules\shifty\dist\shi…:1449 each @ \node_modules\progressbar.js\node_modules\shifty\dist\shi…:59 getFormatManifests @ \node_modules\progressbar.js\node_modules\shifty\dist\shi…:1441 tweenCreated @ \node_modules\progressbar.js\node_modules\shifty\dist\shi…:1631 (anonymous function) @ \node_modules\progressbar.js\node_modules\shifty\dist\shi…:164 each @ \node_modules\progressbar.js\node_modules\shifty\dist\shi…:59 applyFilter @ \node_modules\progressbar.js\node_modules\shifty\dist\shi…:162 Tweenable.setConfig @ \node_modules\progressbar.js\node_modules\shifty\dist\shi…:385 Tweenable.tween @ \node_modules\progressbar.js\node_modules\shifty\dist\shi…:300 animate @ \node_modules\progressbar.js\src\path.js:104 animate @ \node_modules\progressbar.js\src\shape.js:111 (anonymous function) @ index.js:221 // these two are just me calling animate() request.onload @ index.js:269 // these two are just me calling animate()

    pull request welcome pending input 
    opened by s92025592025 7
  • Outline instead of trail

    Outline instead of trail

    @kimmobrunfeldt Is it possible to make an outline instead of a trail line in the background? It should look like this:

    image

    If it is not implemented yet, would it be possible to do so?

    opened by sebu10n 7
  • Issue with the stroke showing in rgb not HEX

    Issue with the stroke showing in rgb not HEX

    I have an issue that the stroke in showing in RGB not HEX so it doesn't show in IE untitled-1 How do I get it in HEX? all the variables are in HEX

    my code:

    var element = document.getElementById('timeC');
    var circle = new ProgressBar.Circle(element, {
        trailColor: '#D8D8D8',
        trailWidth: 10,
        strokeWidth: 10,
    
        // Set default step function for all animate calls
        step: function(state, circle) {
            circle.path.setAttribute('stroke', state.color);
        }
    });
    

    to start the circle:

    circle.set(0);
    circle.animate(0.5, {
        from: {color: '#00FF00'},
        to: {color: '#FFAE00'},
        duration: 7500
    }, function(){
        circle.animate(0.99, {
            from: {color: '#FFAE00'},
            to: {color: '#FF0004'},
            duration: 10000
        });
    });
    
    opened by phara0hcom 7
  • Size incorrect in IE

    Size incorrect in IE

    It seems the height/width are around half the size they should be when viewing a circular progress bar in IE. This applies not only to my project, but also your project website's examples. Open your site in IE11 to see what I mean.

    opened by ts-Mike 7
  • show text in the middle

    show text in the middle

    can we add an api to insert text inside ProgressBar.Circle? I mean, I wan't to add the percentage inside of it without having to rely on external html+css. Thanks!

    enhancement 
    opened by luisrudge 7
  • Prototype Pollution using extend() in utils.js

    Prototype Pollution using extend() in utils.js

    Hi!There's a prototype pollution vulnerability in function extend() in the file utils.js.Affected versions of this package are vulnerable to Prototype Pollution which can allow an attacker to add/modify properties of the Object.prototype.the risk locate is in here: https://github.com/kimmobrunfeldt/progressbar.js/blob/74536b9eeeaaf51144706d918ed5a0a679631d96/src/utils.js#L20 https://github.com/kimmobrunfeldt/progressbar.js/blob/74536b9eeeaaf51144706d918ed5a0a679631d96/src/utils.js#L18 and the POC is as follow: var progressbar = require("progressbar.js") BAD_JSON = JSON.parse('{"proto":{"test":123}}'); console.log("Before"+{}.test) progressbar.utils.extend({},BAD_JSON,{}) console.log("After"+{}.test)

    More information about the vulnerability: https://github.com/HoLyVieR/prototype-pollution-nsec18/blob/master/paper/JavaScript_prototype_pollution_attack_in_NodeJS.pdf

    opened by lelecolacola123 0
  • Bump wheel from 0.24.0 to 0.38.1 in /docs

    Bump wheel from 0.24.0 to 0.38.1 in /docs

    Bumps wheel from 0.24.0 to 0.38.1.

    Changelog

    Sourced from wheel's changelog.

    Release Notes

    UNRELEASED

    • Updated vendored packaging to 22.0

    0.38.4 (2022-11-09)

    • Fixed PKG-INFO conversion in bdist_wheel mangling UTF-8 header values in METADATA (PR by Anderson Bravalheri)

    0.38.3 (2022-11-08)

    • Fixed install failure when used with --no-binary, reported on Ubuntu 20.04, by removing setup_requires from setup.cfg

    0.38.2 (2022-11-05)

    • Fixed regression introduced in v0.38.1 which broke parsing of wheel file names with multiple platform tags

    0.38.1 (2022-11-04)

    • Removed install dependency on setuptools
    • The future-proof fix in 0.36.0 for converting PyPy's SOABI into a abi tag was faulty. Fixed so that future changes in the SOABI will not change the tag.

    0.38.0 (2022-10-21)

    • Dropped support for Python < 3.7
    • Updated vendored packaging to 21.3
    • Replaced all uses of distutils with setuptools
    • The handling of license_files (including glob patterns and default values) is now delegated to setuptools>=57.0.0 (#466). The package dependencies were updated to reflect this change.
    • Fixed potential DoS attack via the WHEEL_INFO_RE regular expression
    • Fixed ValueError: ZIP does not support timestamps before 1980 when using SOURCE_DATE_EPOCH=0 or when on-disk timestamps are earlier than 1980-01-01. Such timestamps are now changed to the minimum value before packaging.

    0.37.1 (2021-12-22)

    • Fixed wheel pack duplicating the WHEEL contents when the build number has changed (#415)
    • Fixed parsing of file names containing commas in RECORD (PR by Hood Chatham)

    0.37.0 (2021-08-09)

    • Added official Python 3.10 support
    • Updated vendored packaging library to v20.9

    ... (truncated)

    Commits
    • 6f1608d Created a new release
    • cf8f5ef Moved news item from PR #484 to its proper place
    • 9ec2016 Removed install dependency on setuptools (#483)
    • 747e1f6 Fixed PyPy SOABI parsing (#484)
    • 7627548 [pre-commit.ci] pre-commit autoupdate (#480)
    • 7b9e8e1 Test on Python 3.11 final
    • a04dfef Updated the pypi-publish action
    • 94bb62c Fixed docs not building due to code style changes
    • d635664 Updated the codecov action to the latest version
    • fcb94cd Updated version to match the release
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies python 
    opened by dependabot[bot] 0
  • Bump certifi from 2015.11.20.1 to 2022.12.7 in /docs

    Bump certifi from 2015.11.20.1 to 2022.12.7 in /docs

    Bumps certifi from 2015.11.20.1 to 2022.12.7.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies python 
    opened by dependabot[bot] 0
  • JSdom causing Error: Uncaught [TypeError: this.path.getTotalLength is not a function]

    JSdom causing Error: Uncaught [TypeError: this.path.getTotalLength is not a function]

    In a React project that uses Jest and Testing Library, after adding some ProgressBar circles, the tests started to fail. I believe it is due to JSDom not supporting SVG.

    The error I'm receiving is:

      console.error
        Error: Uncaught [TypeError: this.path.getTotalLength is not a function]
            at reportException (node_modules\jsdom\lib\jsdom\living\helpers\runtime-script-errors.js:66:24)
            at innerInvokeEventListeners (node_modules\jsdom\lib\jsdom\living\events\EventTarget-impl.js:341:9)
            at invokeEventListeners (node_modules\jsdom\lib\jsdom\living\events\EventTarget-impl.js:274:3)
            at HTMLUnknownElementImpl._dispatch (node_modules\jsdom\lib\jsdom\living\events\EventTarget-impl.js:221:9)
            at HTMLUnknownElementImpl.dispatchEvent (node_modules\jsdom\lib\jsdom\living\events\EventTarget-impl.js:94:17)
            at HTMLUnknownElement.dispatchEvent (node_modules\jsdom\lib\jsdom\living\generated\EventTarget.js:231:34)
            at Object.invokeGuardedCallbackDev (node_modules\react-dom\cjs\react-dom.development.js:3994:16)
            at invokeGuardedCallback (node_modules\react-dom\cjs\react-dom.development.js:4056:31)
            at beginWork$1 (node_modules\react-dom\cjs\react-dom.development.js:23964:7)
            at performUnitOfWork (node_modules\react-dom\cjs\react-dom.development.js:22779:12)
            at workLoopSync (node_modules\react-dom\cjs\react-dom.development.js:22707:5)
            at renderRootSync (node_modules\react-dom\cjs\react-dom.development.js:22670:7)
            at performSyncWorkOnRoot (node_modules\react-dom\cjs\react-dom.development.js:22293:18)
            at node_modules\react-dom\cjs\react-dom.development.js:11327:26
            at unstable_runWithPriority (node_modules\scheduler\cjs\scheduler.development.js:468:12)
            at runWithPriority$1 (node_modules\react-dom\cjs\react-dom.development.js:11276:10)
            at flushSyncCallbackQueueImpl (node_modules\react-dom\cjs\react-dom.development.js:11322:9)
            at flushSyncCallbackQueue (node_modules\react-dom\cjs\react-dom.development.js:11309:3)
            at scheduleUpdateOnFiber (node_modules\react-dom\cjs\react-dom.development.js:21893:9)
            at setProgress (node_modules\react-dom\cjs\react-dom.development.js:16139:5)
            at _callee$ (src\components\widget\IamProgressWidget\IamProgressWidget.js:28:7)
            at tryCatch (node_modules\@babel\runtime\helpers\regeneratorRuntime.js:86:17)
            at Generator._invoke (node_modules\@babel\runtime\helpers\regeneratorRuntime.js:66:24)
            at Generator.next (node_modules\@babel\runtime\helpers\regeneratorRuntime.js:117:21)
            at asyncGeneratorStep (node_modules\@babel\runtime\helpers\asyncToGenerator.js:3:24)
            at _next (node_modules\@babel\runtime\helpers\asyncToGenerator.js:25:9)
            at runNextTicks (node:internal/process/task_queues:61:5)
            at listOnTimeout (node:internal/timers:526:9)
            at processTimers (node:internal/timers:500:7) TypeError: this.path.getTotalLength is not a function
            at new Path (node_modules\progressbar.js\src\path.js:43:28)
            at Circle.Shape (node_modules\progressbar.js\src\shape.js:99:26)
            at new Circle (node_modules\progressbar.js\src\circle.js:16:11)
            at src\components\widget\IamProgressWidget\ProgressCircle.js:23:7
            at mountMemo (node_modules\react-dom\cjs\react-dom.development.js:15846:19)
            at Object.useMemo (node_modules\react-dom\cjs\react-dom.development.js:16219:16)
            at useMemo (node_modules\react\cjs\react.development.js:1532:21)
            at ProgressCircle (src\components\widget\IamProgressWidget\ProgressCircle.js:21:22)
            at renderWithHooks (node_modules\react-dom\cjs\react-dom.development.js:14985:18)
            at mountIndeterminateComponent (node_modules\react-dom\cjs\react-dom.development.js:17811:13)
            at beginWork (node_modules\react-dom\cjs\react-dom.development.js:19049:16)
            at HTMLUnknownElement.callCallback (node_modules\react-dom\cjs\react-dom.development.js:3945:14)
            at HTMLUnknownElement.callTheUserObjectsOperation (node_modules\jsdom\lib\jsdom\living\generated\EventListener.js:26:30)
            at innerInvokeEventListeners (node_modules\jsdom\lib\jsdom\living\events\EventTarget-impl.js:338:25)
            at invokeEventListeners (node_modules\jsdom\lib\jsdom\living\events\EventTarget-impl.js:274:3)
            at HTMLUnknownElementImpl._dispatch (node_modules\jsdom\lib\jsdom\living\events\EventTarget-impl.js:221:9)
            at HTMLUnknownElementImpl.dispatchEvent (node_modules\jsdom\lib\jsdom\living\events\EventTarget-impl.js:94:17)
            at HTMLUnknownElement.dispatchEvent (node_modules\jsdom\lib\jsdom\living\generated\EventTarget.js:231:34)
            at Object.invokeGuardedCallbackDev (node_modules\react-dom\cjs\react-dom.development.js:3994:16)
            at invokeGuardedCallback (node_modules\react-dom\cjs\react-dom.development.js:4056:31)
            at beginWork$1 (node_modules\react-dom\cjs\react-dom.development.js:23964:7)
            at performUnitOfWork (node_modules\react-dom\cjs\react-dom.development.js:22779:12)
            at workLoopSync (node_modules\react-dom\cjs\react-dom.development.js:22707:5)
            at renderRootSync (node_modules\react-dom\cjs\react-dom.development.js:22670:7)
            at performSyncWorkOnRoot (node_modules\react-dom\cjs\react-dom.development.js:22293:18)
            at node_modules\react-dom\cjs\react-dom.development.js:11327:26
            at unstable_runWithPriority (node_modules\scheduler\cjs\scheduler.development.js:468:12)
            at runWithPriority$1 (node_modules\react-dom\cjs\react-dom.development.js:11276:10)
            at flushSyncCallbackQueueImpl (node_modules\react-dom\cjs\react-dom.development.js:11322:9)
            at flushSyncCallbackQueue (node_modules\react-dom\cjs\react-dom.development.js:11309:3)
            at scheduleUpdateOnFiber (node_modules\react-dom\cjs\react-dom.development.js:21893:9)
            at setProgress (node_modules\react-dom\cjs\react-dom.development.js:16139:5)
            at _callee$ (src\components\widget\IamProgressWidget\IamProgressWidget.js:28:7)
            at tryCatch (node_modules\@babel\runtime\helpers\regeneratorRuntime.js:86:17)
            at Generator._invoke (node_modules\@babel\runtime\helpers\regeneratorRuntime.js:66:24)
            at Generator.next (node_modules\@babel\runtime\helpers\regeneratorRuntime.js:117:21)
            at asyncGeneratorStep (node_modules\@babel\runtime\helpers\asyncToGenerator.js:3:24)
            at _next (node_modules\@babel\runtime\helpers\asyncToGenerator.js:25:9)
            at runNextTicks (node:internal/process/task_queues:61:5)
            at listOnTimeout (node:internal/timers:526:9)
            at processTimers (node:internal/timers:500:7)
    

    The React widget code to draw the circle is below:

    import React, { useEffect, useMemo, useCallback } from "react";
    import { Circle } from "progressbar.js";
    
    const ProgressCircle = ({ level, animate }) => {
      var wrapper = document.createElement("div");
      wrapper.className = "progressBarDiv";
      wrapper.style = "height:50px;display:flex;flex-direction:column";
      wrapper.id = level;
      var percentage = Math.round(animate * 100);
      var color = "#7F00FF";
      if (percentage >= 80) {
        color = "#00FF00";
      } else if (percentage >= 50) {
        color = "#003FFF";
      }
    
      const bar = useMemo(
        () =>
          new Circle(wrapper, {
            strokeWidth: 6,
            easing: "easeInOut",
            duration: 1400,
            color: color,
            trailColor: "#888",
            trailWidth: 1,
            step: function (state, circle) {
              circle.setText(percentage + "%");
            },
          }),
        []
      );
    
      const node = useCallback((node) => {
        if (node) {
          node.appendChild(wrapper);
        }
      }, []);
    
      useEffect(() => {
        bar.animate(animate);
      }, [animate, bar]);
    
      return <div ref={node} />;
    };
    
    export default ProgressCircle;
    

    As a workaround, I added this code to check if the userAgent has "jsdom" in it, and just return a blank div instead of drawing.

      // Don't try to draw anything if the user agent reports "jsdom",
      // since Jest/Testing Library using jsdom cannot draw SVGs and this breaks the
      // ProgressBar.js library.
      var userAgent = window.navigator.userAgent;
      if (userAgent !== undefined) {
        if (userAgent.search("jsdom") >= 0) {
          return <div />;
        }
      }
    

    Would it be possible to add some validation on the path value. In this case, it was the in the Path function in path.js:

    var Path = function Path(path, opts) {
        // Throw a better error if not initialized with `new` keyword
        if (!(this instanceof Path)) {
            throw new Error('Constructor was called without new keyword');
        }
    
        // Default parameters for animation
        opts = utils.extend({
            delay: 0,
            duration: 800,
            easing: 'linear',
            from: {},
            to: {},
            step: function() {}
        }, opts);
    
        var element;
        if (utils.isString(path)) {
            element = document.querySelector(path);
        } else {
            element = path;
        }
    
        // Reveal .path as public attribute
        this.path = element;
        this._opts = opts;
        this._tweenable = null;
    
        // Set up the starting positions
        var length = this.path.getTotalLength();
        this.path.style.strokeDasharray = length + ' ' + length;
        this.set(0);
    };
    
    opened by cybersmithio 0
  • progressbar not working in classs

    progressbar not working in classs

    When i create one progressbar like this

    this.progressbar = new ProgressBar.Circle(`#${this.id}_progressbar`, {
      strokeWidth: 9,
      trailWidth: 9,
      trailColor: '#363348',
      easing: 'easeInOut',
      duration: 1000,
      color: this.color,
    });
    
    

    everything works until I create another element in the class, if I create for example 3 progressbars then only the last one will work any ideas?

    opened by Virelox 0
  • Progress Bar, not animating on inactive tab.

    Progress Bar, not animating on inactive tab.

    I have progress bar and I am using signalR to trigger animation, It workes perfectly when I am on the tab but when the tab is inavtive it pauses the animation.

    var bar = new ProgressBar.Line("#su_progress-spinner", { strokeWidth: 4, easing: 'easeInOut', duration: 1400, color: '#1dc9b7', trailColor: '#eee', trailWidth: 1, svgStyle: {width: '100%', height: '100%'}, text: { style: { // Text color. // Default: same as stroke color (options.color) color: '#999', position: 'absolute', right: '0', top: '30px', padding: 0, margin: 0, transform: null }, autoStyleContainer: false }, from: {color: '#1dc9b7'}, to: {color: '#1dc9b7'}, step: (state, bar) => { bar.setText(Math.round(bar.value() * 100) + ' %'); } });

    opened by herryG 0
Releases(1.0.1)
  • 1.0.1(Apr 23, 2016)

  • 1.0.0(Mar 14, 2016)

    • New documentation in http://progressbarjs.readthedocs.org/en/1.0.0/

    • Fixed and updated sauce labs tests

    • Add text.autoStyleContainer option

    • HTML string or DOM element is now possible to pass in opts.text.value or to .setText method

    • breaking: Change behavior default style options. From now on, if you define anything to opts.svgStyle or opts.text.style yourself, no default values will be used. This makes customising the styles easier in JS. If you want to only change one single style attribute, you can do it after initializing the progress bar, like this:

      var bar = new ProgressBar.Line('#container');
      bar.text.style.fontSize = '40px';
      
    • Fix https://github.com/kimmobrunfeldt/progressbar.js/issues/107

    Source code(tar.gz)
    Source code(zip)
  • 0.9.0(Aug 4, 2015)

    Contains API breaking changes compared to 0.8.x:

    • Square shape is now removed from the API. It's not very useful bar type. You can still find it from ./src/square.js, you can manually add it to your project
    • options.text.autoStyle is replaced with options.text.style. If you had autoStyle: false, you should now use options.text.style = null. That will disable all default styles. New API for style changes improves the control of inline styles.
    • Add options.svgStyle and automatically resizes to the container. width: 100%; css style is set for the SVG element.

    Other additions:

    • New shape: SemiCircle

      semicircle

    • Expose more internal modules for customization Shape and utils are now exposed. https://github.com/kimmobrunfeldt/progressbar.js/commit/ffb151d954d7486a96c2b8ed05a4648a1613f206

    • Upgrade to shifty version 1.5.0, easing can be now specified as a function.

    • Improve code consistency with linters.

    Source code(tar.gz)
    Source code(zip)
  • 0.8.1(Apr 8, 2015)

  • 0.8.0(Apr 8, 2015)

    API breaking change for step function! If you haven't used option.attachment, nothing has changed. Most likely you don't need to change anything.

    Thanks to @prodigitalson who provided fixes to step function and added a lot of tests.

    All changes:

    • API breaking change to step function:

      Before this release, Shape was passed as an attachment to Path. If you overrode the attachment, there was no way to get reference to the Shape inside step function. Before:

      step: function(state, attachment) {
          // Do step
      }
      

      Now you can always reference to the Shape or Path inside the step function. Reference to self is passed as second parameter. User's custom attachment is now passed as the third parameter After:

      step: function(state, self, attachment) {
          // self is reference to Shape or Path
          // Do step
      }            
      
    • Expose SVG path element as .path attribute for Path objects. That is consistent with Shape objects.

    • Make it possible to pass selector as a string to Path object. Earlier only direct element was accepted.

    • More tests

    Source code(tar.gz)
    Source code(zip)
  • 0.7.4(Jan 13, 2015)

    These were fixed and released fast because some functionality was broken

    • Fixed bugs when step function was initially called. value() function returns now 0 in initial step call.
    • Fix bug where two text nodes were left inside progress bar
    • Fix bug with custom easings in initial step function
    Source code(tar.gz)
    Source code(zip)
  • 0.7.3(Jan 13, 2015)

  • 0.7.2(Jan 12, 2015)

  • 0.7.1(Jan 12, 2015)

    • Call step function on initialization also
    • Fix text creation with setText if opts.text is not defined at initialization
    • When calling step in .set() method, use correct easing instead of hardcoded linear
    • Remove unnecessary step call on tween finish
    Source code(tar.gz)
    Source code(zip)
  • 0.7.0(Jan 11, 2015)

    Adds .text and .setText() to API, but is backwards compatible

    • Add text option and setText method
    • Throw better error if container does not exist
    • Small refactoring
    • Call given step function when .set() is called
    • Decrease precision of returned progressbar value
    Source code(tar.gz)
    Source code(zip)
  • 0.6.1(Dec 9, 2014)

    This changes the behavior of custom animation support, but API stays the same

    • Add trailWidth option
    • Improve custom animations support. User doesn't have to interpolate values anymore.
    • Throw error if progress bars are initialized without new keyword
    • Fix bug if empty opts was passed
    Source code(tar.gz)
    Source code(zip)
  • 0.6.0(Nov 10, 2014)

    This release contains additions and modifications to API

    • Add destroy() method
    • Add stop() method
    • Add svg attribute for built-in shapes
    • Round progress from .value() to prevent returning very small number like 1e-30
    • Add license banner to distributable files
    Source code(tar.gz)
    Source code(zip)
  • 0.5.4(Oct 26, 2014)

    This release does not change functionality of ProgressBar.

    • Change main script to point to source file instead of bundled file to prevent browserify including shifty twice.
    Source code(tar.gz)
    Source code(zip)
  • 0.5.3(Oct 26, 2014)

    This release does not change functionality of ProgressBar.

    This release was rushed and the changes should have been released same time with 0.5.4

    Source code(tar.gz)
    Source code(zip)
  • 0.5.2(Oct 26, 2014)

    This release does not change functionality of ProgressBar.

    • Removed --debug flag from Browserify command because it made debugger show incorrect lines. That happens because shifty is bundled inside final script.
    Source code(tar.gz)
    Source code(zip)
  • 0.5.1(Oct 25, 2014)

    This release does not change functionality of ProgressBar.

    • Custom UMD module definition was removed from source code and Browserify generates it instead.
    • Removed shifty from this repository and defined it as a npm dependency.
    Source code(tar.gz)
    Source code(zip)
  • 0.5.0(Oct 20, 2014)

  • 0.4.1(Oct 20, 2014)

    • Add custom animation support
    • Add references to path and trail

    There was some hassle with 0.4.0 being accidentally a branch and tag so released a new 0.4.1 just in case.

    Source code(tar.gz)
    Source code(zip)
  • 0.2.1(Oct 13, 2014)

  • 0.2.0(Oct 13, 2014)

    This is the first sensible release which supports all major browsers. CSS3 transitions had to be switched to JS animations for better browser support.

    Source code(tar.gz)
    Source code(zip)
Owner
Kimmo Brunfeldt
Tech, design and tiny perfect details. Software at @aiven.
Kimmo Brunfeldt
Material Progress —Google Material Design Progress linear bar. By using CSS3 and vanilla JavaScript.

MProgress.js Google Material Design Progress Linear bar. It uses CSS3 and vanilla JavaScript which doesn't depend on any other libraries. Types and pr

gc 1.5k Nov 30, 2022
ProgressJs is a JavaScript and CSS3 library which help developers to create and manage progress bar for every objects on the page.

ProgressJS ProgressJs is a JavaScript and CSS3 library which helps developers create and manage progress bars for every object on the page. How To Use

usablica 2.4k Dec 30, 2022
Automatically add a progress bar to your site.

PACE An automatic web page progress bar. Demo Documentation Include pace.js and the theme css of your choice on your page (as early as is possible), a

null 15.5k Jan 8, 2023
Multiple file upload plugin with image previews, drag and drop, progress bars. S3 and Azure support, image scaling, form support, chunking, resume, pause, and tons of other features.

Fine Uploader is no longer maintained and the project has been effectively shut down. For more info, see https://github.com/FineUploader/fine-uploader

Fine Uploader 8.2k Jan 2, 2023
Dropzone is an easy to use drag'n'drop library. It supports image previews and shows nice progress bars.

Dropzone is a JavaScript library that turns any HTML element into a dropzone. This means that a user can drag and drop a file onto it, and Dropzone wi

Dropzone 17k Dec 30, 2022
Very lightweight progress bars. No jQuery

Very lightweight progress bars (~699 bytes gzipped). Compatibility: iE7+ and the rest of the world Demo See nanobar.jacoborus.codes Installation Downl

Jacobo Tabernero 2.9k Dec 19, 2022
Slim progress bars for anywhere you want to use

qier-progress is a progress bar. It can be used for some watting time like jump links, request data, and load or upload files and images to give us feedback and reduce our anxiety. Also if you have used nprogress, then you must know what I am talking about ~

chen xin 370 Nov 5, 2022
A slick loader to use during your AJAX calls or data processing

Slick Loader A slick loader to use during your AJAX calls or data processing Doc Installation Simply import slick-loader into your HTML. <link rel="st

Zenoo 1 Jan 21, 2022
Material Progress —Google Material Design Progress linear bar. By using CSS3 and vanilla JavaScript.

MProgress.js Google Material Design Progress Linear bar. It uses CSS3 and vanilla JavaScript which doesn't depend on any other libraries. Types and pr

gc 1.5k Nov 30, 2022
A set of flat and 3D progress button styles where the button itself serves as a progress indicator

A set of flat and 3D progress button styles where the button itself serves as a progress indicator. 3D styles are used for showing the progress indication on one side of the button while rotating the button in perspective.

Codrops 608 Oct 19, 2022
📈 A small, fast chart for time series, lines, areas, ohlc & bars

?? μPlot A small (~35 KB min), fast chart for time series, lines, areas, ohlc & bars (MIT Licensed) Introduction μPlot is a fast, memory-efficient Can

Leon Sorokin 7.5k Jan 7, 2023
Responsive Tabs is a jQuery plugin that provides responsive tab functionality.

Responsive Tabs is a jQuery plugin that provides responsive tab functionality. The tabs transform to an accordion when it reaches a CSS breakpoint. You can use this plugin as a solution for displaying tabs elegantly on desktop, tablet and mobile.

Jelle Kralt 537 Dec 8, 2022
ProgressJs is a JavaScript and CSS3 library which help developers to create and manage progress bar for every objects on the page.

ProgressJS ProgressJs is a JavaScript and CSS3 library which helps developers create and manage progress bars for every object on the page. How To Use

usablica 2.4k Dec 30, 2022
Bookstore CMS React Front-End to display a list of books, categorize it, add and remove books and update your reading progress

Bookstore REACT app to manage your books Build an app to display a list of books, categorize it, add and remove books and update your reading progress

Eapen Zacharias 3 Aug 19, 2022
To-Do list a web app for tracking personal progress through the day. Users can input a list of tasks and mark them as completed once they are done. Built with JavaScript and Webpack

To-do-List-Project To Do List Project Description. This project creates a simple HTML list of To Do tasks. It was built using webpack and served by a

Olawale Olapetan 7 Jul 8, 2022
This application allows you to create a list to keep tracks of the books you are reading and check the progress for each book.

Bookstore This is an application built to track the books you are reading and the progress you have made for each book! Additional description about t

Santiago Velosa 4 Feb 27, 2022
CLI Progress Bar implemented in NodeJS to track Time, ETA and Steps for any long running jobs in any loops in JS, NodeJS code

NodeJS-ProgressBar CLI Progress Bar for NodeJS and JavaScript to track Time, ETA and Steps for any long running jobs in any loops in JS, NodeJS code D

Atanu Sarkar 5 Nov 14, 2022
Habitapp is a simple app that helps you build positive habits, measure progress and achieve your goals

habitapp Habitapp is a simple app that helps you build positive habits, measure progress and achieve your goals. ✨ Features Working without registrati

null 6 Sep 11, 2022