1.2.9 • Published 8 years ago

dmn-elex-race-tracker v1.2.9

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

dmn-elex-race-tracker

Chart module for election head-to-head presidential race results line chart.

npm.io

Install

$ npm install --save dmn-elex-race-tracker
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, RaceTracker:

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

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

import RaceTracker from 'dmn-elex-race-tracker';

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

var myChart = new RaceTracker();

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

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

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

$RaceTracker-container: '#chart';

@import 'path/to/dmn-elex-race-tracker/src/scss/_chart-styles';
Container dimensions

This chart wants to be in a container at least 240px tall. It resizes to the width of its container.

Developing

Just run gulp:

$ gulp

Or to minimize javascript before publishing:

$ gulp --production
1.2.9

8 years ago

1.2.8

8 years ago

1.2.7

8 years ago

1.2.6

8 years ago

1.2.5

8 years ago

1.2.4

8 years ago

1.2.3

8 years ago

1.2.2

8 years ago

1.2.1

8 years ago

1.2.0

8 years ago

1.1.0

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.0

8 years ago