Svg_types
SVG types with variants, goes with Svg_sigs.T
.
This module defines basic data types for data, attributes and element occurring in SVG documents. It is based on the specification available at http://www.w3.org/TR/SVG/.
This module is experimental, it may lack of some attributes, and the interface is very low level and do not take deeply into account the needs of SVG elements.
This part defines the categories of elements and attributes
type presentation_attr = [
| `Alignment_Baseline
| `Baseline_Shift
| `Clip
| `Clip_Path
| `Clip_Rule
| `Color
| `Color_Interpolation
| `Color_interpolation_filters
| `Color_profile
| `Color_rendering
| `Cursor
| `Direction
| `Display
| `Dominant_Baseline
| `Enable_background
| `Fill
| `Fill_opacity
| `Fill_rule
| `Filter
| `Flood_Color
| `Flood_Opacity
| `Font_Family
| `Font_Size
| `Font_Size_Adjust
| `Font_Stretch
| `Font_Style
| `Font_Variant
| `Font_Weight
| `Glyph_Orientation_Horizontal
| `Glyph_Orientation_Vertical
| `Image_Rendering
| `Kerning
| `Letter_Spacing
| `Lighting_Color
| `Marker_End
| `Marker_Mid
| `Marker_Start
| `Mask
| `Opacity
| `Overflow
| `Pointer_Events
| `Shape_Rendering
| `Stop_Color
| `Stop_Opacity
| `Stroke
| `Stroke_Dasharray
| `Stroke_Dashoffset
| `Stroke_Linecap
| `Stroke_Linejoin
| `Stroke_Miterlimit
| `Stroke_Opacity
| `Stroke_Width
| `Text_Anchor
| `Text_Decoration
| `Text_Rendering
| `Unicode_Bidi
| `Visibility
| `Word_Spacing
| `Writing_Mode
]
An IRI reference is an Internationalized Resource Identifier with an optional fragment identifier, as defined in Internationalized Resource Identifiers RFC3987
. An IRI reference serves as a reference to a resource or (with a fragment identifier) to a secondary resource. See References and the βdefsβ element..
module Unit : sig ... end
SVG defines several units to measure time, length, angles.
type coord = Unit.length
type transform = [
| `Matrix of float * float * float * float * float * float
| `Translate of float * float option
| `Scale of float * float option
| `Rotate of Unit.angle * (float * float) option
| `SkewX of Unit.angle
| `SkewY of Unit.angle
]
type transforms = transform list
type lengths = Unit.length list
type svg_content = [
| animation_element
| descriptive_element
| shape_element
| structural_element
| gradient_element
| `A
| `AltGlyphDef
| `ClipPath
| `Color_Profile
| `Cursor
| `Filter
| `Font
| `Font_Face
| `ForeignObject
| `Image
| `Marker
| `Mask
| `Pattern
| `Script
| `Style
| `Switch
| `Text
| `View
]
type svg_attr = [
| conditional_processing_attr
| core_attr
| document_event_attr
| graphical_event_attr
| presentation_attr
| `Class
| `Style
| `ExternalResourcesRequired
| `X
| `Y
| `Width
| `Height
| `ViewBox
| `PreserveAspectRatio
| `ZoomAndPlan
| `Version
| `BaseProfile
| `ContentScriptType
| `ContentStyleType
| `X
| `Y
]
type g_content = [
| animation_element
| descriptive_element
| shape_element
| structural_element
| gradient_element
| `A
| `AltGlyphDef
| `ClipPath
| `Color_Profile
| `Cursor
| `Filter
| `Font
| `Font_Face
| `ForeignObject
| `Image
| `Marker
| `Mask
| `Pattern
| `Script
| `Style
| `Switch
| `Text
| `View
]
type g_attr = [
| conditional_processing_attr
| core_attr
| graphical_event_attr
| presentation_attr
| `Class
| `Style
| `ExternalResourcesRequired
| `Transform
]
type defs_content = [
| animation_element
| descriptive_element
| shape_element
| structural_element
| gradient_element
| `A
| `AltGlyphDef
| `ClipPath
| `Color_Profile
| `Cursor
| `Filter
| `Font
| `Font_Face
| `ForeignObject
| `Image
| `Marker
| `Mask
| `Pattern
| `Script
| `Style
| `Switch
| `Text
| `View
]
type defs_attr = [
| conditional_processing_attr
| core_attr
| graphical_event_attr
| presentation_attr
| `Class
| `Style
| `ExternalResourcesRequired
| `Transform
]
type title_attr = desc_attr
type symbol_content = [
| animation_element
| descriptive_element
| structural_element
| gradient_element
| `A
| `AltGlyphDef
| `ClipPath
| `Color_Profile
| `Cursor
| `Filter
| `Font
| `Font_Face
| `ForeignObject
| `Image
| `Marker
| `Mask
| `Pattern
| `Script
| `Style
| `Switch
| `Text
| `View
]
type use_attr = [
| core_attr
| conditional_processing_attr
| graphical_event_attr
| presentation_attr
| xlink_attr
| `Class
| `Style
| `ExternalResourcesRequired
| `Transform
| `X
| `Y
| `Width
| `Height
| `Xlink_href
]
type image_attr = [
| core_attr
| conditional_processing_attr
| graphical_event_attr
| xlink_attr
| presentation_attr
| `Class
| `Style
| `ExternalResourcesRequired
| `PreserveAspectRatio
| `Transform
| `X
| `Y
| `Width
| `Height
| `Xlink_href
]
type switch_content = [
| animation_element
| descriptive_element
| shape_element
| `A
| `ForeignObject
| `G
| `Image
| `Svg
| `Switch
| `Text
| `Use
]
type switch_attr = [
| conditional_processing_attr
| core_attr
| graphical_event_attr
| presentation_attr
| `Class
| `Style
| `ExternalResourcesRequired
| `Transform
]
type path_attr = [
| conditional_processing_attr
| core_attr
| graphical_event_attr
| presentation_attr
| `Class
| `Style
| `ExternalResourcesRequired
| `Transform
| `D
| `PathLength
]
type rect_attr = [
| conditional_processing_attr
| core_attr
| graphical_event_attr
| presentation_attr
| `Class
| `Style
| `ExternalResourcesRequired
| `Transform
| `X
| `Y
| `Width
| `Height
| `Rx
| `Ry
]
type circle_attr = [
| conditional_processing_attr
| core_attr
| graphical_event_attr
| presentation_attr
| `Class
| `Style
| `ExternalResourcesRequired
| `Transform
| `R
| `Cx
| `Cy
]
type ellipse_attr = [
| conditional_processing_attr
| core_attr
| graphical_event_attr
| presentation_attr
| `Class
| `Style
| `ExternalResourcesRequired
| `Transform
| `Rx
| `Ry
| `Cx
| `Cy
]
type line_attr = [
| conditional_processing_attr
| core_attr
| graphical_event_attr
| presentation_attr
| `Class
| `Style
| `ExternalResourcesRequired
| `Transform
| `X1
| `Y1
| `X2
| `Y2
]
type polyline_attr = [
| conditional_processing_attr
| core_attr
| graphical_event_attr
| presentation_attr
| `Class
| `Style
| `ExternalResourcesRequired
| `Transform
| `Points
]
type polygon_attr = [
| conditional_processing_attr
| core_attr
| graphical_event_attr
| presentation_attr
| `Class
| `Style
| `ExternalResourcesRequired
| `Transform
| `Points
]
type text_content = [
| animation_element
| descriptive_element
| text_content_child_element
| `PCDATA
| `A
]
type text_attr = [
| conditional_processing_attr
| core_attr
| graphical_event_attr
| presentation_attr
| `Class
| `Transform
| `LengthAdjust
| `X_list
| `Y_list
| `Dx_list
| `Dy_list
| `Rotate
| `TextLength
]
type tspan_content = [
| descriptive_element
| core_attr
| `PCDATA
| `A
| `AltGlyph
| `Animate
| `AnimateColor
| `Set
| `Tref
| `Tspan
]
type tspan_attr = [
| core_attr
| conditional_processing_attr
| graphical_event_attr
| presentation_attr
| `Class
| `Style
| `ExternalResourcesRequired
| `X_list
| `Y_list
| `Dx_list
| `Dy_list
| `Rotate
| `TextLength
| `LengthAdjust
]
type tref_attr = [
| conditional_processing_attr
| core_attr
| graphical_event_attr
| presentation_attr
| xlink_attr
| `Class
| `Style
| `ExternalResourcesRequired
| `Xlink_href
]
type textpath_content = [
| descriptive_element
| `PCDATA
| `A
| `AltGlyph
| `Animate
| `AnimateColor
| `Set
| `Tref
| `Tspan
]
type textpath_attr = [
| conditional_processing_attr
| core_attr
| graphical_event_attr
| presentation_attr
| xlink_attr
| `Class
| `Style
| `ExternalResourcesRequired
| `Xlink_href
| `StartOffset
| `Method
| `Spacing
]
type altglyph_attr = [
| conditional_processing_attr
| core_attr
| graphical_event_attr
| presentation_attr
| xlink_attr
| `Class
| `Style
| `ExternalResourcesRequired
| `X_list
| `Y_list
| `Dx_list
| `Dy_list
| `GlyphRef
| `Format
| `Rotate
| `Xlink_href
]
type glyphref_attr = [
| core_attr
| presentation_attr
| xlink_attr
| `Class
| `Style
| `X
| `Y
| `Dx
| `Dy
| `GlyphRef
| `Format
| `Xlink_href
]
type marker_content = [
| animation_element
| descriptive_element
| shape_element
| structural_element
| gradient_element
| `A
| `AltGlyphDef
| `ClipPath
| `Color_Profile
| `Cursor
| `Filter
| `Font
| `Font_Face
| `ForeignObject
| `Image
| `Marker
| `Mask
| `Pattern
| `Script
| `Style
| `Switch
| `Text
| `View
]
type marker_attr = [
| core_attr
| presentation_attr
| `Class
| `Style
| `ExternalResourcesRequired
| `ViewBox
| `PreserveAspectRatio
| `RefX
| `RefY
| `MarkerUnits
| `MarkerWidth
| `MarkerHeight
| `Orient
]
type lineargradient_attr = [
| core_attr
| presentation_attr
| xlink_attr
| `Class
| `Style
| `ExternalResourcesRequired
| `X1
| `Y1
| `X2
| `Y2
| `GradientUnits
| `GradientTransform
| `SpreadMethod
| `Xlink_href
]
type radialgradient_attr = [
| core_attr
| presentation_attr
| xlink_attr
| `Class
| `Style
| `ExternalResourcesRequired
| `Cx
| `Cy
| `R
| `Fx
| `Fy
| `GradientUnits
| `GradientTransform
| `SpreadMethod
| `Xlink_href
]
type pattern_content = [
| animation_element
| descriptive_element
| shape_element
| structural_element
| gradient_element
| `A
| `AltGlyphDef
| `ClipPath
| `Color_Profile
| `Cursor
| `Filter
| `Font
| `Font_Face
| `ForeignObject
| `Image
| `Marker
| `Mask
| `Pattern
| `Script
| `Style
| `Switch
| `Text
| `View
]
type pattern_attr = [
| conditional_processing_attr
| core_attr
| presentation_attr
| xlink_attr
| `Class
| `Style
| `ExternalResourcesRequired
| `ViewBox
| `PreserveAspectRatio
| `X
| `Y
| `Width
| `Height
| `PatternUnits
| `PatternContentUnits
| `PatternTransform
| `Xlink_href
]
type clippath_attr = [
| conditional_processing_attr
| core_attr
| presentation_attr
| `Class
| `Style
| `ExternalResourcesRequired
| `Transform
| `ClipPathUnits
]
type mask_content = [
| animation_element
| descriptive_element
| shape_element
| structural_element
| gradient_element
| `A
| `AltGlyphDef
| `ClipPath
| `Color_Profile
| `Cursor
| `Filter
| `Font
| `Font_Face
| `ForeignObject
| `Image
| `Marker
| `Mask
| `Pattern
| `Script
| `Style
| `Switch
| `Text
| `View
]
type mask_attr = [
| conditional_processing_attr
| core_attr
| presentation_attr
| `Class
| `Style
| `ExternalResourcesRequired
| `X
| `Y
| `Width
| `Height
| `MaskUnits
| `MaskContentUnits
]
type filter_attr = [
| core_attr
| presentation_attr
| xlink_attr
| `Class
| `Style
| `ExternalResourcesRequired
| `X
| `Y
| `Width
| `Height
| `FilterRes
| `FilterUnits
| `PrimitiveUnits
| `Xlink_href
]
type fespotlight_attr = [
| core_attr
| `X
| `Y
| `Z
| `PointsAtX
| `PointsAtY
| `PointsAtZ
| `SpecularExponent
| `LimitingConeAngle
]
type feblend_attr = [
| core_attr
| presentation_attr
| filter_primitive_attr
| `Class
| `Style
| `In
| `In2
| `Mode
]
type fecolormatrix_attr = [
| core_attr
| presentation_attr
| filter_primitive_attr
| `Class
| `Style
| `Typefecolor
| `Values
| `In
]
type fecomponenttransfer_attr = [
| core_attr
| presentation_attr
| filter_primitive_attr
| `Class
| `Style
| `In
]
type fecomposite_attr = [
| core_attr
| presentation_attr
| filter_primitive_attr
| `Class
| `Style
| `In
| `In2
| `OperatorComposite
| `K1
| `K2
| `K3
| `K4
]
type feconvolvematrix_attr = [
| core_attr
| presentation_attr
| filter_primitive_attr
| `Class
| `Style
| `In
| `Order
| `KernelMatrix
| `Divisor
| `Bias
| `TargetX
| `TargetY
| `EdgeMode
| `KernelUnitLength
| `PreserveAlpha
]
type fediffuselighting_attr = [
| core_attr
| filter_primitive_attr
| presentation_attr
| `Class
| `Style
| `In
| `SurfaceScale
| `DiffuseConstant
| `KernelUnitLength
]
type fedisplacementmap_attr = [
| core_attr
| filter_primitive_attr
| presentation_attr
| `Class
| `Style
| `In
| `In2
| `Scale
| `XChannelSelector
| `YChannelSelector
]
type fegaussianblur_attr = [
| core_attr
| presentation_attr
| filter_primitive_attr
| `Class
| `Style
| `In
| `StdDeviation
]
type feimage_attr = [
| core_attr
| presentation_attr
| filter_primitive_attr
| xlink_attr
| `Xlink_href
| `Class
| `Style
| `ExternalResourcesRequired
| `PreserveAspectRadio
]
type femorphology_attr = [
| core_attr
| presentation_attr
| filter_primitive_attr
| `OperatorMorphology
| `Class
| `Style
| `In
| `Radius
]
type feoffset_attr = [
| core_attr
| presentation_attr
| filter_primitive_attr
| `Class
| `Style
| `Dx
| `Dy
| `In
]
type fespecularlighting_attr = [
| core_attr
| presentation_attr
| filter_primitive_attr
| `Class
| `Style
| `In
| `SurfaceScale
| `SpecularConstant
| `SpecularExponent
| `KernelUnitLength
]
type feturbulence_attr = [
| core_attr
| presentation_attr
| filter_primitive_attr
| `Class
| `Style
| `BaseFrequency
| `NumOctaves
| `Seed
| `StitchTiles
| `TypeStitch
]
type cursor_content = descriptive_element
type cursor_attr = [
| core_attr
| conditional_processing_attr
| xlink_attr
| `X
| `Y
| `ExternalResourcesRequired
| `Xlink_href
]
type a_content = [
| animation_element
| descriptive_element
| shape_element
| structural_element
| gradient_element
| `A
| `AltGlyphDef
| `ClipPath
| `Color_Profile
| `Cursor
| `Filter
| `Font
| `Font_Face
| `ForeignObject
| `Image
| `Marker
| `Mask
| `Pattern
| `Script
| `Style
| `Switch
| `Text
| `View
]
type a_attr = [
| core_attr
| conditional_processing_attr
| xlink_attr
| graphical_event_attr
| presentation_attr
| `Class
| `Style
| `ExternalResourcesRequired
| `Transform
| `Xlink_href
| `Xlink_show
| `Xlink_actuate
| `Target
]
type view_content = descriptive_element
type view_attr = [
| core_attr
| `ExternalResourcesRequired
| `ViewBox
| `PreserveAspectRatio
| `ZoomAndPan
| `ViewTarget
]
type animate_content = descriptive_element
type animate_attr = [
| conditional_processing_attr
| core_attr
| animation_event_attr
| xlink_attr
| animation_attr_target_attr
| animation_timing_attr
| animation_value_attr
| animation_addition_attr
| `ExternalResourcesRequired
]
type set_content = descriptive_element
type set_attr = [
| core_attr
| conditional_processing_attr
| xlink_attr
| animation_event_attr
| animation_attr_target_attr
| animation_timing_attr
| `To
| `ExternalResourcesRequired
]
type animatemotion_attr = [
| conditional_processing_attr
| core_attr
| animation_event_attr
| xlink_attr
| animation_timing_attr
| animation_value_attr
| animation_addition_attr
| `ExternalResourcesRequired
| `Path
| `KeyPoints
| `Rotate
| `Origin
]
type mpath_content = descriptive_element
type animatecolor_content = descriptive_element
type animatecolor_attr = [
| conditional_processing_attr
| core_attr
| animation_event_attr
| xlink_attr
| animation_attr_target_attr
| animation_timing_attr
| animation_value_attr
| animation_addition_attr
| `ExternalResourcesRequired
]
type animatetransform_content = descriptive_element
type animatetransform_attr = [
| conditional_processing_attr
| core_attr
| animation_event_attr
| xlink_attr
| animation_attr_target_attr
| animation_timing_attr
| animation_value_attr
| animation_addition_attr
| `ExternalResourcesRequired
| `Typeanimatetransform
]
type font_attr = [
| core_attr
| presentation_attr
| `Class
| `Style
| `ExternalResourcesRequired
| `HorizOriginX
| `HorizOriginY
| `HorizAdvX
| `VertOriginX
| `VertOriginY
| `VertAdvY
]
type glyph_content = [
| animation_element
| descriptive_element
| shape_element
| structural_element
| gradient_element
| `A
| `AltGlyphDef
| `ClipPath
| `Color_Profile
| `Cursor
| `Filter
| `Font
| `Font_Face
| `ForeignObject
| `Image
| `Marker
| `Mask
| `Pattern
| `Script
| `Style
| `Switch
| `Text
| `View
]
type glyph_attr = [
| core_attr
| presentation_attr
| `Class
| `Style
| `D
| `HorizAdvX
| `VertOriginX
| `VertOriginY
| `VertAdvY
| `Unicode
| `GlyphName
| `Orientation
| `ArabicForm
| `Lang
]
type missingglyph_content = [
| animation_element
| descriptive_element
| shape_element
| structural_element
| gradient_element
| `A
| `AltGlyphDef
| `ClipPath
| `Color_Profile
| `Cursor
| `Filter
| `Font
| `Font_Face
| `ForeignObject
| `Image
| `Marker
| `Mask
| `Pattern
| `Script
| `Style
| `Switch
| `Text
| `View
]
type missingglyph_attr = [
| core_attr
| presentation_attr
| `Class
| `Style
| `D
| `HorizAdvX
| `VertOriginX
| `VertOriginY
| `VertAdvY
]
type font_face_attr = [
| core_attr
| `Font_Family
| `Font_Style
| `Font_Variant
| `Font_Weight
| `Font_Stretch
| `Font_Size
| `UnicodeRange
| `UnitsPerEm
| `Panose1
| `Stemv
| `Stemh
| `Slope
| `CapHeight
| `XHeight
| `AccentHeight
| `Ascent
| `Descent
| `Widths
| `Bbox
| `Ideographic
| `Alphabetic
| `Mathematical
| `Hanging
| `VIdeographic
| `VAlphabetic
| `VMathematical
| `VHanging
| `UnderlinePosition
| `UnderlineThickness
| `StrikethroughPosition
| `StrikethroughThickness
| `OverlinePosition
| `OverlineThickness
]
type font_face_src_attr = core_attr
type foreignobject_attr = [
| core_attr
| conditional_processing_attr
| graphical_event_attr
| presentation_attr
| `Class
| `Style
| `ExternalResourcesRequired
| `Transform
| `X
| `Y
| `Width
| `Height
]
type big_variant = [
| `A
| `Absolute_colorimetric
| `Align
| `Always
| `Atop
| `Arithmetic
| `Auto
| `B
| `Bever
| `Blink
| `Butt
| `CSS
| `Darken
| `Default
| `Dilate
| `Disable
| `Discrete
| `Duplicate
| `End
| `Erode
| `Exact
| `FractalNoise
| `Freeze
| `HueRotate
| `G
| `Gamma
| `GeometricPrecision
| `H
| `Identity
| `In
| `Inherit
| `Initial
| `Isolated
| `Lighten
| `Line_through
| `Linear
| `LuminanceToAlpha
| `Magnify
| `Matrix
| `Medial
| `Middle
| `Miter
| `Multiply
| `Never
| `New
| `None
| `Normal
| `NoStitch
| `ObjectBoundingBox
| `OnLoad
| `OnRequest
| `OptimizeLegibility
| `OptimizeSpeed
| `Other
| `Out
| `Over
| `Overline
| `Paced
| `Pad
| `Perceptual
| `Preserve
| `R
| `Reflect
| `Remove
| `Repeat
| `Replace
| `Relative_colorimetric
| `Rotate
| `Round
| `Saturate
| `Saturation
| `Scale
| `Screen
| `SkewX
| `SkewY
| `Spacing
| `SpacingAndGlyphs
| `Spline
| `Square
| `Start
| `Stitch
| `Stretch
| `StrokeWidth
| `Sum
| `Table
| `Terminal
| `Translate
| `Turbulence
| `Underline
| `UserSpaceOnUse
| `V
| `WhenNotActive
| `Wrap
| `XML
| `Xor
]
type animation = animate
type animation_content = animate_content
type animation_attr = animate_attr