makerparty-heatmap

0.1.5 • Public • Published

makerparty-heatmap

Generates a Maker Party styled heatmap given the number of events by country.

Install

npm install --save makerparty-heatmap

Usage

The heatmap is intended to be used within an express app but should work anywhere. It has 2 methods, one returns the base svg used to generate heatmaps. The other actually generates a heatmap given event stats by country.

var heatmap = require( 'makerparty-heatmap' );
var request = require( 'request' );

app.get( '/heatmap.svg', function( req, res ) {
  request.get( 'http://party.webmaker.org/event-stats' , function( error, response, data ) {
	var stats = JSON.parse( data );
	res.send( heatmap.generateHeatmap( stats.byCountry ) );
  });
});

License

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.

Package Sidebar

Install

npm i makerparty-heatmap

Weekly Downloads

0

Version

0.1.5

License

MPL-2.0

Last publish

Collaborators

  • fuzzyfox