1.1.4 ā¢ Published 4 years ago
react-use-brush v1.1.4
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.