|
| 1 | +namespace Plotly.NET.LayoutObjects |
| 2 | + |
| 3 | +open Plotly.NET |
| 4 | +open DynamicObj |
| 5 | +open System |
| 6 | +open System.Runtime.InteropServices |
| 7 | + |
| 8 | +type NewShape() = |
| 9 | + inherit DynamicObj() |
| 10 | + /// <summary> |
| 11 | + /// Returns a new NewShape object with the given styling. |
| 12 | + /// </summary> |
| 13 | + ///<param name="DrawDirection">When `dragmode` is set to "drawrect", "drawline" or "drawcircle" this limits the drag to be horizontal, vertical or diagonal. Using "diagonal" there is no limit e.g. in drawing lines in any direction. "ortho" limits the draw to be either horizontal or vertical. "horizontal" allows horizontal extend. "vertical" allows vertical extend.</param> |
| 14 | + ///<param name="FillColor">Sets the color filling new shapes' interior. Please note that if using a fillcolor with alpha greater than half, drag inside the active shape starts moving the shape underneath, otherwise a new shape could be started over.</param> |
| 15 | + ///<param name="FillRule">Determines the path's interior. For more info please visit https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/fill-rule</param> |
| 16 | + ///<param name="Layer">Specifies whether new shapes are drawn below or above traces.</param> |
| 17 | + ///<param name="Line">Sets the outline of new shapes.</param> |
| 18 | + ///<param name="Opacity">Sets the opacity of new shapes.</param> |
| 19 | + static member init |
| 20 | + ( |
| 21 | + [<Optional; DefaultParameterValue(null)>] ?DrawDirection: StyleParam.DrawDirection, |
| 22 | + [<Optional; DefaultParameterValue(null)>] ?FillColor: Color, |
| 23 | + [<Optional; DefaultParameterValue(null)>] ?FillRule: StyleParam.FillRule, |
| 24 | + [<Optional; DefaultParameterValue(null)>] ?Layer: StyleParam.Layer, |
| 25 | + [<Optional; DefaultParameterValue(null)>] ?Line: Line, |
| 26 | + [<Optional; DefaultParameterValue(null)>] ?Opacity: float |
| 27 | + |
| 28 | + ) = |
| 29 | + NewShape() |
| 30 | + |> NewShape.style ( |
| 31 | + ?DrawDirection= DrawDirection, |
| 32 | + ?FillColor = FillColor, |
| 33 | + ?FillRule = FillRule, |
| 34 | + ?Layer = Layer, |
| 35 | + ?Line = Line, |
| 36 | + ?Opacity = Opacity |
| 37 | + ) |
| 38 | + |
| 39 | + /// <summary> |
| 40 | + /// Returns a function that applies the given styles to a NewShape object |
| 41 | + /// </summary> |
| 42 | + ///<param name="DrawDirection">When `dragmode` is set to "drawrect", "drawline" or "drawcircle" this limits the drag to be horizontal, vertical or diagonal. Using "diagonal" there is no limit e.g. in drawing lines in any direction. "ortho" limits the draw to be either horizontal or vertical. "horizontal" allows horizontal extend. "vertical" allows vertical extend.</param> |
| 43 | + ///<param name="FillColor">Sets the color filling new shapes' interior. Please note that if using a fillcolor with alpha greater than half, drag inside the active shape starts moving the shape underneath, otherwise a new shape could be started over.</param> |
| 44 | + ///<param name="FillRule">Determines the path's interior. For more info please visit https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/fill-rule</param> |
| 45 | + ///<param name="Layer">Specifies whether new shapes are drawn below or above traces.</param> |
| 46 | + ///<param name="Line">Sets the outline of new shapes.</param> |
| 47 | + ///<param name="Opacity">Sets the opacity of new shapes.</param> |
| 48 | + static member style |
| 49 | + ( |
| 50 | + [<Optional; DefaultParameterValue(null)>] ?DrawDirection: StyleParam.DrawDirection, |
| 51 | + [<Optional; DefaultParameterValue(null)>] ?FillColor: Color, |
| 52 | + [<Optional; DefaultParameterValue(null)>] ?FillRule: StyleParam.FillRule, |
| 53 | + [<Optional; DefaultParameterValue(null)>] ?Layer: StyleParam.Layer, |
| 54 | + [<Optional; DefaultParameterValue(null)>] ?Line: Line, |
| 55 | + [<Optional; DefaultParameterValue(null)>] ?Opacity: float |
| 56 | + ) = |
| 57 | + (fun (newShape: NewShape) -> |
| 58 | + |
| 59 | + DrawDirection |> DynObj.setValueOptBy newShape "drawdirection" StyleParam.DrawDirection.convert |
| 60 | + FillColor |> DynObj.setValueOpt newShape "fillcolor" |
| 61 | + FillRule |> DynObj.setValueOptBy newShape "fillrule" StyleParam.FillRule.convert |
| 62 | + Layer |> DynObj.setValueOptBy newShape "layer" StyleParam.Layer.convert |
| 63 | + Line |> DynObj.setValueOpt newShape "line" |
| 64 | + Opacity |> DynObj.setValueOpt newShape "opacity" |
| 65 | + |
| 66 | + newShape) |
| 67 | + |
| 68 | + |
0 commit comments