Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-native-heatmap-chart

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-heatmap-chart

React-Native Heatmap Chart

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

react-native-heatmap-chart

npm version npm version

Getting started

$ npm install react-native-heatmap-chart --save

Example

cd example
npm install
react-native run-android

Click Here

Basic Usage

import React from 'react';
import { View, ScrollView } from 'react-native';
import HeatMap from 'react-native-heatmap-chart';

const App = () => {
  const click = item => {
    console.log(`Value: ${item.value}`);
    console.log(`Index: ${item.index}`);
  };

  return (
    <ScrollView>
      <HeatMap values={[0, 4, 6, 1, 7, 3, 0, 8, 6, 2, 0, 10, 20, 12, 0, 0, 10, 0, 17, 8, 0, 6, 0, 6, 10, 23]} onBlockPress={click} />
    </ScrollView>
  );
};

export default App;

Properties

PropDefaultTypeDescription
numberOfLines7numberNumber of Horizontal Lines.
values[]arrayYour number values.
maximumValue"relative"stringThe maximum value of the heatmap. You can select a number (float or integer) or the string "relative" (default). The relative maximum value will use your own values array to find the maximum value.
colors['#ebedf0', '#9be9a8', '#30a14e', '#216e39']arrayColors of HeatMap.
colorsPercentage[0, 0.000001, 41, 60, 80]arrayExample: When your value is 60% of maximum, the color will be the index 3 of colors array, 40% will be 2 index, etc. The length of array need to be the same of colors array.
blocksSize30numberSize of heatmap blocks (width and height).
indexStart0numberStart of values index.
onBlockPress() => {}funcOn block press. Return an object with properties { value, index }
blocksStyles{}objectStyle of blocks.

Contribution

@Windows87 - Main author

Keywords

FAQs

Package last updated on 30 Sep 2020

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc