dmn-elex-texas-choropleth

1.2.0 • Public • Published

dmn-elex-texas-choropleth

Chart module for election Texas county choropleths.

Install

$ npm install --save dmn-elex-texas-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, TexasChoropleth:

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

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

import TexasChoropleth from 'dmn-elex-texas-choropleth';

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

var myChart = new TexasChoropleth();
 
// create needs a selection string and prefectched data and geoData (topojson)
myChart.create('#chart', data, geoData);
 
// 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 $TexasChoropleth-container to represent the ID or class of the chart's container(s) and import the _chart-styles.scss partial.

$TexasChoropleth-container: '#chart';
 
@import 'path/to/dmn-elex-texas-choropleth/src/scss/_chart-styles';

Developing

Just run gulp:

$ gulp

Or to minimize javascript before publishing:

$ gulp --production

Readme

Keywords

none

Package Sidebar

Install

npm i dmn-elex-texas-choropleth

Weekly Downloads

7

Version

1.2.0

License

ISC

Unpacked Size

4.42 MB

Total Files

23

Last publish

Collaborators

  • jwilkerson
  • jhancock
  • ajv
  • stephanielamm