Skip to content

Commit df1e1b8

Browse files
committed
WIP: add add various type annotations and missing parameters
1 parent 2c6a7ac commit df1e1b8

18 files changed

+409
-453
lines changed

Diff for: src/Plotly.NET/Axis.fs

+105-113
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
namespace Plotly.NET
22

3+
open System
34
/// Module containing plotly axis
45
module Axis =
56

@@ -10,60 +11,58 @@ module Axis =
1011
/// Init LinearAxis type
1112
static member init
1213
(
13-
?AxisType ,
14-
?Title : string ,
15-
?Titlefont ,
16-
?Autorange ,
17-
?Rangemode ,
18-
?Range ,
19-
?RangeSlider:RangeSlider,
20-
?Fixedrange ,
21-
?Tickmode ,
22-
?nTicks ,
23-
?Tick0 ,
24-
?dTick ,
25-
?Tickvals ,
26-
?Ticktext ,
27-
?Ticks ,
28-
?Mirror ,
29-
?Ticklen ,
30-
?Tickwidth ,
31-
?Tickcolor ,
32-
?Showticklabels ,
33-
?Tickfont ,
34-
?Tickangle ,
35-
?Tickprefix ,
36-
?Showtickprefix ,
37-
?Ticksuffix ,
38-
?Showticksuffix ,
39-
?Showexponent ,
40-
?Exponentformat ,
41-
?Tickformat ,
42-
?Hoverformat ,
43-
?Showline ,
44-
?Linecolor ,
45-
?Linewidth ,
46-
?Showgrid ,
47-
?Gridcolor ,
48-
?Gridwidth ,
49-
?Zeroline ,
50-
?Zerolinecolor ,
51-
?Zerolinewidth ,
52-
?Anchor ,
53-
?Side ,
54-
?Overlaying ,
55-
?Domain ,
56-
?Position ,
57-
?IsSubplotObj ,
58-
?Tickvalssrc ,
59-
?Ticktextsrc ,
60-
?Showspikes ,
61-
?Spikesides ,
62-
?Spikethickness ,
63-
?Spikecolor ,
64-
?Showbackground ,
65-
?Backgroundcolor,
66-
?Showaxeslabels
14+
?AxisType: StyleParam.AxisType,
15+
?Title: string,
16+
?Titlefont: Font,
17+
?Autorange: StyleParam.AutoRange,
18+
?Rangemode: StyleParam.RangeMode,
19+
?Range: StyleParam.Range,
20+
?RangeSlider: RangeSlider,
21+
?Fixedrange:bool,
22+
?Tickmode: StyleParam.TickMode,
23+
?nTicks: int,
24+
?Tick0: IConvertible,
25+
?dTick: IConvertible,
26+
?Tickvals: seq<IConvertible>,
27+
?Ticktext: seq<IConvertible>,
28+
?Ticks: StyleParam.TickOptions,
29+
?Mirror: StyleParam.Mirror,
30+
?Ticklen: float,
31+
?Tickwidth: float,
32+
?Tickcolor: string,
33+
?Showticklabels: bool,
34+
?Tickfont: Font,
35+
?Tickangle: int,
36+
?Tickprefix: string,
37+
?Showtickprefix: StyleParam.ShowTickOption,
38+
?Ticksuffix: string,
39+
?Showticksuffix: StyleParam.ShowTickOption,
40+
?Showexponent: StyleParam.ShowExponent,
41+
?Exponentformat: StyleParam.ExponentFormat,
42+
?Tickformat: string,
43+
?Hoverformat: string,
44+
?Showline: bool,
45+
?Linecolor: string,
46+
?Linewidth: float,
47+
?Showgrid: bool,
48+
?Gridcolor: string,
49+
?Gridwidth: float,
50+
?Zeroline : bool,
51+
?Zerolinecolor: string,
52+
?Zerolinewidth: float,
53+
?Anchor: StyleParam.AxisAnchorId,
54+
?Side: StyleParam.Side,
55+
?Overlaying: StyleParam.AxisAnchorId,
56+
?Domain: StyleParam.Range,
57+
?Position: float,
58+
?IsSubplotObj: bool,
59+
?Showspikes: bool,
60+
?Spikethickness: float,
61+
?Spikecolor: string,
62+
?Showbackground: bool,
63+
?Backgroundcolor: string,
64+
?Showaxeslabels: bool,
65+
?Visible: bool
6766
) =
6867
LinearAxis()
6968
|> LinearAxis.style
@@ -113,74 +112,70 @@ module Axis =
113112
?Domain = Domain ,
114113
?Position = Position ,
115114
?IsSubplotObj = IsSubplotObj ,
116-
?Tickvalssrc = Tickvalssrc ,
117-
?Ticktextsrc = Ticktextsrc ,
118115
?Showspikes = Showspikes ,
119-
?Spikesides = Spikesides ,
120116
?Spikethickness = Spikethickness ,
121117
?Spikecolor = Spikecolor ,
122118
?Showbackground = Showbackground ,
123119
?Backgroundcolor = Backgroundcolor,
124-
?Showaxeslabels = Showaxeslabels
120+
?Showaxeslabels = Showaxeslabels,
121+
?Visible = Visible
125122
)
126123

