1.6.5 • Published 10 years ago

dmn-elex-usa-choropleth v1.6.5

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

dmn-elex-usa-choropleth

Chart module for election Texas county choropleths.

Install

$ npm install --save dmn-elex-usa-choropleth
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, UsaChoropleth:

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

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

import UsaChoropleth from 'dmn-elex-usa-choropleth';

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

var myChart = new UsaChoropleth();

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

// update needs only new 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 $UsaChoropleth-container to represent the ID or class of the chart's container(s) and import the _chart-styles.scss partial.

$UsaChoropleth-container: '#chart';

@import 'path/to/dmn-elex-usa-choropleth/src/scss/_chart-styles';

Developing

Just run gulp:

$ gulp

Or to minimize javascript before publishing:

$ gulp --production
1.6.5

10 years ago

1.6.4

10 years ago

1.6.3

10 years ago

1.6.2

10 years ago

1.6.1

10 years ago

1.6.0

10 years ago

1.5.0

10 years ago

1.4.0

10 years ago

1.3.0

10 years ago

1.2.0

10 years ago

1.1.0

10 years ago

1.0.0

10 years ago