tyxml icon indicating copy to clipboard operation
tyxml copied to clipboard

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

Open slegrand45 opened this issue 2 years ago • 1 comments

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.

slegrand45 avatar Apr 11 '22 20:04 slegrand45

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 []]

ilankri avatar Apr 12 '22 16:04 ilankri