2.0.0 • Published 2 years ago

react-best-heatmap v2.0.0

Weekly downloads
-
License
-
Repository
github
Last release
2 years ago

React Best Heatmap 🚀

Simple and easy to get started.

import React from 'react';
import HeatMap from 'react-best-heatmap';

const values = [
  {
    date: new Date(),
    value: 1,
    valueLabel: 'Custom content...'
  }
];

const App = () => (
  <HeatMap values={values} />
);

export default App;

Props

NameTypeDefault ValueRequired?Description
startDateDateToday's dateYesInitial date
valuesarray[]YesCustom values
showWeekDaysarray[1,3,5]YesShowing days of week (0 - 6)
showBlockTooltipbooltrueNoShow block tooltip
showLegendTooltipbooltrueNoShow legend tooltip
showMonthsbooltrueNoShow months
localestringenNoSelect the language (en/pt-br/es/fr)
rangeDaysnumber365NoLimit of days from start date
boxShapestringsquareNoSelect box shape (square/circle)
legendarray[...array]YesLegend array, check the proptypes to see the structure
contentBeforeLegendstring/ElementundefinedNoContent before legend
contentAfterLegendstring/ElementundefinedNoContent before legend

Check proptypes

{
  startDate: PropTypes.instanceOf(Date).isRequired,
  values: PropTypes.array,
  showWeekDays: PropTypes.array,
  showBlockTooltip: PropTypes.bool,
  showLegendTooltip: PropTypes.bool,
  showMonths: PropTypes.bool,
  locale: PropTypes.string,
  rangeDays: PropTypes.number,
  boxShape: PropTypes.string,
  legend: PropTypes.arrayOf(PropTypes.shape({
    isInRange: PropTypes.func.isRequired, // Example: (value) => value > 3
    color: PropTypes.string.isRequired,
    label: PropTypes.string.isRequired,
  })),
  contentBeforeLegend: PropTypes.string,
  contentAfterLegend: PropTypes.string,
}

Donate

If you liked, you can donate to support it :)

paypal