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

@daeinc/draw

Package Overview
Dependencies
Maintainers
0
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@daeinc/draw

drawing utilities for HTML5 Canvas

  • 0.6.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

@daeinc/draw

drawing utilities for HTML5 Canvas.

Install

npm i @daeinc/draw

then,

import { ... } from "@daeinc/draw"

CDN

import { ... } from "https://cdn.jsdelivr.net/npm/@daeinc/draw/dist/draw.esm.js"

Functions

It uses two custom types, Pt and Pts, each representing number[] and Pt[].

import type { Pt, Pts } from "@daeinc/geom";

drawCircle

const drawCircle: (ctx: CanvasRenderingContext2D, pt: Pt, diam: number) => void;

drawFillText

const drawFillText: (
  ctx: CanvasRenderingContext2D,
  msg: string,
  pt: Pt,
) => void;

drawLine

const drawLine: (ctx: CanvasRenderingContext2D, pt1: Pt, pt2: Pt) => void;

drawPath

const drawPath: (
  ctx: CanvasRenderingContext2D,
  path: Pts,
  close?: boolean,
) => void;

drawSmoothPath

const drawSmoothPath: (ctx: CanvasRenderingContext2D, path: Pts) => void;

Uses quadratic curves to smoothen hard edges of path. The input path is expected to be generated with generateSmoothPath() from another package @daeinc/geom.

License

MIT

FAQs

Package last updated on 18 Aug 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