react-use-brush
v1.1.4
Published
<h1 align="center">Welcome to react-use-brush 🖌</h1> <p> <a href="https://github.com/DavidSanwald/react-use-brush/workflows/build/badge.svg" target="_blank"> <img alt="Build Status" src="https://github.com/DavidSanwald/react-use-brush/workflows/bui
Downloads
10
Readme
brush hook with a nice api to brush and filter your chart data
Install
npm i -S react-use-brush
Usage
You can try a live demo here: https://codesandbox.io/s/nervous-rosalind-kfxeq
const Chart = () => {
const [state, rect, rectRef, bind, selection] = useBrush();
// ...
return (
<>
<svg {...bind} width={width} height={height}>
<rect
{...rect}
ref={rectRef}
fill="none"
stroke="black"
pointerEvents="all"
/>
</svg>
</>
);
};
Run tests
npm i
npm build
npm test
Author
👤 DavidSanwald
- Website: https://www.davidsanwald.net/
- Twitter: @DavidSanwald
- Github: @DavidSanwald
Show your 💚
Give a ⭐️ if this project helped you!
📝 License
Copyright © 2019 DavidSanwald. This project is MIT licensed.