canvas-dashed-arc
an API to draw dashed arc in canvas of HTML5
When will you need this
You won't, unless your weirdo designer co-worker ask you to draw a dashed arc.
How it works
A method named dashedArc
is added onto CanvasRenderingContext2D.prototype
.
How to use
Installation
Browser
Npm
$ npm install canvas-dashed-arc --save
Demo
Check the demo.
; const canvas = document;documentbody;canvas;canvas; const ctx = canvas; ctx;ctx;ctx;
Syntax
void ctx;
x
The x coordinate of the arc's center.
y
The y coordinate of the arc's center.
radius
The arc's radius.
startAngle
The angle at which the arc starts, measured clockwise from the positive x axis and expressed in radians.
endAngle
The angle at which the arc ends, measured clockwise from the positive x axis and expressed in radians.
parts
The segment number (including blank parts) the arc will be devided into.
anticlockwise [Optional]
An optional Boolean which, if true, causes the arc to be drawn counter-clockwise between the two angles. By default it is drawn clockwise.