Join our webinar on Wednesday, June 26, at 1pm EDTHow Chia Mitigates Risk in the Crypto Industry.Register
Socket
Socket
Sign inDemoInstall

canvas-heatmap

Package Overview
Dependencies
37
Maintainers
1
Versions
58
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.4.6 to 1.4.7

2

package.json
{
"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)) {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc