sig
type svg
val new_svg_document :
width:int -> height:int -> ?unit:string -> unit -> Svg.svg
val finish_svg : Svg.svg -> unit
val add_comment : Svg.svg -> s:string -> unit -> unit
val add_newline : Svg.svg -> unit
val get_svg_document : Svg.svg -> string
val write_svg_file : Svg.svg -> filename:string -> unit
val print_svg_document : Svg.svg -> unit
type class_name
type css_style
type id_name
val add_line :
Svg.svg ->
x1:int ->
y1:int ->
x2:int ->
y2:int ->
?stroke:string ->
?stroke_width:float ->
?stroke_opacity:float ->
?id:Svg.id_name ->
?css:Svg.class_name -> ?style:Svg.css_style -> unit -> unit
val add_polyline :
Svg.svg ->
points:(int * int) list ->
?stroke:string ->
?stroke_width:float ->
?stroke_opacity:float ->
?fill:string ->
?fill_opacity:float ->
?id:Svg.id_name ->
?css:Svg.class_name -> ?style:Svg.css_style -> unit -> unit
val add_polygon :
Svg.svg ->
points:(int * int) list ->
?stroke:string ->
?stroke_width:float ->
?stroke_opacity:float ->
?fill:string ->
?fill_opacity:float ->
?id:Svg.id_name ->
?css:Svg.class_name -> ?style:Svg.css_style -> unit -> unit
val add_rect :
Svg.svg ->
x:int ->
y:int ->
width:int ->
height:int ->
?rx:float ->
?ry:float ->
?fill:string ->
?fill_opacity:float ->
?stroke:string ->
?stroke_width:float ->
?stroke_opacity:float ->
?id:Svg.id_name ->
?css:Svg.class_name -> ?style:Svg.css_style -> unit -> unit
val add_circle :
Svg.svg ->
cx:float ->
cy:float ->
r:float ->
?fill:string ->
?fill_opacity:float ->
?stroke:string ->
?stroke_width:float ->
?stroke_opacity:float ->
?id:Svg.id_name ->
?css:Svg.class_name -> ?style:Svg.css_style -> unit -> unit
val add_ellipse :
Svg.svg ->
cx:float ->
cy:float ->
r:float * float ->
?fill:string ->
?fill_opacity:float ->
?stroke:string ->
?stroke_width:float ->
?stroke_opacity:float ->
?id:Svg.id_name ->
?css:Svg.class_name -> ?style:Svg.css_style -> unit -> unit
val add_triangle :
Svg.svg ->
p1:int * int ->
p2:int * int ->
p3:int * int ->
?fill:string ->
?fill_opacity:float ->
?stroke:string ->
?stroke_width:float ->
?stroke_opacity:float ->
?id:Svg.id_name ->
?css:Svg.class_name -> ?style:Svg.css_style -> unit -> unit
val add_text :
Svg.svg ->
x:int ->
y:int ->
text:string ->
?text_anchor:string ->
?dominant_baseline:string ->
?font_family:string ->
?font_size:string ->
?font_weight:string ->
?font_style:string ->
?fill:string ->
?fill_opacity:float ->
?stroke:string ->
?stroke_width:float ->
?stroke_opacity:float ->
?id:Svg.id_name ->
?css:Svg.class_name -> ?style:Svg.css_style -> unit -> unit
module Float :
sig
val add_line :
Svg.svg ->
x1:float ->
y1:float ->
x2:float ->
y2:float ->
?stroke:string ->
?stroke_width:float ->
?stroke_opacity:float ->
?id:Svg.id_name ->
?css:Svg.class_name -> ?style:Svg.css_style -> unit -> unit
val add_polyline :
Svg.svg ->
points:(float * float) list ->
?stroke:string ->
?stroke_width:float ->
?stroke_opacity:float ->
?fill:string ->
?fill_opacity:float ->
?id:Svg.id_name ->
?css:Svg.class_name -> ?style:Svg.css_style -> unit -> unit
val add_rect :
Svg.svg ->
x:float ->
y:float ->
width:float ->
height:float ->
?rx:float ->
?ry:float ->
?fill:string ->
?fill_opacity:float ->
?stroke:string ->
?stroke_width:float ->
?stroke_opacity:float ->
?id:Svg.id_name ->
?css:Svg.class_name -> ?style:Svg.css_style -> unit -> unit
end
val add_circle_sector :
Svg.svg ->
cx:float ->
cy:float ->
r:float ->
angle1:float ->
angle2:float ->
?fill:string ->
?fill_opacity:float ->
?stroke:string ->
?stroke_width:float ->
?stroke_opacity:float ->
?id:Svg.id_name ->
?css:Svg.class_name -> ?style:Svg.css_style -> unit -> unit
val add_donut_slice :
Svg.svg ->
cx:float ->
cy:float ->
r1:float ->
r2:float ->
angle1:float ->
angle2:float ->
?fill:string ->
?fill_opacity:float ->
?stroke:string ->
?stroke_width:float ->
?stroke_opacity:float ->
?id:Svg.id_name ->
?css:Svg.class_name -> ?style:Svg.css_style -> unit -> unit
val begin_group :
Svg.svg ->
?translate:float * float ->
?rotate:float * int * int -> ?scale:float * float -> unit -> unit
val end_group : Svg.svg -> unit
type path
val empty_path : Svg.path
val new_path : unit -> Svg.path
val move_to : Svg.path -> x:float -> y:float -> Svg.path
val line_to : Svg.path -> x:float -> y:float -> Svg.path
val h_line : Svg.path -> x:float -> Svg.path
val v_line : Svg.path -> y:float -> Svg.path
val quad_curve :
Svg.path -> x1:float -> y1:float -> x:float -> y:float -> Svg.path
val cubic_curve :
Svg.path ->
x1:float ->
y1:float -> x2:float -> y2:float -> x:float -> y:float -> Svg.path
val arc_to :
Svg.path ->
x:float ->
y:float ->
r:float * float ->
?rotation:float -> ?large_arc:bool -> ?clockwise:bool -> unit -> Svg.path
val close_path : Svg.path -> Svg.path
val add_path :
Svg.svg ->
path:Svg.path ->
?fill:string ->
?fill_opacity:float ->
?stroke:string ->
?stroke_width:float ->
?stroke_opacity:float ->
?id:Svg.id_name ->
?css:Svg.class_name -> ?style:Svg.css_style -> unit -> unit
type cmd =
M of float * float
| L of float * float
| H of float
| V of float
| Q of (float * float) * (float * float)
| C of (float * float) * (float * float) * (float * float)
| A of (float * float) * float * bool * bool * (float * float)
| Z
val to_path : Svg.cmd list -> Svg.path
module Relative :
sig
val move_to : Svg.path -> x:float -> y:float -> Svg.path
val line_to : Svg.path -> x:float -> y:float -> Svg.path
val h_line : Svg.path -> x:float -> Svg.path
val v_line : Svg.path -> y:float -> Svg.path
val quad_curve :
Svg.path -> x1:float -> y1:float -> x:float -> y:float -> Svg.path
val cubic_curve :
Svg.path ->
x1:float ->
y1:float -> x2:float -> y2:float -> x:float -> y:float -> Svg.path
val arc_to :
Svg.path ->
x:float ->
y:float ->
r:float * float ->
?rotation:float ->
?large_arc:bool -> ?clockwise:bool -> unit -> Svg.path
val close_path : Svg.path -> Svg.path
val to_path : Svg.cmd list -> Svg.path
end
val scale_path : float -> Svg.cmd list -> Svg.cmd list
val translate_path : float * float -> Svg.cmd list -> Svg.cmd list
val new_fragment : unit -> Svg.svg
val add_fragment : Svg.svg -> Svg.svg -> unit
type css_attr
val fill : Svg.css_attr
val fill_opacity : Svg.css_attr
val stroke : Svg.css_attr
val stroke_width : Svg.css_attr
val stroke_opacity : Svg.css_attr
val text_anchor : Svg.css_attr
val font_family : Svg.css_attr
val font_size : Svg.css_attr
val font_weight : Svg.css_attr
val font_style : Svg.css_attr
val letter_spacing : Svg.css_attr
val word_spacing : Svg.css_attr
val to_style : styles:(Svg.css_attr * string) list -> Svg.css_style
module Attrs :
sig
val stroke_dasharray : Svg.css_attr
val stroke_dashoffset : Svg.css_attr
val fill_rule_evenodd : Svg.css_attr * string
val fill_rule_nonzero : Svg.css_attr * string
val sans_serif : string
val serif : string
val monospace : string
val normal : string
val italic : string
val oblique : string
end
type style_sheet
val new_style_sheet : unit -> Svg.style_sheet
val style_sheet_add :
Svg.style_sheet ->
class_name:string ->
properties:(Svg.css_attr * string) list ->
Svg.class_name * Svg.style_sheet
val add_style_sheet : Svg.svg -> Svg.style_sheet -> unit
val style_sheet_add_id :
Svg.style_sheet ->
id_name:string ->
properties:(Svg.css_attr * string) list -> Svg.id_name * Svg.style_sheet
val mk_id : string -> Svg.id_name
end