React-PlotlyJS-Typescript
A react-typescript component for Plotly.JS graphs.
Self-redraw when props changed.
Usage
$ npm i -S react react-dom typescript$ npm i -D @types/plotly.js$ npm i -S plotly.js react-plotlyjs-ts
;; ;
Documentation
Define PlotlyChart props below:
config?: any; data: any; layout?: any; onClick?:void; onBeforeHover?:void; onHover?:void; onUnHover?:void; onSelected?:void;
- data, layout, config are the same as in the plotly.js.
- onClick, onBeforeHover, onHover, onUnHover, onSelected are on event functions. Use ES6 destructuring to get the points and event.
Todo
Add testing
Thanks
Inspired by React-PlotlyJS, many thanks!