You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@sarpere/heatmapjs-react

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sarpere/heatmapjs-react

Heatmapjs React bindings

0.2.0
latest
Source
npmnpm
Version published
Weekly downloads
54
-27.03%
Maintainers
1
Weekly downloads
 
Created
Source

Heatmapjs React

A very simple port of heatmap.js for React. The idea behind this component is to be able to display a heatmap over any type of content (image, div, components ...). Inspired by react-heatmap.

Demo & Examples

Live Demo: @sarpere/heatmapjs-react

yarn
yarn dev
@sarpere/heatmapjs-react example

Then open localhost:8000 in a browser.

@sarpere/heatmapjs-react storybook Storybook

yarn storybook

Then open localhost:6006 in a browser.

Installation

npm

    npm i @sarpere/heatmapjs-react

yarn

    yarn add @sarpere/heatmapjs-react

Usage

import { Heatmap } from "@sarpere/heatmapjs-react";
const App = () => {
    const data = [{ x: 10, y: 15, value: 5}, { x: 50, y: 50, value: 2}, ...];
    return (
        <Heatmap max={5} data={data} />
    )
}

Props

PropTypeDefaultRequiredDescription
maxint5YesMaximum value for intensity
dataarray[]YesHeatmap array of dots
unitstringdecimalNoCan be either percent or decimal. If percent, a x value like 26 is considered 26% of the container from the top left
configHeatmapConfig
{
   radius: 40,
   renderer: "canvas2d",
   gradient: {
       0.25: "rgb(0,0,255)",
   ​​​​​​​    0.55: "rgb(0,255,0)",​​​​​​​
   ​​​​​​​    0.85: "yellow",​​​​​​​
   ​​​​​​​    1.0: "rgb(255,0,0)",​​​​​​​
   },​​​​​​​
   maxOpacity: 1,​​​​​​​
   minOpacity: 0,​​​​​​​
   blur: 0.85,​​​​​​​
   xField: "x",​​​​​​​
   yField: "y",​​​​​​​
   valueField: "value",​​​​​​​
   plugins: {},
}
NoA Heatmap can be customized with the HeatmapConfig. More info on Heatmap.js configObject

Keywords

Heatmapjs

FAQs

Package last updated on 28 Feb 2023

Did you know?

Socket

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.

Install

Related posts