react-manhattan-plot
v1.1.1
Published
A manahttan plot built with Reactjs and D3js
Downloads
5
Keywords
Readme
react-manhattan-plot
A Manhattan plot built with Reactjs and D3js
Install
npm install --save react-manhattan-plot
Usage
import React, { Component } from 'react';
import ManhattanPlot from 'react-manhattan-plot';
class Example extends Component {
render() {
return <ManhattanPlot plotData={plotData} type="human" />;
}
}
Component's props
| Prop | Type | Required | Sample or Required values |
| -------- | -------- | ---------------------------------- | ------------------------- |
| plotData | Array | Y | Refer to /example/src/mock.js
and /example/src/mockHumanChromosomes.js
for more details. |
| type | String | N | 'human' or undefined |
| onZoom | Function | N (only works with type='human'
) | (start, end) => { /*_ do something _/ } |
| theme | Object | N | Refer to src/theme.js
for more details. |
Development
Local development is broken into two parts (ideally using two tabs). First, run rollup to watch your src/ module and automatically recompile it into dist/ whenever you make changes.
npm run start # runs rollup with watch flag
The second part will be running the example/ create-react-app that's linked to the local version of your module.
# (in another tab)
cd example
npm run start # runs create-react-app dev server