Skip to content
Back to skills

Brush Zoom

ASecurity

Interactive range selection and zoom/pan for charts. Brush allows selecting a data range; ZoomPan enables zooming and panning the view.

  • 4 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added May 27, 2026
data-ai

Security analysis

A100/100

Scanned May 27, 2026

npx -y skills add reaviz/skills --skill brush-zoom --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Brush Zoom?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Brush Zoom
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/reaviz-brush-zoom/badge)](https://www.skillsdirectory.com/skills/reaviz-brush-zoom)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
# Brush & ZoomPan

Interactive range selection and zoom/pan for charts. Brush allows selecting a data range; ZoomPan enables zooming and panning the view.

## Import

```tsx
import { ChartBrush, ChartZoomPan } from 'reaviz';
```

## ChartBrush Props

Most props are set internally by the parent chart. User-configurable:

| Prop | Type | Default | Description |
|------|------|---------|-------------|
| `disabled` | `boolean` | — | Disable brush |
| `fill` | `string` | — | Brush selection fill color |
| `domain` | `[ChartDataTypes, ChartDataTypes]` | — | Initial brush domain |
| `onBrushChange` | `(event: BrushChangeEvent) => void` | — | Callback when brush range changes |

### BrushChangeEvent

```ts
interface BrushChangeEvent {
  start?: number;
  end?: number;
}
```

## ChartZoomPan Props

Most props are set internally by the parent chart. User-configurable:

| Prop | Type | Default | Description |
|------|------|---------|-------------|
| `disabled` | `boolean` | — | Disable zoom/pan |
| `pannable` | `boolean` | `true` | Enable panning |
| `zoomable` | `boolean` | `true` | Enable zooming |
| `maxZoom` | `number` | `10` | Maximum zoom level |
| `zoomStep` | `number` | `0.1` | Zoom increment per scroll |
| `disableMouseWheel` | `boolean` | — | Disable scroll-to-zoom |
| `requireZoomModifier` | `boolean` | — | Require modifier key (Ctrl/Cmd) to zoom |
| `domain` | `[ChartDataTypes, ChartDataTypes]` | — | Controlled zoom domain |
| `onZoomPan` | `(event: ZoomPanChangeEvent) => void` | — | Callback on zoom/pan |

### ZoomPanChangeEvent

```ts
interface ZoomPanChangeEvent {
  domain: [ChartDataTypes, ChartDataTypes];
  isZoomed: boolean;
}
```

## Adding Brush to a Chart

```tsx
<AreaChart
  data={data}
  brush={<ChartBrush />}
/>
```

## Brush with Callback

```tsx
<AreaChart
  data={data}
  brush={
    <ChartBrush
      onBrushChange={(e) => console.log('Range:', e.start, e.end)}
    />
  }
/>
```

## Adding ZoomPan to a Chart

```tsx
<AreaChart
  data={data}
  zoomPan={<ChartZoomPan />}
/>
```

## ZoomPan with Controlled Domain

```tsx
const [domain, setDomain] = useState<[Date, Date]>();

<AreaChart
  data={data}
  zoomPan={
    <ChartZoomPan
      domain={domain}
      onZoomPan={(e) => setDomain(e.domain)}
    />
  }
/>
```

## Require Modifier Key for Zoom

```tsx
<ChartZoomPan requireZoomModifier />
```

## Disable Mouse Wheel Zoom

```tsx
<ChartZoomPan disableMouseWheel />
```

## Pan Only (No Zoom)

```tsx
<ChartZoomPan zoomable={false} pannable />
```

## Notes

- Pass `brush` or `zoomPan` as a chart prop — they are `null` by default
- Brush renders a draggable selection overlay at the bottom of the chart
- ZoomPan changes the chart's visible domain without modifying data
- Both components fire callbacks with the new data range for controlled usage
- Brush and ZoomPan are supported on AreaChart, LineChart, and ScatterPlot

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.