pan-and-zoom
Advanced tools
Comparing version 1.0.0 to 2.0.0
{ | ||
"name": "pan-and-zoom", | ||
"version": "v1.0.0", | ||
"version": "v2.0.0", | ||
"license": "ISC", | ||
"repository": "https://github.com/Alhadis/PanAndZoom", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/piliugin-anton/PanAndZoom.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/piliugin-anton/PanAndZoom/issues" | ||
}, | ||
"publishConfig": { | ||
"access": "public", | ||
"branches": [ | ||
"master" | ||
] | ||
}, | ||
"homepage": "https://github.com/piliugin-anton/PanAndZoom", | ||
"description": "Low-level interface for calculating pan and zoom transformations.", | ||
"keywords": ["pan", "zoom", "affine", "transform", "matrix", "magnify", "math"], | ||
"keywords": [ | ||
"pan", | ||
"zoom", | ||
"affine", | ||
"transform", | ||
"matrix", | ||
"magnify", | ||
"math" | ||
], | ||
"author": "John Gardner <gardnerjohng@gmail.com>", | ||
"files": ["pan-and-zoom.*"], | ||
"main": "./pan-and-zoom", | ||
"maintainers": [ | ||
"Anton Piliugin <anton.piliugin@icloud.com>" | ||
], | ||
"files": [ | ||
"dist" | ||
], | ||
"main": "dist/cjs/index.js", | ||
"module": "dist/esm/index.js", | ||
"browser": "dist/umd/index.js", | ||
"types": "dist/types/index.d.ts", | ||
"exports": { | ||
".": { | ||
"import": "./dist/esm/index.js", | ||
"require": "./dist/cjs/index.js" | ||
} | ||
}, | ||
"scripts": { | ||
"prepare": "make" | ||
"lint": "eslint --ext .ts ./src/", | ||
"test": "mocha", | ||
"clean": "node tools/cleanup", | ||
"build": "npm run build:cjs && npm run build:esm && npm run build:umd && npm run build:types", | ||
"build:cjs": "node tools/cleanup cjs && tsc -p config/tsconfig.cjs.json", | ||
"build:esm": "node tools/cleanup esm && tsc -p config/tsconfig.esm.json", | ||
"build:umd": "node tools/cleanup umd && webpack --config config/webpack.config.js", | ||
"build:types": "node tools/cleanup types && tsc -p config/tsconfig.types.json", | ||
"package": "npm run build && npm pack" | ||
}, | ||
"devDependencies": { | ||
"@types/chai": "^4.3.3", | ||
"@types/mocha": "^9.1.1", | ||
"@typescript-eslint/eslint-plugin": "^5.36.1", | ||
"@typescript-eslint/parser": "^5.36.1", | ||
"chai": "^4.2.0", | ||
"eslint": "^8.23.0", | ||
"mocha": "^10.0.0", | ||
"ts-loader": "^9.3.1", | ||
"ts-node": "^10.9.1", | ||
"typescript": "^4.8.2", | ||
"webpack": "^5.74.0", | ||
"webpack-cli": "^4.10.0" | ||
} | ||
} |
@@ -26,5 +26,5 @@ Pan and Zoom | ||
~~~js | ||
import PanAndZoom from "pan-and-zoom"; | ||
import { PanAndZoom } from "pan-and-zoom"; | ||
let paz = new PanAndZoom({ | ||
const paz = new PanAndZoom({ | ||
@@ -35,2 +35,7 @@ // Callback fired after changing a `PanAndZoom' object's properties | ||
el.style.transform = paz; // Calls paz.toString() implicitly | ||
// Or for canvas: | ||
const canvas = document.getElementById("canvas"); | ||
const canvasRenderContext2D = canvas.getContext("2d"); | ||
canvasRenderContext2D.setTransform(...paz); | ||
}, | ||
@@ -43,3 +48,19 @@ }); | ||
Or in Node.js: | ||
~~~js | ||
const { PanAndZoom } = require("pan-and-zoom"); | ||
const paz = new PanAndZoom({ | ||
update(){ | ||
console.log(`CSS transform: ${paz}`); | ||
console.log('Canvas transformation matrix:', ...paz); | ||
}, | ||
}); | ||
paz.zoom = 1.5; // +150% scale | ||
paz.panX = 300; // Move horizontally 300 units | ||
~~~ | ||
Properties | ||
@@ -317,3 +338,2 @@ ---------- | ||
<a name="debounce"></a> | ||
@@ -320,0 +340,0 @@ ### `debounce(fn)` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
79932
7
1414
0
0
379
0
12
3