# polybrushv4

> a modified version of the polybrush plugin for d3, originaly created by Geoffrey T. Bell, to make it compatible with d3-v4

Latest version **1.0.0** (published 2019-07-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install polybrushv4
pnpm add polybrushv4
yarn add polybrushv4
bun add polybrushv4
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2019-07-26 |
| First published | 2019-07-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 18.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Maintainers | machine_2019 |

## Links

- npm: https://www.npmjs.com/package/polybrushv4
- Repository: https://github.com/junwang23/polybrushv4
- Homepage: https://github.com/junwang23/polybrushv4#readme
- Issues: https://github.com/junwang23/polybrushv4/issues
- npm.io page: https://npm.io/package/polybrushv4

## Recent versions

- 1.0.0 (latest) — 2019-07-26

## README

# d3 Polybrush v4

This is a modified version of the polybrush plugin, originaly created by Geoffrey T. Bell, for [d3.js](https://d3js.org/) to make it compatible with d3-4.x-api. 

The d3-3.x based plugin is forked from: [https://gist.github.com/gtb104/3667340](https://gist.github.com/gtb104/3667340)

The changes include adapting to d3-4.x-api and a few minor fixes. 

Now the plugin can be instantiated like d3.brush() in [d3-4.x-api](https://github.com/d3/d3-brush).
```javascript
var brush = d3.polybrush()
  .x({x_scale})
  .y({y_scale});

d3.select("svg")
  .append("g")
  .call(brush);
```
Please keep in mind that the ```extent``` in the polybrush is very different from that in d3-brush. So, the working area of the brush can only be assigned by the ```range``` of the ```{x_scale}``` and ```{y_scale}```.

Three events are dispatched, which are ```start```, ```brush```, and ```end```, consistent with the events of d3-brush. The event names are a bit different in the d3-3.x based version.

The rest is the same as using the d3-3.x version of the plugin.
```
Usage:
Click to add an anchor point, double click to close the selection.
Drag the selection to reposition it.
Double click outside the selection to clear it.
```

Try it on [bl.ocks.org](http://bl.ocks.org/junwang23/bfcf242c09f0aaa0d6a27cdc84285a8e)

---
_Source: https://npm.io/package/polybrushv4 · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
