# interactive-slider

> Zoom compatible interactive slider, for dates and number. Easily display data availablity.

Latest version **1.1.0** (published 2022-07-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install interactive-slider
pnpm add interactive-slider
yarn add interactive-slider
bun add interactive-slider
```

## 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.1.0 |
| Published | 2022-07-05 |
| First published | 2021-10-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 993.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | James Runnalls |
| Maintainers | jamesrunnalls |
| Keywords | d3, slider, datetime, interactive, zoom |

## Links

- npm: https://www.npmjs.com/package/interactive-slider
- Repository: https://github.com/JamesRunnalls/interactive-slider
- Homepage: https://github.com/JamesRunnalls/interactive-slider#readme
- Issues: https://github.com/JamesRunnalls/interactive-slider/issues
- npm.io page: https://npm.io/package/interactive-slider

## Dependencies (2)

- [d3](https://npm.io/package/d3.md) ^6.7.0
- [interactive-slider](https://npm.io/package/interactive-slider.md) ^1.0.4

## Alternatives

- [@js-joda/timezone](https://npm.io/package/@js-joda/timezone.md) — 383.4K weekly downloads
- [chartjs-adapter-moment](https://npm.io/package/chartjs-adapter-moment.md) — 210.8K weekly downloads
- [strftime](https://npm.io/package/strftime.md) — 171.2K weekly downloads
- [vue-flatpickr-component](https://npm.io/package/vue-flatpickr-component.md) — 115.8K weekly downloads
- [timepicker](https://npm.io/package/timepicker.md) — 51.0K weekly downloads

## Recent versions

- 1.1.0 (latest) — 2022-07-05
- 1.0.9 — 2022-06-30
- 1.0.8 — 2022-06-30
- 1.0.7 — 2022-06-15
- 1.0.6 — 2022-06-01
- 1.0.5 — 2022-04-25
- 1.0.4 — 2022-04-25
- 1.0.3 — 2021-10-14
- 1.0.2 — 2021-10-14
- 1.0.1 — 2021-10-14
- 1.0.0 — 2021-10-14
- 0.0.1 — 2021-10-12

## README

# Interactive Slider

[![npm version](https://badge.fury.io/js/interactive-slider.svg)](https://badge.fury.io/js/interactive-slider)

Zoom compatible interactive slider, for dates and number. Easily display data availablity.

![Image of D3 Slider](https://runnalls.s3.eu-central-1.amazonaws.com/interactive-slider.gif)

Uses [d3](https://d3js.org/) for rendering the axis.

Check out the examples:

- [Basic](https://jamesrunnalls.github.io/interactive-slider/example/basic/) ([source](https://github.com/jamesrunnalls/interactive-slider/blob/master/example/basic/index.html))

## Quick start

```
import slider from 'interactive-slider';
```

then

```
slider(div, options={});
```

or

```
<script type="text/javascript" src="https://unpkg.com/interactive-slider"></script>
```

then

```
slider(div, options={});
```

## API reference

### div

The unique id of a div. The graph will be appended to this div and will automatically align to the div with.

### options

| Option              | Description                                     | Default     | Type         |
| ------------------- | ------------------------------------------------| ----------- | ------------ |
| onChange            | Called with new handle values when adjusted     | false       | Function     |
| onZoom              | Called with new min & max when zoomed           | false       | Function     |
| type                | Type of slider (single/ double)                 | single      | String       |
| min                 | Minimum slider value                            | 0           | Number/ Date |
| max                 | Maximum slider value                            | 1           | Number/ Date |
| upper               | Upper handle value (double slider)              | max         | Number/ Date |
| lower               | Lower handle value (double slider)              | min         | Number/ Date |
| value               | Handle value (single slider)                    | max         | Number/ Date |
| availability        | Array of [start, end] values for plotting       | []          | Array        |
| handleHeight        | Height of the handles                           | 20          | Number       |
| handleWidth         | Width of the handles                            | 2           | Number       |
| barColor            | Availability bar color                          | #28b5f5     | String       |
| barHeight           | Availability bar height                         | 4           | Number       |
| tooltip             | Show a tooltip on hover                         | true        | Boolean      |
| fontSize            | Font size for axis and tooltip                  | 10          | Number       |
| marginTop           | Top margin in px                                | 25          | Number       |
| marginLeft          | Left margin in px                               | 10          | Number       |
| marginBottom        | Bottom margin in px                             | 30          | Number       |
| marginRight         | Right margin in px                              | 10          | Number       |
| width               | Set custom slider width in px                   | parent      | Number       |
| language            | Select language for time axis. en, de, fr, es   | en          | String       |

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