# ng2-zoomable

> Angular2 Image Zoom View

Latest version **0.1.1** (published 2017-05-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install ng2-zoomable
pnpm add ng2-zoomable
yarn add ng2-zoomable
bun add ng2-zoomable
```

## Health

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

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2017-05-18 |
| First published | 2017-04-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 10 |
| Known vulnerabilities | 0 (+21 in 3 direct dependencies) |
| Install scripts | no |
| Author | Moe Hosseini |
| Maintainers | moeishaa |
| Keywords | angular2, ng2, image, zoom |

## Links

- npm: https://www.npmjs.com/package/ng2-zoomable
- npm.io page: https://npm.io/package/ng2-zoomable

## Dependencies (10)

- [rxjs](https://npm.io/package/rxjs.md) ^5.2.0
- [core-js](https://npm.io/package/core-js.md) ^2.4.1
- [zone.js](https://npm.io/package/zone.js.md) ^0.7.8
- [@types/node](https://npm.io/package/@types/node.md) ^7.0.8
- [@angular/core](https://npm.io/package/@angular/core.md) ~2.1.2
- [@angular/common](https://npm.io/package/@angular/common.md) ~2.1.2
- [reflect-metadata](https://npm.io/package/reflect-metadata.md) ^0.1.10
- [@angular/compiler](https://npm.io/package/@angular/compiler.md) ~2.1.2
- [@angular/platform-browser](https://npm.io/package/@angular/platform-browser.md) ~2.1.2
- [@angular/platform-browser-dynamic](https://npm.io/package/@angular/platform-browser-dynamic.md) ~2.1.2

## Alternatives

- [exif-parser](https://npm.io/package/exif-parser.md) — 3.8M weekly downloads
- [vite-plugin-compression](https://npm.io/package/vite-plugin-compression.md) — 569.5K weekly downloads
- [pica](https://npm.io/package/pica.md) — 442.4K weekly downloads
- [@reportportal/client-javascript](https://npm.io/package/@reportportal/client-javascript.md) — 408.8K weekly downloads
- [@tldraw/state](https://npm.io/package/@tldraw/state.md) — 316.0K weekly downloads

## Recent versions

- 0.1.1 (latest) — 2017-05-18
- 0.1.0 — 2017-04-16

## README

# ng2-zoomable
A minimal Angular 2 image zoom directive.

## Installation
To install this library, run:

```bash
$ npm install ng2-zoomable --save
```

## Demo
To run a local demo, first clone/download this repo and then inside local directory:

```bash
$ npm install
$ npm start
```
This will install all dependencies, and launch a local lite server to run the demo on.

## Examples
First, import the ZoomableDirective directive:

```typescript
import { ZoomableDirective } from 'ng2-zoomable';
```

Then, add ZoomableDirective to your modules declarations array:

```typescript
@NgModule({
    declarations : [AppComponent, ZoomableDirective, ...],
})
```
Then just add the [zoomable] tag to your img element:

```html
<img [zoomable]='zoomOptions' [src]='imageSource'>
```

If you want to specify source of larger image to be used for zoomed view then add [zoomableSrc] tag to your img element:

```html
<img [zoomable]='zoomOptions' [zoomableSrc]='largeImageSource' [src]='imageSource'>
```

# Zoom Options
zoomOptions is an optional object in this format:

```javascript
peepView: {
  borderColor: '#fff',
  borderWidth: '2px',
  borderStyle: 'solid',
  cursor: 'zoom-in',
},
settings: {
  zoom: 4   // 4x zoom
}
```
You may choose to include/exclude any of these properties to style the boxes.

## License
MIT © [Moe Hosseini](hosseini.moe@gmail.com)

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