Module type Svg_sigs.​T

module type T = sig..end

Signature of typesafe constructors for SVG documents.


type +'a elt

SVG elements.

Element constructors are in section . Most elements constructors are either nullary, unary or star, depending on the number of children they accept. Children are usually given as a list of elements. pcdata is used for text.

The type variable 'a is used to track the element's type. This allows the OCaml typechecker to check SVG validity.

Note that the concrete implementation of this type can vary. See Svg_sigs.​T.​Xml for details.

type doc = [ `Svg ] elt

A complete SVG document.

type +'a attrib

SVG attributes

Attribute constructors are in section and their name starts with a_. Attributes are given to elements with the ~a optional argument.

Similarly to elt, attributes use the OCaml type system to enforce Html validity.

In some cases, attributes have to be disambiguated. The max attribute has two version, Svg_sigs.​T.​a_fill and Svg_sigs.​T.​a_animation_fill, depending on the element. Such disambiguated attribute will contain the name of the associated element.

module Xml : Xml_sigs.T

Underlying XML data-structure

type 'a wrap = 'a Xml.W.t

wrap is a container for elements and values.

In most cases, 'a wrap = 'a. For R modules (in eliom or js_of_ocaml), It will be React.S.t.

type 'a list_wrap = 'a Xml.W.tlist

list_wrap is a containre for list of elements.

In most cases, 'a list_wrap = 'a list. For R modules (in eliom or js_of_ocaml), It will be ReactiveData.RList.t.

type ('a, 'b) nullary = ?a:'a attrib list -> unit -> 'b elt

A nullary element is an element that doesn't have any children.

type ('a, 'b, 'c) unary = 
  ?a:'a attrib list ->
  'b elt wrap -> 'c elt

A unary element is an element that have exactly one children.

type ('a, 'b, 'c) star = 
  ?a:'a attrib list ->
  'b elt list_wrap -> 'c elt

A star element is an element that has any number of children, including zero.

module Info : Xml_sigs.Info

Various information about SVG, such as the doctype, ...

Uri

type uri = Xml.uri
val string_of_uri : (uri, string) Xml.W.ft
val uri_of_string : (string, uri) Xml.W.ft

Attributes

val a_version : string wrap -> [> `Version ] attrib

Deprecated.Removed in SVG2

val a_baseProfile : string wrap -> [> `BaseProfile ] attrib

Deprecated.Removed in SVG2

val a_x : Svg_types.coord wrap -> [> `X ] attrib
val a_y : Svg_types.coord wrap -> [> `Y ] attrib
val a_width : Svg_types.Unit.length wrap -> [> `Width ] attrib
val a_height : 
  Svg_types.Unit.length wrap ->
  [> `Height ] attrib
val a_preserveAspectRatio : string wrap -> [> `PreserveAspectRatio ] attrib
val a_contentScriptType : string wrap -> [> `ContentScriptType ] attrib

Deprecated.Removed in SVG2

val a_contentStyleType : string wrap -> [> `ContentStyleType ] attrib

Deprecated.Removed in SVG2

val a_zoomAndPan : 
  [< `Disable | `Magnify ] wrap ->
  [> `ZoomAndSpan ] attrib
val a_href : Svg_types.iri wrap -> [> `Xlink_href ] attrib

Deprecated.Use a_href

val a_requiredFeatures : 
  Svg_types.spacestrings wrap ->
  [> `RequiredFeatures ] attrib

Deprecated.Removed in SVG2

val a_requiredExtensions : 
  Svg_types.spacestrings wrap ->
  [> `RequiredExtension ] attrib
val a_systemLanguage : 
  Svg_types.commastrings wrap ->
  [> `SystemLanguage ] attrib
val a_externalRessourcesRequired : 
  bool wrap ->
  [> `ExternalRessourcesRequired ] attrib
val a_id : string wrap -> [> `Id ] attrib
val a_xml_base : Svg_types.iri wrap -> [> `Xml_Base ] attrib

Deprecated.Removed in SVG2

val a_xml_lang : Svg_types.iri wrap -> [> `Xml_Lang ] attrib
val a_xml_space : 
  [< `Default | `Preserve ] wrap ->
  [> `Xml_Space ] attrib

Deprecated.Use CSS white-space

val a_type : string wrap -> [> `Type ] attrib
val a_media : 
  Svg_types.commastrings wrap ->
  [> `Media ] attrib

Deprecated.Use a child title element

val a_class : 
  Svg_types.spacestrings wrap ->
  [> `Class ] attrib
val a_style : string wrap -> [> `Style ] attrib
val a_transform : 
  Svg_types.transforms wrap ->
  [> `Transform ] attrib
val a_viewBox : 
  Svg_types.fourfloats wrap ->
  [> `ViewBox ] attrib
val a_d : string wrap -> [> `D ] attrib
val a_pathLength : float wrap -> [> `PathLength ] attrib
val a_rx : Svg_types.Unit.length wrap -> [> `Rx ] attrib
val a_ry : Svg_types.Unit.length wrap -> [> `Ry ] attrib
val a_cx : Svg_types.Unit.length wrap -> [> `Cx ] attrib
val a_cy