Comparing version 0.0.2 to 0.0.3
10
index.js
@@ -70,8 +70,12 @@ var convert = require('color-convert'); | ||
Heat.prototype.addPoint = function (x, y, radius) { | ||
Heat.prototype.addPoint = function (x, y, params) { | ||
var ctx = this.alphaCanvas.getContext('2d'); | ||
if (!radius) radius = this.radius; | ||
if (typeof params === 'number') { | ||
params = { radius : params }; | ||
} | ||
if (!params) params = {}; | ||
var radius = params.radius || this.radius; | ||
var g = ctx.createRadialGradient(x, y, 0, x, y, radius); | ||
var a = 1 / 10; | ||
var a = params.weight || (1 / 10); | ||
@@ -78,0 +82,0 @@ g.addColorStop(0, 'rgba(255,255,255,' + a + ')'); |
{ | ||
"name" : "heatmap", | ||
"version" : "0.0.2", | ||
"version" : "0.0.3", | ||
"description" : "canvas heat maps for node and the browser", | ||
@@ -5,0 +5,0 @@ "main" : "index.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7469
137
83