1.3.10 • Published 6 years ago

dmn-elex-balance-of-power v1.3.10

Weekly downloads
-
License
ISC
Repository
-
Last release
6 years ago

dmn-elex-balance-of-power

npm version

Chart module for balance of power bars.

npm.io

Install

$ npm install --save dmn-elex-balance-of-power
Requirements

This module uses ES6 syntax. To use as a pre-compiled module, you'll need a compiler like babel.

Use

In the client, include the global-chart.js bundle, which defines a global chart object, BalanceOfPower:

<script src="some/path/to/global-chart.js"></script>

To use as a module, simply import the chart object:

import BalanceOfPower from 'dmn-elex-balance-of-power';

The chart object has two methods, one to create the chart, initially, and another to update it.

var myChart = new BalanceOfPower();

// create needs a selection string and prefectched data
myChart.create('#chart', data);

// update needs only new data
myChart.update(newData);

//resizing when only the div has changed
myChart.resize('#chart');

To apply this chart's default styles when using SCSS, simply define the variable $BalanceOfPower-container to represent the ID or class of the chart's container(s) and import the _chart-styles.scss partial.

$BalanceOfPower-container: '#chart';

@import 'path/to/dmn-elex-balance-of-power/src/scss/_chart-styles';

Developing

Write your chart code in chart.js and add custom styles to _chart-styles.scss.

Then, just run gulp:

$ gulp

Or to minimize javascript before publishing:

$ gulp --production
1.3.10

6 years ago

1.3.9

6 years ago

1.3.8

6 years ago

1.3.7

6 years ago

1.3.6

6 years ago

1.3.5

6 years ago

1.3.4

8 years ago

1.3.3

8 years ago

1.2.2

8 years ago

1.3.2

8 years ago

1.3.1

8 years ago

1.2.1

8 years ago

1.2.0

8 years ago