Socket
Socket
Sign inDemoInstall

canvas-node

Package Overview
Dependencies
2
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    canvas-node

Use oject to represent canvas drawings


Version published
Weekly downloads
261
decreased by-40.27%
Maintainers
1
Install size
181 kB
Created
Weekly downloads
 

Readme

Source

Intro

Try to use object to represent canvas drawing.

Still under development

Usage

A basic one would be:

import CanvasNode from 'canvas-node'

const canvas = document.getElementById('canvas')
CanvasNode.init({canvas})
const vertexes = [0, 0, 50, 50]
const path = new Path2D()
path.rect(...vertexes)
const box = CanvasNode.drawBox({
    rawVertexes: vertexes,
    name: 'box',
    text: 'box',
    path,
    style: '#58a',
    strokeStyle: '#fff',
    pos: {x: 50, y: 50}
})

setTimeout(() => {
  box.moveTo({x: 100, y: 100})
}, 1000)

API

API documents can be found here

License

MIT

Copyright (c) 2017-present, Yuchen Liu

FAQs

Last updated on 27 Dec 2017

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc