Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

canvas-heatmap

Package Overview
Dependencies
Maintainers
1
Versions
62
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

canvas-heatmap - npm Package Compare versions

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc