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.
Categories of elements and attributes
This part defines the categories of elements and attributes
Elements
type animation_element = [
| `AnimateColor |
| `AnimateMotion |
| `AnimateTransform |
| `Animate |
| `Set |
]
type descriptive_element = [
| `Desc |
| `Metadata |
| `Title |
]
type basic_shape_element = [
| `Circle |
| `Ellipse |
| `Line |
| `Polygon |
| `Polyline |
| `Rect |
]
type container_element = [
| `A |
| `Defs |
| `Glyph |
| `G |
| `Marker |
| `Mask |
| `Missing_glyph |
| `Pattern |
| `Svg |
| `Switch |
| `Symbol |
]
type filter_primitive_element = [
| `FeBlend |
| `FeColorMatrix |
| `FeComponentTransfer |
| `FeComposite |
| `FeConvolveMatrix |
| `FeDiffuseLighting |
| `FeDisplacementMap |
| `FeFlood |
| `FeGaussianBlur |
| `FeImage |
| `FeMerge |
| `FeMorphology |
| `FeOffset |
| `FeSpecularLighting |
| `FeTile |
| `FeTurbulence |
]
type light_source_element = [
| `FeDistantLight |
| `FePointLight |
| `FeSpotLight |
]
type shape_element = [
| `Circle |
| `Ellipse |
| `Line |
| `Path |
| `Polyline |
| `Polygon |
| `Rect |
]
type structural_element = [
| `Defs |
| `G |
| `Svg |
| `Symbol |
| `Use |
]
type text_content_element = [
| `AltGlyph |
| `TextPath |
| `Text |
| `Tref |
| `Tspan |
]
type text_content_child_element = [
| `AltGlyph |
| `TextPath |
| `Tref |
| `Tspan |
]
type gradient_element = [
| `Lineargradient |
| `Radialgradient |
]
type graphics_element = [
| `Circle |
| `Ellipse |
| `Image |
| `Line |
| `Path |
| `Polygon |
| `Polyline |
| `Rect |
| `Text |
| `Use |
]
type graphics_ref_element = [
]
Attributes
type conditional_processing_attr = [
| `RequiredExtensions |
| `RequiredFeatures |
| `SystemLanguage |
]
type core_attr = [
| `Id |
| `Xml_base |
| `Xml_lang |
| `Xml_space |
| `User_data |
]
type transfer_attr = [
| `Type_transfert |
| `TableValues |
| `Slope |
| `Intercept |
| `Amplitude |
| `Exponent |
| `Offset_transfer |
]
type document_event_attr = [
| `OnAbort |
| `OnError |
| `OnResize |
| `OnScroll |
| `OnUnload |
| `OnZoom |
]
type filter_primitive_attr = [
| `Height |
| `Result |
| `Width |
| `X |
| `Y |
]
type animation_event_attr = [
| `OnBegin |
| `OnEnd |
| `OnRepeat |
| `OnLoad |
]
type animation_attr_target_attr = [
| `AttributeType |
| `AttributeName |
]
type animation_timing_attr = [
| `Begin |
| `Dur |
| `End |
| `Min |
| `Max |
| `Restart |
| `RepeatCount |
| `RepeatDur |
| `Fill_Animation |
]
type animation_value_attr = [
| `CalcMode |
| `Valuesanim |
| `KeyTimes |
| `KeySplines |
| `From |
| `To |
| `By |
]
type animation_addition_attr = [
]
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 |
]
type graphical_event_attr = [
| `OnActivate |
| `OnClick |
| `OnFocusIn |
| `OnFocusOut |
| `OnLoad |
| `OnMouseDown |
| `OnMouseMove |
| `OnMouseOut |
| `OnMouseOver |
| `OnMouseUp |
]
type xlink_attr = [
| `Xlink_href |
| `Xlink_type |
| `Xlink_role |
| `Xlink_arcrole |
| `Xlink_title |
| `Xlink_show |
| `Xlink_actuate |
]
Generic data types
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..
Units
module Unit : sig ... end
SVG defines several units to measure time, length, angles.
type strings = string list
type paint_whitout_icc = [
]
type spacestrings = string list
type commastrings = string list
type fourfloats = float * float * float * float
type numbers = float list
type numbers_semicolon = float list
type coords = (float * float) list
Element
type symbol_content = [
]
type symbol_attr = [
| `Class |
| `Style |
| `ExternalResourcesRequired |
| `PreserveAspectRatio |
| `ViewBox |
]
type switch_content = [
]
type circle_content = [
]
type ellipse_content = [
]
type polyline_content = [
]
type polygon_content = [
]
type textpath_content = [
]
type altglyph_content = [
]
type altglyphdef_attr = [
]
type altglyphitem_content = [
]
type altglyphitem_attr = [
]
type marker_content = [
]
type marker_attr = [
| core_attr |
| presentation_attr |
| `Class |
| `Style |
| `ExternalResourcesRequired |
| `ViewBox |
| `PreserveAspectRatio |
| `RefX |
| `RefY |
| `MarkerUnits |
| `MarkerWidth |
| `MarkerHeight |
| `Orient |
]
type colorprofile_content = [
]
type colorprofile_attr = [
]
type lineargradient = [
]
type lineargradient_content = [
]
type lineargradient_attr = [
]
type radialgradient = [
]
type radialgradient_content = [
]
type radialgradient_attr = [
]
type stop_content = [
| `Animate |
| `Animate_Color |
| `Set |
]
type pattern_content = [
]
type clippath_content = [
]
type filter_content = [
]
type fedistantlight = [
]
type fedistantlight_content = [
]
type fedistantlight_attr = [
]
type fepointlight_content = [
]
type fepointlight_attr = [
]
type fespotlight_content = [
]
type fespotlight_attr = [
| core_attr |
| `X |
| `Y |
| `Z |
| `PointsAtX |
| `PointsAtY |
| `PointsAtZ |
| `SpecularExponent |
| `LimitingConeAngle |
]
type feblend_content = [
]
type fecolormatrix_content = [
]
type fecolormatrix_attr = [
]
type fecomponenttransfer = [
]
type fecomponenttransfer_content = [
| `FeFuncA |
| `FeFuncB |
| `FeFuncG |
| `FeFuncR |
]
type fecomponenttransfer_attr = [
]
type fefunca_content = [
]
type fefuncg_content = [
]
type fefuncb_content = [
]
type fefuncr_content = [
]
type fecomposite_content = [
]
type fecomposite_attr = [
]
type feconvolvematrix = [
]
type feconvolvematrix_content = [
]
type feconvolvematrix_attr = [
]
type fediffuselighting = [
]
type fediffuselighting_content = [
]
type fediffuselighting_attr = [
]
type fedisplacementmap = [
]
type fedisplacementmap_content = [
]
type fedisplacementmap_attr = [
]
type feflood_content = [
| `Animate |
| `AnimateColor |
| `Set |
]
type fegaussianblur = [
]
type fegaussianblur_content = [
| `Animate |
| `AnimateColor |
| `Set |
]
type fegaussianblur_attr = [
]
type feimage_content = [
| `Animate |
| `AnimateColor |
| `Set |
]
type femerge_content = [
]
type femorphology_content = [
]
type femorphology_attr = [
]
type feoffset_content = [
]
type fespecularlighting = [
]
type fespecularlighting_content = [
]
type fespecularlighting_attr = [
]
type fetile_content = [
]
type feturbulence_content = [
]
type feturbulence_attr = [
]
type view_attr = [
| core_attr |
| `ExternalResourcesRequired |
| `ViewBox |
| `PreserveAspectRatio |
| `ZoomAndPan |
| `ViewTarget |
]
type script_content = [
]
type animation_attr = [
]
type animatemotion_content = [
]
type animatemotion_attr = [
]
type animatecolor_attr = [
]
type font_attr = [
| core_attr |
| presentation_attr |
| `Class |
| `Style |
| `ExternalResourcesRequired |
| `HorizOriginX |
| `HorizOriginY |
| `HorizAdvX |
| `VertOriginX |
| `VertOriginY |
| `VertAdvY |
]
type glyph_attr = [
| core_attr |
| presentation_attr |
| `Class |
| `Style |
| `D |
| `HorizAdvX |
| `VertOriginX |
| `VertOriginY |
| `VertAdvY |
| `Unicode |
| `GlyphName |
| `Orientation |
| `ArabicForm |
| `Lang |
]
type missingglyph_content = [
]
type missingglyph_attr = [
]
type font_face_content = [
]
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_content = [
| `Font_Face_Name |
| `Font_Face_Uri |
]
type font_face_uri_content = [
]
type font_face_uri_attr = [
]
type font_face_name = [
]
type font_face_name_attr = [
]
type foreignobject_attr = [
]
type alignment_baseline = [
| `After_edge |
| `Alphabetic |
| `Auto |
| `Baseline |
| `Before_edge |
| `Central |
| `Hanging |
| `Ideographic |
| `Inherit |
| `Mathematical |
| `Middle |
| `Text_after_edge |
| `Text_before_edge |
]
type dominant_baseline = [
| `Auto |
| `Use_script |
| `No_change |
| `Reset_size |
| `Ideographic |
| `Alphabetic |
| `Hanging |
| `Mathematical |
| `Central |
| `Middle |
| `Text_after_edge |
| `Text_before_edge |
| `Inherit |
]
type in_value = [
| `SourceGraphic |
| `SourceAlpha |
| `BackgroundImage |
| `BackgroundAlpha |
| `FillPaint |
| `StrokePaint |
| `Ref of string |
]
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 |
]