# bumbu/svg-pan-zoom

JavaScript library that enables panning and zooming of an SVG in an HTML document, with mouse events or custom JavaScript hooks

Repository: https://github.com/bumbu/svg-pan-zoom
Canonical: https://ross.abutalabs.com/products/svg-pan-zoom
Homepage: https://github.com/ariutta/svg-pan-zoom#demos
Language: JavaScript
License: BSD-2-Clause
License Family: permissive
Last push: 2026-01-16T15:19:50+00:00

## Health v2 (maintenance only)
Score: 51/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 62, release rhythm 8, longevity 100
- inputs: {"age_days": 4671, "days_push": 229, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1971, forks 393 (observed 2026-08-28T04:06:00.920250+00:00)

## What it is
A JavaScript library that adds panning and zooming to SVG images embedded in HTML documents, via mouse scroll, double-click, touch gestures, or programmatic API calls. It supports inline SVGs as well as SVGs loaded through object or embed elements, with optional on-screen zoom controls and onPan/onZoom event hooks.

## Use cases
- add pan and zoom to an inline SVG diagram in a web page
- make an SVG map pannable and zoomable with mouse wheel and touch
- control SVG zoom programmatically from JavaScript
- add on-screen zoom controls to an embedded SVG
- listen for pan and zoom events on an SVG viewer
- enable pinch-to-zoom on SVGs for mobile users

## When to choose
- you need simple, dependency-free pan/zoom for SVG content in the browser
- you want both mouse and touch support with a small JavaScript API
- you need cross-browser support for inline and embedded SVGs

## When to avoid
- you need pan/zoom for raster images or canvas rather than SVG
- you need advanced features like rotation, deep-zoom tiling, or WebGL rendering
- you are building a full-featured map application where a mapping library fits better

## Facets
- artifact type: library
- maturity: maintenance
- function: ui-components, animation
- domain: web-development, frontend, graphics
- platform: browser, cross-platform
- tags: svg, pan, zoom, javascript, touch-events

## Member repositories
- bumbu/svg-pan-zoom (main) score 51

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:06:00.920250+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T03:05:04.766836+00:00, confidence not recorded.
  - readme: https://github.com/bumbu/svg-pan-zoom (fetched 2026-08-28T04:06:00.920250+00:00, sha 3e19997b4d45)
  - homepage: https://github.com/ariutta/svg-pan-zoom#demos (fetched 2026-08-29T10:44:48.721776+00:00, sha 762a0743f5b8)
  - registry_npm: https://registry.npmjs.org/svg-pan-zoom (fetched 2026-08-29T10:44:48.731151+00:00, sha 649d7360287c)
- Data as of 2026-08-30T08:39:29.467469+00:00.
