|
|
há 1 ano atrás | |
|---|---|---|
| example | há 1 ano atrás | |
| src | há 1 ano atrás | |
| types | há 1 ano atrás | |
| .editorconfig | há 5 anos atrás | |
| .eslintignore | há 5 anos atrás | |
| .eslintrc | há 5 anos atrás | |
| .gitignore | há 1 ano atrás | |
| .npmignore | há 5 anos atrás | |
| .prettierrc | há 5 anos atrás | |
| .travis.yml | há 5 anos atrás | |
| README.md | há 1 ano atrás | |
| package-lock.json | há 1 ano atrás | |
| package.json | há 1 ano atrás | |
| run.bat | há 5 anos atrás | |
| screenshot.png | há 5 anos atrás |
This is a react chart library for genarating "Stock Heatmap" with given market depth data. Stock Heatmap graph useful for day traders.
npm install --save @rongmz/react-stock-heatmap
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} />
}
}
MIT © Rounak Saha