
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
react-simple-heatmap
Advanced tools
A simple React component to create responsive heatmap. The heatmap take the height and width of it's parent element.
npm install react-simple-heatmap
or
yarn add react-simple-heatmap
Name | Type | description | example | default | isRequired |
---|---|---|---|---|---|
data | 2D Array of numbers | 2D Matrix of numbres | [[10,12,33], [2,45,31], [16, 32, 29]] | undefined | true |
bgColor | String | Main color using RGB format | "rgb(255, 17, 17)" | "rgb(24, 144, 255)" | false |
showData | Bollean | Display data inside each cells. | true | false | false |
showLegend | Bollean | Display the heatmap legend. | true | false | false |
onClick | Function | Adding an handler to cell click | (data) => console.log(data) | undefined | false |
bordered | Bollean | Display a border on the heatmap. | false | true | false |
import React, { Component } from "react"
import Heatmap from "react-simple-heatmap"
export default class App extends Component {
render() {
return (
<div
style={{ height: "500px", width: "500px" }}>
<Heatmap
data={ data } // 2D array of numbers
/>
</div>
);
}
}
import React, { Component } from 'react'
import Heatmap from 'react-simple-heatmap'
import './App.css';
// Creating a 10 x 10 array of random numbers
const size = 10;
const data = [];
for(let i = 0; i < size; i++){
const temp = [];
for(let i = 0; i < size; i++){
temp.push(Math.round(Math.random() * 100) / 100);
}
data.push(temp);
}
export default class App extends Component {
render() {
return (
<div style={{ marginTop: "4rem" }}>
<div style={{ height: "500px", width: "500px" }}>
<Heatmap
showData={ true }
showLegend={ true }
bgColor={ "rgb(255, 17, 17)" }
data={ data }
onClick={ (data) => console.log(data) }
/>
</div>
</div>
);
}
}
MIT © JulienRioux
FAQs
A simple React component to create responsive heatmap.
The npm package react-simple-heatmap receives a total of 20 weekly downloads. As such, react-simple-heatmap popularity was classified as not popular.
We found that react-simple-heatmap demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.