
Research
/Security News
Malicious npm Packages Target WhatsApp Developers with Remote Kill Switch
Two npm packages masquerading as WhatsApp developer libraries include a kill switch that deletes all files if the phone number isn’t whitelisted.
heatmap-calendar-react
Advanced tools
A calendar with heatmap visualization. Based on GitHub's commit graph.
A calendar with heatmap visualization. Based on GitHub's commit graph.
[]
Install:
npm install heatmap-calendar-react
Import:
import HeatmapCalendar from 'heatmap-calendar-react';
import 'heatmap-calendar-react/build/style.css';
Display empty calendar:
<HeatmapCalendar/>
Display basic calendar:
<HeatmapCalendar
data={[
{ date: '2018-01-01' },
{ date: '2018-01-02' },
{ date: '2018-01-03' }
]}
/>
Display calendar with heatmap density:
<HeatmapCalendar
data={[
{ date: '2018-01-01', total: 10 },
{ date: '2018-01-02', total: 12 },
{ date: '2018-01-03', total: 14 }
]}
/>
Display calendar with heatmap density and tooltips:
<HeatmapCalendar
data={[
{ date: '2018-01-01', total: 10, name: "Total" },
{ date: '2018-01-02', total: 12, name: "Total" },
{ date: '2018-01-03', total: 14, name: "Total" }
]}
/>
<HeatmapCalendar
receiveDates={(dates) => console.log(dates)}
//Optional --- When this is used you will receive the dates that the user selects, they will be able to select multiple dates.
data={[
{ date: '2018-01-01', total: 10, name: "Total" },
{ date: '2018-01-02', total: 12, name: "Total" },
{ date: '2018-01-03', total: 14, name: "Total" }
]}
//Optional --- An array of objects that need a date field but can have a total (which is used to show density for the date) as well as a name field which is used for the tooltip.
weekdayLabels={["","M","","W","","F",""]}
//Optional --- You can pass custom weekday labels, this may need to be adjusted with css.
showDate={boolean}
//Optional --- Display the date inside the calendar day.
highAccuracy={boolean}
//Optional --- When activated, the days opacity is used to represent density as well as colour.
showBorder={boolean}
//Optional --- Apply a border around months.
addGap={boolean}
//Optional --- Apply a gap between months.
showTooltip={boolean}
//Optional --- Displays a tooltip when a day is hovered. Uses the name field in the data object.
keyNavigation={boolean}
//Optional --- Allows user to navigate their selection using the arrows keys and close their selection using the escape key.
setYear={number}
//Optional --- The default year will be the current year, however this can be changed by entering a numeric value e.g. 2010.
onClick={(e, day) => console.log(e, day)}
//Optional --- Instead on using receiveDates, you can use onClick. This will only allow the user to make one selection at a time.
/>
Property | Usage | Default | Required |
---|---|---|---|
receiveDates | Receive the dates that the user selects, they will be able to select multiple dates. | none | no |
data | Array of objects. e.g. [{ date: '2018-01-03', total: 14, name: "Total" }] | none | no |
weekdayLabels | Array of strings | ["","M","","W","","F",""] | no |
showDate | Boolean - Display the date inside each calendar day | false | no |
highAccuracy | Boolean - Increases accuracy of heatmap colours | false | no |
showBorder | Boolean - Applies a border around months | false | no |
addGap | Boolean - Applies a gap between months | false | no |
showTooltip | Boolean - Displays a tooltip over days when hovered | false | no |
keyNavigation | Boolean - Navigate selection with arrow keys | false | no |
setYear | Display a different year | Current year | no |
onClick | Returns date clicked | none | no |
.colorScale0{background-color: #ddd;}
.colorScale1{background-color: rgb(002, 184, 184);}
.colorScale2{background-color: rgb(002, 146, 146);}
.colorScale3{background-color: rgb(001, 107, 107);}
.colorScale4{background-color: rgb(001, 068, 068);}
FAQs
A calendar with heatmap visualization. Based on GitHub's commit graph.
The npm package heatmap-calendar-react receives a total of 3 weekly downloads. As such, heatmap-calendar-react popularity was classified as not popular.
We found that heatmap-calendar-react 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.
Research
/Security News
Two npm packages masquerading as WhatsApp developer libraries include a kill switch that deletes all files if the phone number isn’t whitelisted.
Research
/Security News
Socket uncovered 11 malicious Go packages using obfuscated loaders to fetch and execute second-stage payloads via C2 domains.
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.