ibm-js/deliteful — pull request #28 by seb-pereira (2014-01-30 17:31:29+00:00)
Title: ProgressIndicator

#ProgressIndicator
A **ProgressIndicator** widget displays a round spinning graphical representation that indicates that a task is ongoing. A value can be set to indicate a percentage of progression.

##Usage
```html

```

```js
/* Javascript */
var aProgressInidator = new ProgressIndicator();
aProgressInidator.startup();
```

The animation automatically starts when the html page is loaded, or when the *startup()* method is called.

###Disable the automatic startup of the animation
You can disable the automatic startup of the animation with the `autoStart`	attribute:

```html

```
```js
/* Javascript */
var aProgressInidator = new ProgressIndicator({autoStart: false});
aProgressInidator.startup();
```
You may also set `aProgressInidator.autoStart` *before* you call the startup() method.

###Display a percentage of progression
Just set a value (from 0 to 100) to indicate the percentage of progression of the ongoing task.
```html

```

```js
/* Javascript */
var aProgressIndicator = document.getElementById("aProgressIndicator");
var percentage;
//...
aProgressInidator.value = percentage;
```
Setting the `value` attribute:
- stops any ongoing pinning animation,
- overrides the `autoStart` attribute,
- displays the value and the fill the spinning lines accordingly.

###Manually start and stop the animation
The animation can be stopped or started manually using *start()* and *stop()*	methods.
```js
/* Javascript */
var aProgressInidator = new ProgressIndicator({autoStart: false});
aProgressInidator.startup();
// ...
aProgressIndicator.start(); // start the animation
// ...
aProgressIndicator.stop(); // stop the animation
```

###Change the speed of the animation
The animation makes on revolution in 1 second. This is the default duration that may vary depending on devices/browsers capacity/limitations. The `lapsTime` attribute allow you to change this duration, in milliseconds. Any value below 500ms are defaulted to 1 second.
```html

```
```js
/* Javascript */
var aProgressIndicator = new ProgressIndicator({lapsTime: 600});
aProgressInidator.lapsTime = 2000;
```

##Attributes

Attributes available on ProgressIndicator

Attribute
Type/unit
Default
Description

Footer

autoStart
boolean
true
Set to false disabled the automatic startup of the animation when the widget starts.

lapsTime
boolean (ms)
1000
Duration of an animation revolution in milliseconds. Minimum value is 500ms: lower values are defaulted to the minimum value.

value
number
-
Set a value from 0 to 100 to indicate a percentage of progression of an ongoing task. Negative value is defaulted to 0. Values up to 100 are defaulted to 100. NaN is ignored. Explicit declaration of this attribute cancel the auto start animation.

##Styling
**ProgressIndicator** generates SVG markup that can be styled using CSS and/or inline styles. The treemap provides a default TreeMap.css that must be included in your application. Alternate rendering can be achieved by overriding some of the CSS rules and using the classes put by the treemap on the HTML elements.