New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@beoe/pan-zoom

Package Overview
Dependencies
Maintainers
0
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@beoe/pan-zoom - npm Package Compare versions

Comparing version

to
0.0.4

10

dist/utilsMath.d.ts
import * as math from "mathjs";
export declare const identity: math.Matrix;
export declare const identity: math.Matrix<math.MathNumericType>;
export declare function ttm(m: math.Matrix): string;
export declare function transformXY(m: math.Matrix, x: number, y: number): readonly [any, any];
export declare function getScale(m: math.Matrix): any;
export declare function scale(m: math.Matrix, sf: number): math.Matrix;
export declare function scaleAt(m: math.Matrix, sf: number, x: number, y: number): math.Matrix;
export declare function translate(m: math.Matrix, dx: number, dy: number): math.Matrix;
export declare function fdm(m: DOMMatrix): math.Matrix;
export declare function scale(m: math.Matrix, sf: number): math.Matrix<math.MathNumericType>;
export declare function scaleAt(m: math.Matrix, sf: number, x: number, y: number): math.Matrix<math.MathNumericType>;
export declare function translate(m: math.Matrix, dx: number, dy: number): math.Matrix<math.MathNumericType>;
export declare function fdm(m: DOMMatrix): math.Matrix<math.MathNumericType>;
export declare function tdm(m: math.Matrix): DOMMatrix;
{
"name": "@beoe/pan-zoom",
"version": "0.0.3",
"version": "0.0.4",
"description": "Pan and zoom for SVG images",

@@ -39,5 +39,4 @@ "author": "stereobooster",

"devDependencies": {
"mathjs": "^12.4.0"
"mathjs": "^14.0.0"
},
"dependencies": {},
"scripts": {

@@ -44,0 +43,0 @@ "test": "vitest",

@@ -14,3 +14,3 @@ # @beoe/pan-zoom

| --------- | ----------------------- | ----------------- | --------------- |
| pan | clik + move | click + move | two finger drag |
| pan | click + move | click + move | two finger drag |
| zoom | <kbd>Ctrl</kbd> + wheel | pinch | pinch |

@@ -25,11 +25,10 @@ | reset | double click | double click | double tap |

- all actions are available through gestures, so it works without UI. You can add UI, though. Library exposes methods for this, like `pan(dx, dy)` and `zoom(scale)`
- <kbd>Cmd</kbd> + click - zoom in
- <kbd>Alt</kbd> + click - zoom out
- First double click (tap) - zoom in x2
## Demo
**TODO**: update demo - this is an old one
[pan-zoom demo](https://beoe.stereobooster.com/other/pan-zoom/)
[![Netlify Status](https://api.netlify.com/api/v1/badges/4bdb3997-ed5f-4506-bb77-95595d2e6562/deploy-status)](https://app.netlify.com/sites/svg-pan-zoom/deploys)
[pan-zoom demo](https://svg-pan-zoom.stereobooster.com/)
## Usage

@@ -50,3 +49,3 @@

document.querySelectorAll(".beoe").forEach((container) => {
const element = container.querySelector("svg, img[src$='.svg' i]");
const element = container.firstElementChild;
if (!element) return;

@@ -53,0 +52,0 @@ new PanZoom({ element, container }).on();

Sorry, the diff of this file is not supported yet