module Cnv:sig..end
type doc
val new_document : width:int -> height:int -> unit -> doccreates a new .html document, with a canvas of size (width, height)
val finish : doc -> unitcloses the html document
val add_comment : doc -> s:string -> unit -> unitadds a javascript comment in the script part of the html-document
val add_newline : doc -> unitadds a newline in the script part of the html document
val get_document : doc -> stringreturn the result .html document as a string
val write_file : doc -> filename:string -> unitwrite the result .html document to a file
val print_document : doc -> unitprints the result .html document to stdout
val add_rect : doc ->
x:int ->
y:int ->
width:int ->
height:int ->
?fill:string -> ?stroke:string -> ?stroke_width:float -> unit -> unit
val add_circle : doc ->
c:float * float ->
r:float ->
?fill:string -> ?stroke:string -> ?stroke_width:float -> unit -> unit
val add_triangle : doc ->
p1:int * int ->
p2:int * int ->
p3:int * int ->
?fill:string -> ?stroke:string -> ?stroke_width:float -> unit -> unit
val add_line : doc ->
p1:int * int ->
p2:int * int -> ?stroke:string -> ?stroke_width:float -> unit -> unit
val add_polyline : doc ->
points:(int * int) list ->
?fill:string -> ?stroke:string -> ?stroke_width:float -> unit -> unit
val add_polygon : doc ->
points:(int * int) list ->
?fill:string -> ?stroke:string -> ?stroke_width:float -> unit -> unit
val add_ellipse : doc ->
c:float * float ->
rs:float * float ->
?angle:float ->
?fill:string -> ?stroke:string -> ?stroke_width:float -> unit -> unit
val add_text : doc ->
x:int ->
y:int ->
text:string ->
font:string ->
?fill:string -> ?stroke:string -> ?stroke_width:float -> unit -> unit
val add_path : doc ->
d:string ->
?fill:string -> ?stroke:string -> ?stroke_width:float -> unit -> unittype path
val add_path2 : doc ->
f:(path -> path) ->
?fill:string -> ?stroke:string -> ?stroke_width:float -> unit -> unit
val move_to : path -> x:float -> y:float -> path
val line_to : path -> x:float -> y:float -> path
val arc_to : path ->
x1:float -> y1:float -> x2:float -> y2:float -> radius:float -> path
val quad_curve : path -> x1:float -> y1:float -> x:float -> y:float -> path
val cubic_curve : path ->
x1:float ->
y1:float -> x2:float -> y2:float -> x:float -> y:float -> path
val close_path : path -> pathval add_svg_document : doc -> frag:string -> x:int -> y:int -> unit -> unitval begin_group : doc ->
?translate:float * float ->
?rotate:float -> ?scale:float * float -> unit -> unit
val end_group : doc -> unit
val to_radian : float -> floatconverts angles from degrees to radians
type def
defines additional elements, that can be used in conjunction with other shapes elements
val linear_gradient : p1:int * int ->
p2:int * int ->
stops:(float * string) list ->
?translate:int * int -> unit -> def * stringa stop should be a tuple with a float between 0.0 and 1.0, and a color
returns a def that should be added to the document with add_def,
and a string that should be provided to the fill parameter of shape functions
val radial_gradient : c1:int * int ->
c2:int * int ->
rs:int * int ->
stops:(float * string) list ->
?translate:int * int -> unit -> def * string
val conic_gradient : c:int * int ->
start_angle:float ->
stops:(float * string) list ->
?translate:int * int -> unit -> def * string
val add_def : doc -> def -> unitadd a definition to the html document
val add_defs : doc -> def list -> unitadd some definitions to the html document