1.0.7 • Published 10 years ago

dmn-elex-scatterplot v1.0.7

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

dmn-elex-scatterplot

Chart module for censusScatterplot.

npm.io

Install

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

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

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

import censusScatterplot from 'dmn-elex-scatterplot';

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

var myChart = new censusScatterplot();

// create needs a selection string and prefectched data
myChart.create('#chart', data, censusData, countiesData, table, tableTitle, tableVariable[optional]);

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

// update needs only new data
myChart.resize('#chart1');

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

$censusScatterplot-container: '#chart';

@import 'path/to/dmn-elex-scatterplot/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.0.7

10 years ago

1.0.6

10 years ago

1.0.5

10 years ago

1.0.4

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago