package js_of_ocaml

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

DOM SVG binding

This is a partial binding to the DOM SVG API.

val xmlns : Js.js_string Js.t

Types

type error_code =
  1. | WRONG_TYPE_ERR
  2. | INVALID_VALUE_ERR
  3. | MATRIX_NOT_INVERTABLE
class type svg_error = object ... end
exception SVGError of svg_error
type lengthUnitType =
  1. | LENGTHTYPE_UNKNOWN
  2. | LENGTHTYPE_NUMBER
  3. | LENGTHTYPE_PERCENTAGE
  4. | LENGTHTYPE_EMS
  5. | LENGTHTYPE_EXS
  6. | LENGTHTYPE_PX
  7. | LENGTHTYPE_CM
  8. | LENGTHTYPE_MM
  9. | LENGTHTYPE_IN
  10. | LENGTHTYPE_PT
  11. | LENGTHTYPE_PC
type angleUnitType =
  1. | ANGLETYPE_UNKNOWN
  2. | ANGLETYPE_UNSPECIFIED
  3. | ANGLETYPE_DEG
  4. | ANGLETYPE_RAD
  5. | ANGLETYPE_GRAD
type colorType =
  1. | COLORTYPE_UNKNOWN
  2. | COLORTYPE_RGBCOLOR
  3. | COLORTYPE_RGBCOLOR_ICCCOLOR
  4. | COLORTYPE_CURRENTCOLOR
type alignmentType =
  1. | PRESERVEASPECTRATIO_UNKNOWN
  2. | PRESERVEASPECTRATIO_NONE
  3. | PRESERVEASPECTRATIO_XMINYMIN
  4. | PRESERVEASPECTRATIO_XMIDYMIN
  5. | PRESERVEASPECTRATIO_XMAXYMIN
  6. | PRESERVEASPECTRATIO_XMINYMID
  7. | PRESERVEASPECTRATIO_XMIDYMID
  8. | PRESERVEASPECTRATIO_XMAXYMID
  9. | PRESERVEASPECTRATIO_XMINYMAX
  10. | PRESERVEASPECTRATIO_XMIDYMAX
  11. | PRESERVEASPECTRATIO_XMAXYMAX
type meetOrSliceType =
  1. | MEETORSLICE_UNKNOWN
  2. | MEETORSLICE_MEET
  3. | MEETORSLICE_SLICE
type transformType =
  1. | TRANSFORM_UNKNOWN
  2. | TRANSFORM_MATRIX
  3. | TRANSFORM_TRANSLATE
  4. | TRANSFORM_SCALE
  5. | TRANSFORM_ROTATE
  6. | TRANSFORM_SKEWX
  7. | TRANSFORM_SKEWY
type zoomAndPanType =
  1. | ZOOMANDPAN_UNKNOWN
  2. | ZOOMANDPAN_DISABLE
  3. | ZOOMANDPAN_MAGNIFY
type lengthAdjust =
  1. | LENGTHADJUST_UNKNOWN
  2. | LENGTHADJUST_SPACING
  3. | LENGTHADJUST_SPACINGANDGLYPHS
type unitType =
  1. | UNIT_TYPE_UNKNOWN
  2. | UNIT_TYPE_USERSPACEONUSE
  3. | UNIT_TYPE_OBJECTBOUNDINGBOX
type intentType =
  1. | RENDERING_INTENT_UNKNOWN
  2. | RENDERING_INTENT_AUTO
  3. | RENDERING_INTENT_PERCEPTUAL
  4. | RENDERING_INTENT_RELATIVE_COLORIMETRIC
  5. | RENDERING_INTENT_SATURATION
  6. | RENDERING_INTENT_ABSOLUTE_COLORIMETRIC
type pathSegmentType =
  1. | PATHSEG_UNKNOWN
  2. | PATHSEG_CLOSEPATH
  3. | PATHSEG_MOVETO_ABS
  4. | PATHSEG_MOVETO_REL
  5. | PATHSEG_LINETO_ABS
  6. | PATHSEG_LINETO_REL
  7. | PATHSEG_CURVETO_CUBIC_ABS
  8. | PATHSEG_CURVETO_CUBIC_REL
  9. | PATHSEG_CURVETO_QUADRATIC_ABS
  10. | PATHSEG_CURVETO_QUADRATIC_REL
  11. | PATHSEG_ARC_ABS
  12. | PATHSEG_ARC_REL
  13. | PATHSEG_LINETO_HORIZONTAL_ABS
  14. | PATHSEG_LINETO_HORIZONTAL_REL
  15. | PATHSEG_LINETO_VERTICAL_ABS
  16. | PATHSEG_LINETO_VERTICAL_REL
  17. | PATHSEG_CURVETO_CUBIC_SMOOTH_ABS
  18. | PATHSEG_CURVETO_CUBIC_SMOOTH_REL
  19. | PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS
  20. | PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL
type textPathMethodType =
  1. | TEXTPATH_METHODTYPE_UNKNOWN
  2. | TEXTPATH_METHODTYPE_ALIGN
  3. | TEXTPATH_METHODTYPE_STRETCH
type textPathSpacingType =
  1. | TEXTPATH_SPACINGTYPE_UNKNOWN
  2. | TEXTPATH_SPACINGTYPE_AUTO
  3. | TEXTPATH_SPACINGTYPE_EXACT
type spreadMethodType =
  1. | SPREADMETHOD_UNKNOWN
  2. | SPREADMETHOD_PAD
  3. | SPREADMETHOD_REFLECT
  4. | SPREADMETHOD_REPEAT
type suspendHandleID
class type 'a animated = object ... end
class type 'a list = object ... end

Elements

class type element = object ... end
class type animatedBoolean = bool Js.t animated
class type animatedEnumeration = int animated
class type animatedInteger = int animated
class type animatedNumber = float animated
class type length = object ... end
class type lengthList = length Js.t list
class type angle = object ... end
class type rgbColor = object ... end
class type color = object ... end
class type iccColor = object ... end
class type rect = object ... end
class type stylable = object ... end
class type locatable = object ... end
class type transformable = object ... end
class type tests = object ... end
class type langSpace = object ... end
class type externalResourcesRequired = object ... end
class type fitToViewBox = object ... end
class type zoomAndPan = object ... end
class type viewSpec = object ... end
class type uriReference = object ... end
class type document = object ... end
class type svgElement = object ... end
class type gElement = object ... end
class type defsElement = object ... end
class type descElement = object ... end
class type titleElement = object ... end
class type symbolElement = object ... end
class type useElement = object ... end
class type elementInstance = object ... end
class type elementInstanceList = object ... end
class type imageElement = object ... end
class type switchElement = object ... end
class type styleElement = object ... end
class type point = object ... end
class type pointList = point Js.t list
class type matrix = object ... end
class type transform = object ... end
class type transformList = object ... end
class type preserveAspectRatio = object ... end
class type pathSeg = object ... end
class type pathSegMoveto = object ... end
class type pathSegLineto = object ... end
class type pathSegCurvetoCubic = object ... end
class type pathSegCurvetoQuadratic = object ... end
class type pathSegArc = object ... end
class type pathSegLinetoHorizontal = object ... end
class type pathSegLinetoVertical = object ... end
class type pathSegCurvetoCubicSmooth = object ... end
class type pathSegCurvetoQuadraticSmooth = object ... end
class type animatedPathData = object ... end
class type pathElement = object ... end
class type rectElement = object ... end
class type circleElement = object ... end
class type ellipseElement = object ... end
class type lineElement = object ... end
class type animatedPoints = object ... end
class type polyLineElement = object ... end
class type polygonElement = object ... end
class type textContentElement = object ... end
class type textPositioningElement = object ... end
class type textElement = object ... end
class type trefElement = object ... end
class type textPathElement = object ... end
class type altGlyphElement = object ... end
class type glyphRefElement = object ... end
class type gradientElement = object ... end
class type linearGradientElement = object ... end
class type radialGradientElement = object ... end
class type stopElement = object ... end
class type patternElement = object ... end
class type clipPathElement = object ... end
class type maskElement = object ... end
class type filterElement = object ... end
class type cursorElement = object ... end
class type aElement = object ... end
class type viewElement = object ... end
class type scriptElement = object ... end
class type animationElement = object ... end
class type animateElement = object ... end
class type mPathElement = object ... end
class type animateColorElement = object ... end
class type fontElement = object ... end
class type glyphElement = object ... end
class type foreignObjectElement = object ... end

Helper functions for creating Svg elements

val createElement : document Js.t -> string -> element Js.t
val createA : document Js.t -> aElement Js.t
val createAltGlyph : document Js.t -> altGlyphElement Js.t
val createAltGlyphDef : document Js.t -> altGlyphDefElement Js.t
val createAltGlyphItem : document Js.t -> altGlyphItemElement Js.t
val createAnimate : document Js.t -> animateElement Js.t
val createAnimateColor : document Js.t -> animateColorElement Js.t
val createAnimateMotion : document Js.t -> animateMotionElement Js.t
val createAnimateTransform : document Js.t -> animateTransformElement Js.t
val createCircle : document Js.t -> circleElement Js.t
val createClipPath : document Js.t -> clipPathElement Js.t
val createCursor : document Js.t -> cursorElement Js.t
val createDefs : document Js.t -> defsElement Js.t
val createDesc : document Js.t -> descElement Js.t
val createEllipse : document Js.t -> ellipseElement Js.t
val createFilter : document Js.t -> filterElement Js.t
val createFont : document Js.t -> fontElement Js.t
val createFontFace : document Js.t -> fontElement Js.t
val createFontFaceFormat : document Js.t -> fontElement Js.t
val createFontFaceName : document Js.t -> fontElement Js.t
val createFontFaceSrc : document Js.t -> fontElement Js.t
val createFontFaceUri : document Js.t -> fontElement Js.t
val createForeignObject : document Js.t -> foreignObjectElement Js.t
val createG : document Js.t -> gElement Js.t
val createGlyph : document Js.t -> glyphElement Js.t
val createGlyphRef : document Js.t -> glyphElement Js.t
val createhkern : document Js.t -> element Js.t
val createImage : document Js.t -> imageElement Js.t
val createLineElement : document Js.t -> lineElement Js.t
val createLinearElement : document Js.t -> linearGradientElement Js.t
val createMask : document Js.t -> maskElement Js.t
val createMetaData : document Js.t -> metadataElement Js.t
val createMissingGlyph : document Js.t -> glyphElement Js.t
val createMPath : document Js.t -> mPathElement Js.t
val createPath : document Js.t -> pathElement Js.t
val createPattern : document Js.t -> patternElement Js.t
val createPolygon : document Js.t -> polygonElement Js.t
val createPolyline : document Js.t -> polyLineElement Js.t
val createRadialgradient : document Js.t -> radialGradientElement Js.t
val createRect : document Js.t -> rectElement Js.t
val createScript : document Js.t -> scriptElement Js.t
val createSet : document Js.t -> setElement Js.t
val createStop : document Js.t -> stopElement Js.t
val createStyle : document Js.t -> styleElement Js.t
val createSvg : document Js.t -> svgElement Js.t
val createSwitch : document Js.t -> switchElement Js.t
val createSymbol : document Js.t -> symbolElement Js.t
val createTextElement : document Js.t -> textElement Js.t
val createTextpath : document Js.t -> textPathElement Js.t
val createTitle : document Js.t -> titleElement Js.t
val createTref : document Js.t -> trefElement Js.t
val createTspan : document Js.t -> tspanElement Js.t
val createUse : document Js.t -> useElement Js.t
val createView : document Js.t -> viewElement Js.t
val createvkern : document Js.t -> element Js.t
val svg_element : element Js.t Js.constr
val document : document Js.t

The current document

val getElementById : string -> element Js.t

getElementById id returns the element with the id id in the current document. It raises Not_found if there are no such element

module CoerceTo : sig ... end
OCaml

Innovation. Community. Security.