127124
// Applies the styles to LinearAxis()
128125
static member style
129126
(
130-
?AxisType,
131-
?Title,
132-
?Titlefont:Font,
133-
?Autorange,
134-
?Rangemode,
135-
?Range,
136-
?RangeSlider:RangeSlider,
137-
?Fixedrange,
138-
?Tickmode,
139-
?nTicks,
140-
?Tick0,
141-
?dTick,
142-
?Tickvals,
143-
?Ticktext,
144-
?Ticks,
145-
?Mirror,
146-
?Ticklen,
147-
?Tickwidth,
148-
?Tickcolor,
149-
?Showticklabels,
150-
?Tickfont:Font,
151-
?Tickangle,
152-
?Tickprefix,
153-
?Showtickprefix,
154-
?Ticksuffix,
155-
?Showticksuffix,
156-
?Showexponent,
157-
?Exponentformat,
158-
?Tickformat,
159-
?Hoverformat,
127+
?AxisType: StyleParam.AxisType,
128+
?Title: string,
129+
?Titlefont: Font,
130+
?Autorange: StyleParam.AutoRange,
131+
?Rangemode: StyleParam.RangeMode,
132+
?Range: StyleParam.Range,
133+
?RangeSlider: RangeSlider,
134+
?Fixedrange:bool,
135+
?Tickmode: StyleParam.TickMode,
136+
?nTicks: int,
137+
?Tick0: IConvertible,
138+
?dTick: IConvertible,
139+
?Tickvals: seq<IConvertible>,
140+
?Ticktext: seq<IConvertible>,
141+
?Ticks: StyleParam.TickOptions,
142+
?Mirror: StyleParam.Mirror,
143+
?Ticklen: float,
144+
?Tickwidth: float,
145+
?Tickcolor: string,
146+
?Showticklabels: bool,
147+
?Tickfont: Font,
148+
?Tickangle: int,
149+
?Tickprefix: string,
150+
?Showtickprefix: StyleParam.ShowTickOption,
151+
?Ticksuffix: string,
152+
?Showticksuffix: StyleParam.ShowTickOption,
153+
?Showexponent: StyleParam.ShowExponent,
154+
?Exponentformat: StyleParam.ExponentFormat,
155+
?Tickformat: string,
156+
?Hoverformat: string,
160157
?Showline: bool,
161-
?Linecolor,
162-
?Linewidth,
158+
?Linecolor: string,
159+
?Linewidth: float,
163160
?Showgrid: bool,
164-
?Gridcolor,
165-
?Gridwidth,
161+
?Gridcolor: string,
162+
?Gridwidth: float,
166163
?Zeroline : bool,
167-
?Zerolinecolor,
168-
?Zerolinewidth,
169-
?Anchor :StyleParam.AxisAnchorId,
170-
?Side :StyleParam.Side,
171-
?Overlaying :StyleParam.AxisAnchorId,
172-
?Domain,
173-
?Position : float,
174-
?IsSubplotObj,
175-
?Tickvalssrc,
176-
?Ticktextsrc,
177-
?Showspikes,
178-
?Spikesides,
179-
?Spikethickness,
180-
?Spikecolor,
181-
?Showbackground,
182-
?Backgroundcolor,
183-
?Showaxeslabels
164+
?Zerolinecolor: string,
165+
?Zerolinewidth: float,
166+
?Anchor: StyleParam.AxisAnchorId,
167+
?Side: StyleParam.Side,
168+
?Overlaying: StyleParam.AxisAnchorId,
169+
?Domain: StyleParam.Range,
170+
?Position: float,
171+
?IsSubplotObj: bool,
172+
?Showspikes: bool,
173+
?Spikethickness: float,
174+
?Spikecolor: string,
175+
?Showbackground: bool,
176+
?Backgroundcolor: string,
177+
?Showaxeslabels: bool,
178+
?Visible: bool
184179
) =
185180
(fun (axis:LinearAxis) ->
186181
AxisType |> DynObj.setValueOptBy axis "type" StyleParam.AxisType.convert
@@ -228,16 +223,13 @@ module Axis =
228223
Domain |> DynObj.setValueOptBy axis "domain" StyleParam.Range.convert
229224
Position |> DynObj.setValueOpt axis "position"
230225
IsSubplotObj |> DynObj.setValueOpt axis "_isSubplotObj"
231-
Tickvalssrc |> DynObj.setValueOpt axis "tickvalssrc"
232-
Ticktextsrc |> DynObj.setValueOpt axis "ticktextsrc"
233226
Showspikes |> DynObj.setValueOpt axis "showspikes"
234-
Spikesides |> DynObj.setValueOpt axis "spikesides"
235227
Spikethickness |> DynObj.setValueOpt axis "spikethickness"
236228
Spikecolor |> DynObj.setValueOpt axis "spikecolor"
237229
Showbackground |> DynObj.setValueOpt axis "showbackground"
238230
Backgroundcolor |> DynObj.setValueOpt axis "backgroundcolor"
239231
Showaxeslabels |> DynObj.setValueOpt axis "showaxeslabels"
240-
232+
Visible |> DynObj.setValueOpt axis "visible"
241233
//Update
242234
Titlefont |> DynObj.setValueOpt axis "titlefont"
243235
Tickfont |> DynObj.setValueOpt axis "tickfont"

Diff for: src/Plotly.NET/Bins.fs

+6-6
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ type Bins () =
88
// Init Bins()
99
static member init
1010
(
11-
?StartBins ,
12-
?EndBins ,
13-
?Size
11+
?StartBins: float,
12+
?EndBins: float,
13+
?Size: float
1414
) =
1515
Bins ()
1616
|> Bins.style
@@ -24,9 +24,9 @@ type Bins () =
2424
// Applies the styles to Bins()
2525
static member style
2626
(
27-
?StartBins:float,
28-
?EndBins :float,
29-
?Size
27+
?StartBins: float,
28+
?EndBins: float,
29+
?Size: float
3030
) =
3131

3232
(fun (bins:Bins) ->

Diff for: src/Plotly.NET/Box.fs

+8-8
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ type Box () =
1010
/// Initialized Line object
1111
static member init
1212
(
13-
?Visible :bool,
14-
?Width :float,
15-
?FillColor,
16-
?Line :Line
13+
?Visible: bool,
14+
?Width: float,
15+
?FillColor: string,
16+
?Line: Line
1717
) =
1818
Box ()
1919
|> Box.style
@@ -28,10 +28,10 @@ type Box () =
2828
// Applies the styles to Line()
2929
static member style
3030
(
31-
?Visible :bool,
32-
?Width :float,
33-
?FillColor :Colors.Color,
34-
?Line :Line
31+
?Visible: bool,
32+
?Width: float,
33+
?FillColor: string,
34+
?Line: Line
3535
) =
3636
(fun (box:Box) ->
3737
Visible |> DynObj.setValueOpt box "visible"

Diff for: src/Plotly.NET/Chart.fs

+6-5
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ type Chart =
7878
/// GroupNorm : Sets the normalization for the sum of this `stackgroup. Only relevant when `stackgroup` is used, and only the first `groupnorm` found in the `stackgroup` will be used
7979
///
8080
/// UseWebGL : If true, plotly.js will use the WebGL engine to render this chart. use this when you want to render many objects at once.
81-
static member Scatter(x, y,mode,
81+
static member Scatter(x, y, mode,
8282
[<Optional;DefaultParameterValue(null)>] ?Name ,
8383
[<Optional;DefaultParameterValue(null)>] ?Showlegend ,
8484
[<Optional;DefaultParameterValue(null)>] ?MarkerSymbol ,
@@ -377,6 +377,7 @@ type Chart =
377377
?StackGroup = StackGroup,
378378
?Orientation= Orientation,
379379
?GroupNorm = GroupNorm)
380+
>> TraceStyle.Line(?Color=Color,?Dash=Dash,?Width=Width)
380381
>> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity)
381382
>> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol)
382383
>> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont)
@@ -741,14 +742,14 @@ type Chart =
741742
Trace.initScatter (
742743
TraceStyle.Scatter(X = x,Y = lower, Mode=StyleParam.Mode.Lines, ?Fillcolor=RangeColor) )
743744
|> TraceStyle.TraceInfo(Showlegend=false)
744-
|> TraceStyle.Line(Width=0)
745+
|> TraceStyle.Line(Width=0.)
745746
|> TraceStyle.Marker(Color=if RangeColor.IsSome then RangeColor.Value else "rgba(0,0,,0.5)")
746747

747748
let upper =
748749
Trace.initScatter (
749750
TraceStyle.Scatter(X = x,Y = upper, Mode=StyleParam.Mode.Lines, ?Fillcolor=RangeColor, Fill=StyleParam.Fill.ToNext_y) )
750751
|> TraceStyle.TraceInfo(Showlegend=false)
751-
|> TraceStyle.Line(Width=0)
752+
|> TraceStyle.Line(Width=0.)
752753
|> TraceStyle.Marker(Color=if RangeColor.IsSome then RangeColor.Value else "rgba(0,0,,0.5)")
753754

754755
GenericChart.MultiChart ([lower;upper;trace],Layout(),Config())
@@ -793,14 +794,14 @@ type Chart =
793794
Trace.initScatter (
794795
TraceStyle.Scatter(X = x,Y = lower, Mode=StyleParam.Mode.Lines, ?Fillcolor=RangeColor) )
795796
|> TraceStyle.TraceInfo(Showlegend=false)
796-
|> TraceStyle.Line(Width=0)
797+
|> TraceStyle.Line(Width=0.)
797798
|> TraceStyle.Marker(Color=if RangeColor.IsSome then RangeColor.Value else "rgba(0,0,0,0.5)")
798799

799800
let upper =
800801
Trace.initScatter (
801802
TraceStyle.Scatter(X = x,Y = upper, Mode=StyleParam.Mode.Lines, ?Fillcolor=RangeColor, Fill=StyleParam.Fill.ToNext_y) )
802803
|> TraceStyle.TraceInfo(Showlegend=false)
803-
|> TraceStyle.Line(Width=0)
804+
|> TraceStyle.Line(Width=0.)
804805
|> TraceStyle.Marker(Color=if RangeColor.IsSome then RangeColor.Value else "rgba(0,0,0,0.5)")
805806

806807
GenericChart.MultiChart ([lower;upper;trace],Layout(),Config())

0 commit comments

Comments
 (0)