目录

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/.

关于
145.0 KB
邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9 京公网安备 11010802032778号