1.0.15 • Published 7 years ago

dmn-elex-tx-senate-turnout v1.0.15

Weekly downloads
1
License
ISC
Repository
github
Last release
7 years ago

dmn-elex-tx-senate-turnout

Turnout scatterplot for the 2018 U.S. Senate race in Texas.

npm.io

Install

$ npm install --save dmn-elex-tx-senate-turnout
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, TXSenateTurnoutChart:

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

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

import TXSenateTurnoutChart from 'dmn-elex-tx-senate-turnout';

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

var myChart = new TXSenateTurnoutChart();

// create needs a selection string and prefectched current-year data, historical data and candidate objects
myChart.create('#chart', data, historicalData, candidateData);

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

// resize based on how the container has changed
myChart.resize('#chart')

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

$TXSenateTurnout-container: '#chart';

@import 'path/to/dmn-elex-tx-senate-turnout/src/scss/_chart-styles';

Developing

Just run gulp:

$ gulp

Or to minimize javascript before publishing:

$ gulp --production
1.0.15

7 years ago

1.0.14

7 years ago

1.0.13

7 years ago

1.0.12

7 years ago

1.0.11

7 years ago

1.0.10

7 years ago

1.0.9

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago