
Security News
TC39 Advances 11 Proposals for Math Precision, Binary APIs, and More
TC39 advances 11 JavaScript proposals, with two moving to Stage 4, bringing better math, binary APIs, and more features one step closer to the ECMAScript spec.
heatmap-values
Advanced tools
Generate heatmap with RGBA from pre-built or custom color scheme.
Designed for class activation map of image classifier AI model visualization.
npm install heatmap-values
You can also install heatmap-values
with pnpm, yarn, or slnpm
import { generate_heatmap_values, heatmap_schemes } from 'heatmap-values'
let values = generate_heatmap_values(heatmap_schemes.red_transparent_blue)
for (let i = 0; i < 256; i++) {
let [r, g, b, a] = values[i]
let color = `rgba(${r},${g},${b},${a})`
console.log(i / 255, color)
}
Detail usage example see demo.ts and demo.html.
export function generate_heatmap_values(
/** @description default is red_transparent_blue */
scheme?: HeatmapScheme,
): RGBA[]
export type HeatmapScheme = {
low: RGBA
middle: RGBA
high: RGBA
}
export type RGBA = [
/** @description 0..255 */
r: number,
/** @description 0..255 */
g: number,
/** @description 0..255 */
b: number,
/** @description 0..1 */
a: number,
]
export const heatmap_schemes: {
red_green_blue: HeatmapScheme
red_transparent_blue: HeatmapScheme
hot_only: HeatmapScheme
cold_only: HeatmapScheme
}
This project is licensed with BSD-2-Clause
This is free, libre, and open-source software. It comes down to four essential freedoms [ref]:
FAQs
Generate heatmap with RGBA from pre-built or custom color scheme.
The npm package heatmap-values receives a total of 1 weekly downloads. As such, heatmap-values popularity was classified as not popular.
We found that heatmap-values demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
TC39 advances 11 JavaScript proposals, with two moving to Stage 4, bringing better math, binary APIs, and more features one step closer to the ECMAScript spec.
Research
/Security News
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Product
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.