1.1.1 • Published 4 years ago

react-manhattan-plot v1.1.1

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

react-manhattan-plot

A Manhattan plot built with Reactjs and D3js

NPM JavaScript Style Guide

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

PropTypeRequiredSample or Required values
plotDataArrayYRefer to /example/src/mock.js and /example/src/mockHumanChromosomes.js for more details.
typeStringN'human' or undefined
onZoomFunctionN (only works with type='human')(start, end) => { /* do something / }
themeObjectNRefer 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