canvas-heatmap
Advanced tools
Comparing version 1.6.0 to 1.6.1
{ | ||
"name": "canvas-heatmap", | ||
"version": "1.6.0", | ||
"version": "1.6.1", | ||
"description": "Interactive heatmap, capable of displaying 1,000,000+ data points using canvas and d3. ", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -275,2 +275,3 @@ import { | ||
}); | ||
options.colorCache = new Map(); | ||
@@ -277,0 +278,0 @@ options.canvasWidth = Math.floor( |
@@ -44,3 +44,3 @@ import { getRGBAColor, indexOfClosest, isNumeric } from "./functions"; | ||
const colorScale = (v) => { | ||
return getRGBAColor(v, options.zMin, options.zMax, options.colors); | ||
return getRGBAColor(v, options.zMin, options.zMax, options.colors, options.colorCache); | ||
}; | ||
@@ -157,3 +157,3 @@ | ||
const colorScale = (v) => { | ||
return getRGBAColor(v, options.zMin, options.zMax, options.colors); | ||
return getRGBAColor(v, options.zMin, options.zMax, options.colors, options.colorCache); | ||
}; | ||
@@ -206,3 +206,3 @@ var { indexxpix, indexypix } = pixelMapping(arr, scaleX, scaleY, options); | ||
const colorScale = (v) => { | ||
return getRGBAColor(v, options.zMin, options.zMax, options.colors); | ||
return getRGBAColor(v, options.zMin, options.zMax, options.colors, options.colorCache); | ||
}; | ||
@@ -209,0 +209,0 @@ var imgData = context.createImageData( |
@@ -25,5 +25,3 @@ export const convertToRGB = (hex) => { | ||
const colorCache = new Map(); | ||
export const getRGBAColor = (value, min, max, colors) => { | ||
export const getRGBAColor = (value, min, max, colors, colorCache) => { | ||
if (value === null || isNaN(value)) return [255, 255, 255, 0]; | ||
@@ -30,0 +28,0 @@ if (value < min || value > max) return [0, 0, 0, 0]; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
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
965843
0