ocsigen / tyxml

Build valid HTML and SVG documents
https://ocsigen.org/tyxml/
Other
163 stars 57 forks source link

How to add <animate /> in <circle> ? #305

Closed slegrand45 closed 9 months ago

slegrand45 commented 2 years ago

Hi,

I can't find a way to add the <animate /> tag in a <circle> one. It seems i have to use the animation function (animate seems undefined). But the animation function is not allowed in circle:

Error: This expression has type [> Svg_types.animation ] Svg.elt
       but an expression was expected of type
         [< Svg_types.circle_content ] Svg.elt
       Type [> Svg_types.animation ] = [> `Animation ]
       is not compatible with type
         [< Svg_types.circle_content ] =
           [< `Animate
            | `AnimateColor
            | `AnimateMotion
            | `AnimateTransform
            | `Desc
            | `Metadata
            | `Set
            | `Title ] 
       The second variant type does not allow tag(s) `Animation

Do i miss something ? Thanks.

ilankri commented 2 years ago

Hello @slegrand45,

Do i miss something ?

No, it is just a bug :)

With these changes, the following code should be well-typed:

let circle = Tyxml.Svg.circle [Tyxml.Svg.animate []]