
Security News
Bun 1.2.19 Adds Isolated Installs for Better Monorepo Support
Bun 1.2.19 introduces isolated installs for smoother monorepo workflows, along with performance boosts, new tooling, and key compatibility fixes.
svelte-pan-zoom
Advanced tools
Canvas Pan and Zoom action for Svelte, 1Kb minified + gzipped
Install using you package manager of choice:
pnpm i svelte-pan-zoom
Import action into page, create options and pass to action.
Options include:
width
& height
in CSS pixels of item to render (will be centered and sized to fit canvas)render
function to render to canvas (you don't have to draw an image)padding
(optional, default 0)maxZoom
(optional, default 16)<script lang="ts">
import { panzoom, type Options } from '$lib'
const promise = new Promise<Options>(resolve => {
const image = new Image()
image.onload = () =>
resolve({
width: image.width,
height: image.height,
render,
})
image.src = './svelte-kit-machine.png'
function render(ctx: CanvasRenderingContext2D) {
ctx.drawImage(image, 0, 0)
}
})
</script>
{#await promise then options}
<canvas use:panzoom={options} />
{/await}
<style>
canvas {
box-sizing: border-box;
width: 100%;
height: 100%;
user-select: none;
touch-action: none;
background-color: #ccc;
overscroll-behavior: none;
-webkit-user-select: none; /* disable selection/Copy of UIWebView */
-webkit-touch-callout: none; /* disable the IOS popup when long-press on a link */
}
</style>
FAQs
 
The npm package svelte-pan-zoom receives a total of 101 weekly downloads. As such, svelte-pan-zoom popularity was classified as not popular.
We found that svelte-pan-zoom demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Bun 1.2.19 introduces isolated installs for smoother monorepo workflows, along with performance boosts, new tooling, and key compatibility fixes.
Security News
Popular npm packages like eslint-config-prettier were compromised after a phishing attack stole a maintainer’s token, spreading malicious updates.
Security News
/Research
A phishing attack targeted developers using a typosquatted npm domain (npnjs.com) to steal credentials via fake login pages - watch out for similar scams.