Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@erospingani1/ng-opendraw

Package Overview
Dependencies
Maintainers
0
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@erospingani1/ng-opendraw

Opendraw is an angular component that manipulates the canvas for drawing content across all devices

  • 3.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
9
decreased by-92.8%
Maintainers
0
Weekly downloads
 
Created
Source

Opendraw

Opendraw is an angular component that manipulates the canvas for drawing content across all devices. It supports touch/pen/mouse devices. It uses pointerEvent to detect the device.

This version was updated to be compatible with Angular 16+.

Demo

Try it out here: DEMO (original repo) or clone this repo and run ng serve for a full demo of opendraw.

Versions

  • 1.0.1: Angular 16.2.16

  • 2.0.0: Angular 17.3.12

  • 3.0.0: Angular 18.2.11

Features

  • Draw with different devices (mouse|pen|touch)
  • Export your drawings
  • Handle foreground and background layer (image|color)
  • Configure drawing style (color|width|shapes|eraser)
  • Configure allowed devices (mouse|pen|touch|all)

How to use

First install the package with the command npm i ng-opendraw

Then, in your module.ts, import the library module

import { NgOpendrawModule } from 'ng-opendraw';

And add it to your imports modules. You can now use <ng-opendraw></ng-opendraw> it in any component.html

<ng-opendraw 
    [canHeight]='this.height'
    [canWidth]='this.width'
    [lineWidth]='this.lineWidth'
    [lineColor]='this.getColor()'
    [commandObs]='this.commandObs$'
    [drawStyle]='this.drawStyle'
    [fillShape]='this.fillShape'
    [eraser]='this.eraser'
    [allowedDeviceType]='this.allowedDeviceType'
    [backgroundImage]='this.bgImg'
    [backgroundColor]='this.bgColor'
    (outputEvent)='this.processResult($event)'
    (errorEvent)='this.processError($event)'
></ng-opendraw>

Check out the repo for a full demo code here

Inputs

PropertyTypeNote
[canHeight]numberHeight of the canvas area in px
[canWidth]numberWidth of the canvas area in px
[lineWidth]numberLine width in px, default: 3
[lineColor]stringLine color, default: black
[commandObs]Observable(DrawCommand)Triggers a drawcommand like export, clear, ...
[drawStyle]DrawStyleSpecify the drawing style like normal, circle, rectangle, line... default: normal
[fillShape]booleanEnable/disable shape filling
[eraser]booleanEnable/disable eraser
[allowedDeviceType]DeviceTypeSpecify the allowed device type like mouse, touch, pen... default: all
[backgroundImage]Image/HTMLImageElementSpecify the background layer image
[backgroundColor]stringSpecify the background layer color

Outputs

EventTypeNote
(outputEvent)stringEmits the exported drawing image
(errorEvent)anyEmits all errors

NPM

This package is on npm https://www.npmjs.com/package/@erospingani1/ng-opendraw

License

This package is under the MIT license

Keywords

FAQs

Package last updated on 11 Nov 2024

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc