@rongmz/react-stock-heatmap
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

@rongmz/react-stock-heatmap

This is a react chart library for genarating "Stock Heatmap" with given market depth data. Stock Heatmap graph useful for day traders.

NPM JavaScript Style Guide

Live Demo Here

Screenshot

Screenshot

Install

npm install --save @rongmz/react-stock-heatmap

Usage

import React from 'react'
import StockHeatmap from '@rongmz/react-stock-heatmap';

class Example extends React.Component {

  heatmapRef = React.createRef();

  loadDataFromFile = () => {
    // Somehow load market depth datapoints
    ...
    ...
    // set the data to StockHeatmap to render graph
    if(heatmapRef.current !== null) {
      heatmapRef.current.setData(data);
    }
  }

  onLiveDataReceived = (data) => {
    // Add more data to existing data. This is useful for live graphing.
    if(heatmapRef.current !== null) {
      heatmapRef.current.addData(data);
    }
  }

  render() {
    return <StockHeatmap ref={heatmapRef} width={800} height={600} />
  }

}

License

MIT © Rounak Saha

Package Sidebar

Install

npm i @rongmz/react-stock-heatmap

Weekly Downloads

3

Version

1.0.2

License

MIT

Unpacked Size

160 kB

Total Files

9

Last publish

Collaborators

  • rounaksaha