Socket
Book a DemoInstallSign in
Socket

canvasdraw-webcomponent

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

canvasdraw-webcomponent

Barebones esbuild and test node server implementation. For building

latest
npmnpm
Version
1.0.6
Version published
Maintainers
1
Created
Source

Canvas drawing interface pure JS web component

npm i canvasdraw-webcomponent

Add it to the page:

<canvas-with-controls width="500" height="500"></canvas-with-controls>
<script src="CanvasWithControls.js"></script>

If pulling from node_modules, import 'canvasdraw-webcomponent' in your main script, then link that source. The HTML tag will be added automatically

Extends HTMLElement natively.

This is mostly a primitive for building on top of. E.g. the css controls are limited.

  • The unbundled script by default this works by fetching the html and css files associated on first run.
  • The bundled script has the html and css pre-fetched (e.g. with npm install).

Pan with middle mouse click or alt+left click, zoom with scroll wheel or the slider.

Test

Serve the index.html from this folder to test the component out.

png

GPT 3.5 wrote it, I mostly just prompted.

Keywords

esbuild

FAQs

Package last updated on 19 Oct 2023

Did you know?

Socket

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.

Install

Related posts