Skip to content

yetzt/node-dont

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

dont

make svg donuts with js.

methods

dont.segment(cx, cy, ri, ro, ds, de[, offset])

draws a donut segment, returns an svg path;

  • cx - center x
  • cy - center y
  • ri - inner radius from center (the hole)
  • ro - outer radius from center (the edge)
  • ds - segment starts at degrees
  • de - segment ends at degrees
  • offset - degrees offset; shift the start of the donut circle

dont.rad(degrees[, offset])

converts degrees to radians, with an offset of degrees

dont.area(ri, ro, ra)

calculates and returns the radius from center for a segment area to be in proportion to the area of the whole segment. if you want a comparable areas instead of comparable radii. the area of the hole is taken into account.

(send a pull request if you get what i mean and can explain it more eloquent).

  • ri - inner radius from center (the hole)
  • ro - outer radius from center (the edge)
  • ra - ratio of area in relation to total segment area

dont.draw(data [, options])

to be implemented

Releases

No releases published

Packages

No packages published