canvas-heatmap
Advanced tools
Comparing version 1.4.6 to 1.4.7
{ | ||
"name": "canvas-heatmap", | ||
"version": "1.4.6", | ||
"version": "1.4.7", | ||
"description": "Interactive heatmap, capable of displaying 1,000,000+ data points using canvas and d3. ", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -38,2 +38,3 @@ import { | ||
convertToRGB, | ||
convertToHex, | ||
getFileIndex, | ||
@@ -267,2 +268,3 @@ closest, | ||
c.rgba = c.color; | ||
c.color = convertToHex(c.color); | ||
} else { | ||
@@ -269,0 +271,0 @@ c.rgba = convertToRGB(c.color); |
@@ -13,2 +13,14 @@ export const convertToRGB = (hex) => { | ||
export const convertToHex = (rgb) => { | ||
return hex(rgb[0]) + hex(rgb[1]) + hex(rgb[2]); | ||
} | ||
const hex = (c) => { | ||
var s = "0123456789abcdef"; | ||
var i = parseInt(c, 10); | ||
if (i === 0 || isNaN(c)) return "00"; | ||
i = Math.round(Math.min(Math.max(0, i), 255)); | ||
return s.charAt((i - (i % 16)) / 16) + s.charAt(i % 16); | ||
} | ||
export const getRGBAColor = (value, min, max, colors) => { | ||
@@ -15,0 +27,0 @@ if (value === null || isNaN(value)) { |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
58611
1694
0