-
Notifications
You must be signed in to change notification settings - Fork 81
/
Chart.fs
3322 lines (2929 loc) · 209 KB
/
Chart.fs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
namespace Plotly.NET
open Plotly.NET.LayoutObjects
open Plotly.NET.TraceObjects
open Plotly.NET.ConfigObjects
open DynamicObj
open System
open System.IO
open Giraffe.ViewEngine
open GenericChart
open System.Runtime.InteropServices
/// Provides a set of static methods for creating and styling charts.
type Chart =
//==============================================================================================================
//================================================ Core methods ================================================
//==============================================================================================================
/// <summary>
/// Saves the given Chart as html file at the given path (.html file extension is added if not present).
/// Optionally opens the generated file in the browser.
/// </summary>
/// <param name="path">The path to save the chart html at.</param>
/// <param name="OpenInBrowser">Wether or not to open the generated file in the browser (default: false)</param>
[<CompiledName("SaveHtml")>]
static member saveHtml(path: string, [<Optional; DefaultParameterValue(null)>] ?OpenInBrowser: bool) =
fun (ch: GenericChart) ->
let show = defaultArg OpenInBrowser false
let html = GenericChart.toEmbeddedHTML ch
let file =
if path.EndsWith(".html") then
path
else
$"{path}.html"
File.WriteAllText(file, html)
if show then file |> openOsSpecificFile
/// <summary>
/// Saves the given chart as a temporary html file and opens it in the browser.
/// </summary>
/// <param name="ch">The chart to show in the browser</param>
[<CompiledName("Show")>]
static member show(ch: GenericChart) =
let guid = Guid.NewGuid().ToString()
let tempPath = Path.GetTempPath()
let file = sprintf "%s.html" guid
let path = Path.Combine(tempPath, file)
ch |> Chart.saveHtml (path, true)
// #######################
/// Create a combined chart with the given charts merged
[<CompiledName("Combine")>]
static member combine(gCharts: seq<GenericChart>) = GenericChart.combine gCharts
//==============================================================================================================
//============================================= Unspecific charts ==============================================
//==============================================================================================================
/// <summary>Creates a chart that is completely invisible when rendered. The Chart object however is NOT empty! Combining this chart with other charts will have unforseen consequences (it has for example invisible axes that can override other axes if used in Chart.Combine)</summary>
static member Invisible() =
let hiddenAxis () =
LinearAxis.init (ShowGrid = false, ShowLine = false, ShowTickLabels = false, ZeroLine = false)
let trace = Trace2D.initScatter (id)
trace.Remove("type") |> ignore
GenericChart.ofTraceObject false trace
|> GenericChart.mapLayout (fun l ->
l
|> Layout.setLinearAxis (StyleParam.SubPlotId.XAxis 1, hiddenAxis ())
|> Layout.setLinearAxis (StyleParam.SubPlotId.YAxis 1, hiddenAxis ()))
//==============================================================================================================
//======================================== General Trace object styling ========================================
//==============================================================================================================
/// <summary>
/// Sets trace information on the given chart.
/// </summary>
/// <param name="Name">Sets the name of the chart's trace(s). When the chart is a multichart (it contains multiple traces), the name is suffixed by '_%i' where %i is the index of the trace.</param>
/// <param name="Visible">Wether or not the chart's traces are visible</param>
/// <param name="ShowLegend">Determines whether or not item(s) corresponding to this chart's trace(s) is/are shown in the legend.</param>
/// <param name="LegendRank">Sets the legend rank for the chart's trace(s). Items and groups with smaller ranks are presented on top/left side while with `"reversed" `legend.traceorder` they are on bottom/right side. The default legendrank is 1000, so that you can use ranks less than 1000 to place certain items before all unranked items, and ranks greater than 1000 to go after all unranked items.</param>
/// <param name="LegendGroup">Sets the legend group for the chart's trace(s). Traces part of the same legend group hide/show at the same time when toggling legend items.</param>
/// <param name="LegendGroupTitle">Sets the title for the chart's trace legend group </param>
[<CompiledName("WithTraceInfo")>]
static member withTraceInfo
(
[<Optional; DefaultParameterValue(null)>] ?Name: string,
[<Optional; DefaultParameterValue(null)>] ?Visible: StyleParam.Visible,
[<Optional; DefaultParameterValue(null)>] ?ShowLegend: bool,
[<Optional; DefaultParameterValue(null)>] ?LegendRank: int,
[<Optional; DefaultParameterValue(null)>] ?LegendGroup: string,
[<Optional; DefaultParameterValue(null)>] ?LegendGroupTitle: Title
) =
fun (ch: GenericChart) ->
ch
|> mapiTrace (fun i trace ->
let naming i name =
name |> Option.map (fun v -> if i = 0 then v else sprintf "%s_%i" v i)
trace
|> TraceStyle.TraceInfo(
?Name = (naming i Name),
?Visible = Visible,
?ShowLegend = ShowLegend,
?LegendRank = LegendRank,
?LegendGroup = LegendGroup,
?LegendGroupTitle = LegendGroupTitle
))
/// <summary>
/// Sets the axis anchor ids for the chart's cartesian and/or carpet trace(s).
///
/// If the traces are not of these types, nothing will be set and a warning message will be displayed.
/// </summary>
/// <param name="X">The new x axis anchor id for the chart's cartesian and/or carpet trace(s)</param>
/// <param name="Y">The new x axis anchor id for the chart's cartesian and/or carpet trace(s)</param>
[<CompiledName("WithAxisAnchor")>]
static member withAxisAnchor
(
[<Optional; DefaultParameterValue(null)>] ?X,
[<Optional; DefaultParameterValue(null)>] ?Y
) =
let idx =
X |> Option.map StyleParam.LinearAxisId.X
let idy =
Y |> Option.map StyleParam.LinearAxisId.Y
fun (ch: GenericChart) ->
ch
|> mapTrace (fun trace ->
match trace with
| :? Trace2D as trace -> trace |> Trace2DStyle.SetAxisAnchor(?X = idx, ?Y = idy) :> Trace
| :? TraceCarpet as trace when trace.``type`` = "carpet" ->
trace |> TraceCarpetStyle.SetAxisAnchor(?X = idx, ?Y = idy) :> Trace
| _ ->
printfn "the input was not a 2D cartesian or carpet trace. no axis anchors set."
trace)
/// <summary>
/// Sets the color axis id for the chart's trace(s).
/// </summary>
/// <param name="id">The new color axis id for the chart's trace(s)</param>
[<CompiledName("WithColorAxisAnchor")>]
static member withColorAxisAnchor(id: int) =
fun (ch: GenericChart) -> ch |> mapTrace (Trace.setColorAxisAnchor id)
/// <summary>
/// Sets the marker for the chart's trace(s).
/// </summary>
/// <param name="marker">The new marker for the chart's trace(s)</param>
/// <param name="Combine">Wether or not to combine the objects if there is already a marker (default is false)</param>
[<CompiledName("SetMarker")>]
static member setMarker(marker: Marker, ?Combine: bool) =
let combine = defaultArg Combine false
(fun (ch: GenericChart) ->
if combine then
ch |> GenericChart.mapTrace (Trace.updateMarker marker)
else
ch |> GenericChart.mapTrace (Trace.setMarker marker))
/// <summary>
/// Sets the marker for the chart's trace(s).
///
/// If there is already a marker set, the objects are combined.
/// </summary>
/// <param name="marker">The new marker for the chart's trace(s)</param>
[<CompiledName("WithMarker")>]
static member withMarker(marker: Marker) =
(fun (ch: GenericChart) -> ch |> Chart.setMarker (marker, true))
/// <summary>
/// Applies the given styles to the marker object(s) of the chart's trace(s). Overwrites attributes with the same name that are already set.
/// </summary>
/// <param name="Angle">Sets the marker angle in respect to `angleref`.</param>
/// <param name="AngleRef">Sets the reference for marker angle. With "previous", angle 0 points along the line from the previous point to this one. With "up", angle 0 points toward the top of the screen.</param>
/// <param name="AutoColorScale">Determines whether the colorscale is a default palette (`autocolorscale: true`) or the palette determined by `marker.colorscale`. Has an effect only if in `marker.color`is set to a numerical array. In case `colorscale` is unspecified or `autocolorscale` is true, the default palette will be chosen according to whether numbers in the `color` array are all positive, all negative or mixed.</param>
/// <param name="CAuto">Determines whether or not the color domain is computed with respect to the input data (here in `marker.color`) or the bounds set in `marker.cmin` and `marker.cmax` Has an effect only if in `marker.color`is set to a numerical array. Defaults to `false` when `marker.cmin` and `marker.cmax` are set by the user.</param>
/// <param name="CMax">Sets the upper bound of the color domain. Has an effect only if in `marker.color`is set to a numerical array. Value should have the same units as in `marker.color` and if set, `marker.cmin` must be set as well.</param>
/// <param name="CMid">Sets the mid-point of the color domain by scaling `marker.cmin` and/or `marker.cmax` to be equidistant to this point. Has an effect only if in `marker.color`is set to a numerical array. Value should have the same units as in `marker.color`. Has no effect when `marker.cauto` is `false`.</param>
/// <param name="CMin">Sets the lower bound of the color domain. Has an effect only if in `marker.color`is set to a numerical array. Value should have the same units as in `marker.color` and if set, `marker.cmax` must be set as well.</param>
/// <param name="Color">Sets the marker color. It accepts either a specific color or an array of numbers that are mapped to the colorscale relative to the max and min values of the array or relative to `marker.cmin` and `marker.cmax` if set.</param>
/// <param name="Colors">Sets the color of each sector. If not specified, the default trace color set is used to pick the sector colors.</param>
/// <param name="ColorAxis">Sets a reference to a shared color axis. References to these shared color axes are "coloraxis", "coloraxis2", "coloraxis3", etc. Settings for these shared color axes are set in the layout, under `layout.coloraxis`, `layout.coloraxis2`, etc. Note that multiple color scales can be linked to the same color axis.</param>
/// <param name="ColorBar">Sets the marker's color bar.</param>
/// <param name="Colorscale"></param>
/// <param name="Gradient">Sets the marker's gradient</param>
/// <param name="Outline">Sets the marker's outline.</param>
/// <param name="Opacity">Sets the marker opacity.</param>
/// <param name="MaxDisplayed">Sets a maximum number of points to be drawn on the graph. "0" corresponds to no limit.</param>
/// <param name="MultiOpacity">Sets the individual marker opacity.</param>
/// <param name="Pattern">Sets the pattern within the marker.</param>
/// <param name="ReverseScale">Reverses the color mapping if true. Has an effect only if in `marker.color`is set to a numerical array. If true, `marker.cmin` will correspond to the last color in the array and `marker.cmax` will correspond to the first color.</param>
/// <param name="ShowScale">Determines whether or not a colorbar is displayed for this trace. Has an effect only if in `marker.color`is set to a numerical array.</param>
/// <param name="Size">Sets the marker's size.</param>
/// <param name="MultiSize">Sets the individual marker's size.</param>
/// <param name="SizeMin">Has an effect only if `marker.size` is set to a numerical array. Sets the minimum size (in px) of the rendered marker points.</param>
/// <param name="SizeMode">Has an effect only if `marker.size` is set to a numerical array. Sets the rule for which the data in `size` is converted to pixels.</param>
/// <param name="SizeRef">Has an effect only if `marker.size` is set to a numerical array. Sets the scale factor used to determine the rendered size of marker points. Use with `sizemin` and `sizemode`.</param>
/// <param name="StandOff">Moves the marker away from the data point in the direction of `angle` (in px). This can be useful for example if you have another marker at this location and you want to point an arrowhead marker at it.</param>
/// <param name="MultiStandOff">Moves the marker away from the data point in the direction of `angle` (in px). This can be useful for example if you have another marker at this location and you want to point an arrowhead marker at it.</param>
/// <param name="Symbol">Sets the marker symbol.</param>
/// <param name="MultiSymbol">Sets the individual marker symbols.</param>
/// <param name="Symbol3D">Sets the marker symbol for 3d traces.</param>
/// <param name="MultiSymbol3D">Sets the individual marker symbols for 3d traces.</param>
/// <param name="OutlierColor">Sets the color of the outlier sample points.</param>
/// <param name="OutlierWidth">Sets the width of the outlier sample points.</param>
[<CompiledName("WithMarkerStyle")>]
static member withMarkerStyle
(
[<Optional; DefaultParameterValue(null)>] ?Angle: float,
[<Optional; DefaultParameterValue(null)>] ?AngleRef: StyleParam.AngleRef,
[<Optional; DefaultParameterValue(null)>] ?AutoColorScale: bool,
[<Optional; DefaultParameterValue(null)>] ?CAuto: bool,
[<Optional; DefaultParameterValue(null)>] ?CMax: float,
[<Optional; DefaultParameterValue(null)>] ?CMid: float,
[<Optional; DefaultParameterValue(null)>] ?CMin: float,
[<Optional; DefaultParameterValue(null)>] ?Color: Color,
[<Optional; DefaultParameterValue(null)>] ?Colors: seq<Color>,
[<Optional; DefaultParameterValue(null)>] ?ColorAxis: StyleParam.SubPlotId,
[<Optional; DefaultParameterValue(null)>] ?ColorBar: ColorBar,
[<Optional; DefaultParameterValue(null)>] ?Colorscale: StyleParam.Colorscale,
[<Optional; DefaultParameterValue(null)>] ?Gradient: Gradient,
[<Optional; DefaultParameterValue(null)>] ?Outline: Line,
[<Optional; DefaultParameterValue(null)>] ?MaxDisplayed: int,
[<Optional; DefaultParameterValue(null)>] ?Opacity: float,
[<Optional; DefaultParameterValue(null)>] ?MultiOpacity: seq<float>,
[<Optional; DefaultParameterValue(null)>] ?Pattern: Pattern,
[<Optional; DefaultParameterValue(null)>] ?ReverseScale: bool,
[<Optional; DefaultParameterValue(null)>] ?ShowScale: bool,
[<Optional; DefaultParameterValue(null)>] ?Size: int,
[<Optional; DefaultParameterValue(null)>] ?MultiSize: seq<int>,
[<Optional; DefaultParameterValue(null)>] ?SizeMin: int,
[<Optional; DefaultParameterValue(null)>] ?SizeMode: StyleParam.MarkerSizeMode,
[<Optional; DefaultParameterValue(null)>] ?SizeRef: int,
[<Optional; DefaultParameterValue(null)>] ?StandOff: float,
[<Optional; DefaultParameterValue(null)>] ?MultiStandOff: seq<float>,
[<Optional; DefaultParameterValue(null)>] ?Symbol: StyleParam.MarkerSymbol,
[<Optional; DefaultParameterValue(null)>] ?MultiSymbol: seq<StyleParam.MarkerSymbol>,
[<Optional; DefaultParameterValue(null)>] ?Symbol3D: StyleParam.MarkerSymbol3D,
[<Optional; DefaultParameterValue(null)>] ?MultiSymbol3D: seq<StyleParam.MarkerSymbol3D>,
[<Optional; DefaultParameterValue(null)>] ?OutlierColor: Color,
[<Optional; DefaultParameterValue(null)>] ?OutlierWidth: int
) =
fun (ch: GenericChart) ->
ch
|> mapTrace (
TraceStyle.Marker(
?Angle=Angle,
?AngleRef=AngleRef,
?AutoColorScale = AutoColorScale,
?CAuto = CAuto,
?CMax = CMax,
?CMid = CMid,
?CMin = CMin,
?Color = Color,
?Colors = Colors,
?ColorAxis = ColorAxis,
?ColorBar = ColorBar,
?Colorscale = Colorscale,
?Gradient = Gradient,
?Outline = Outline,
?Size = Size,
?MultiSize = MultiSize,
?Opacity = Opacity,
?Pattern = Pattern,
?MultiOpacity = MultiOpacity,
?Symbol = Symbol,
?MultiSymbol = MultiSymbol,
?Symbol3D = Symbol3D,
?MultiSymbol3D = MultiSymbol3D,
?OutlierColor = OutlierColor,
?OutlierWidth = OutlierWidth,
?MaxDisplayed = MaxDisplayed,
?ReverseScale = ReverseScale,
?ShowScale = ShowScale,
?SizeMin = SizeMin,
?SizeMode = SizeMode,
?SizeRef = SizeRef,
?StandOff = StandOff,
?MultiStandOff = MultiStandOff
)
)
/// <summary>
/// Sets the line for the chart's trace(s).
/// </summary>
/// <param name="line">The new Line for the chart's trace(s)</param>
/// <param name="Combine">Wether or not to combine the objects if there is already a Line (default is false)</param>
[<CompiledName("SetLine")>]
static member setLine(line: Line, ?Combine: bool) =
let combine = defaultArg Combine false
(fun (ch: GenericChart) ->
if combine then
ch |> GenericChart.mapTrace (Trace.updateLine line)
else
ch |> GenericChart.mapTrace (Trace.setLine line))
/// <summary>
/// Sets the line for the chart's trace(s).
///
/// If there is already a Line set, the objects are combined.
/// </summary>
/// <param name="line">The new line for the chart's trace(s)</param>
[<CompiledName("WithLine")>]
static member withLine(line: Line) =
(fun (ch: GenericChart) -> ch |> Chart.setLine (line, true))
/// <summary>
/// Applies the given styles to the line object(s) of the chart's trace(s). Overwrites attributes with the same name that are already set.
/// </summary>
/// <param name="BackOff">Sets the line back off from the end point of the nth line segment (in px). This option is useful e.g. to avoid overlap with arrowhead markers. With "auto" the lines would trim before markers if `marker.angleref` is set to "previous".</param>
/// <param name="AutoColorScale">Determines whether the colorscale is a default palette (`autocolorscale: true`) or the palette determined by `line.colorscale`. Has an effect only if in `line.color`is set to a numerical array. In case `colorscale` is unspecified or `autocolorscale` is true, the default palette will be chosen according to whether numbers in the `color` array are all positive, all negative or mixed.</param>
/// <param name="CAuto">Determines whether or not the color domain is computed with respect to the input data (here in `line.color`) or the bounds set in `line.cmin` and `line.cmax` Has an effect only if in `line.color`is set to a numerical array. Defaults to `false` when `line.cmin` and `line.cmax` are set by the user.</param>
/// <param name="CMax">Sets the upper bound of the color domain. Has an effect only if in `line.color`is set to a numerical array. Value should have the same units as in `line.color` and if set, `line.cmin` must be set as well.</param>
/// <param name="CMid">Sets the mid-point of the color domain by scaling `line.cmin` and/or `line.cmax` to be equidistant to this point. Has an effect only if in `line.color`is set to a numerical array. Value should have the same units as in `line.color`. Has no effect when `line.cauto` is `false`.</param>
/// <param name="CMin">Sets the lower bound of the color domain. Has an effect only if in `line.color`is set to a numerical array. Value should have the same units as in `line.color` and if set, `line.cmax` must be set as well.</param>
/// <param name="Color">Sets the line color.</param>
/// <param name="ColorAxis">Sets a reference to a shared color axis. References to these shared color axes are "coloraxis", "coloraxis2", "coloraxis3", etc. Settings for these shared color axes are set in the layout, under `layout.coloraxis`, `layout.coloraxis2`, etc. Note that multiple color scales can be linked to the same color axis.</param>
/// <param name="Colorscale">Sets the line colorscale</param>
/// <param name="ReverseScale">Reverses the color mapping if true.</param>
/// <param name="ShowScale">Wether or not to show the color bar</param>
/// <param name="ColorBar">Sets the colorbar.</param>
/// <param name="Dash">Sets the dash style of lines. Set to a dash type string ("solid", "dot", "dash", "longdash", "dashdot", or "longdashdot") or a dash length list in px (eg "5px,10px,2px,2px").</param>
/// <param name="Shape">Determines the line shape. With "spline" the lines are drawn using spline interpolation. The other available values correspond to step-wise line shapes.</param>
/// <param name="Simplify">Simplifies lines by removing nearly-collinear points. When transitioning lines, it may be desirable to disable this so that the number of points along the resulting SVG path is unaffected.</param>
/// <param name="Smoothing">Has an effect only if `shape` is set to "spline" Sets the amount of smoothing. "0" corresponds to no smoothing (equivalent to a "linear" shape).</param>
/// <param name="Width">Sets the line width (in px).</param>
/// <param name="MultiWidth">Sets the individual line width (in px).</param>
/// <param name="OutlierColor">Sets the color of the outline of outliers</param>
/// <param name="OutlierWidth">Sets the width of the outline of outliers</param>
[<CompiledName("WithLineStyle")>]
static member withLineStyle
(
[<Optional; DefaultParameterValue(null)>] ?BackOff: StyleParam.BackOff,
[<Optional; DefaultParameterValue(null)>] ?AutoColorScale: bool,
[<Optional; DefaultParameterValue(null)>] ?CAuto: bool,
[<Optional; DefaultParameterValue(null)>] ?CMax: float,
[<Optional; DefaultParameterValue(null)>] ?CMid: float,
[<Optional; DefaultParameterValue(null)>] ?CMin: float,
[<Optional; DefaultParameterValue(null)>] ?Color: Color,
[<Optional; DefaultParameterValue(null)>] ?ColorAxis: StyleParam.SubPlotId,
[<Optional; DefaultParameterValue(null)>] ?Colorscale: StyleParam.Colorscale,
[<Optional; DefaultParameterValue(null)>] ?ReverseScale: bool,
[<Optional; DefaultParameterValue(null)>] ?ShowScale: bool,
[<Optional; DefaultParameterValue(null)>] ?ColorBar: ColorBar,
[<Optional; DefaultParameterValue(null)>] ?Dash: StyleParam.DrawingStyle,
[<Optional; DefaultParameterValue(null)>] ?Shape: StyleParam.Shape,
[<Optional; DefaultParameterValue(null)>] ?Simplify: bool,
[<Optional; DefaultParameterValue(null)>] ?Smoothing: float,
[<Optional; DefaultParameterValue(null)>] ?Width: float,
[<Optional; DefaultParameterValue(null)>] ?MultiWidth: seq<float>,
[<Optional; DefaultParameterValue(null)>] ?OutlierColor: Color,
[<Optional; DefaultParameterValue(null)>] ?OutlierWidth: float
) =
fun (ch: GenericChart) ->
ch
|> mapTrace (
TraceStyle.Line(
?BackOff = BackOff,
?AutoColorScale = AutoColorScale,
?CAuto = CAuto,
?CMax = CMax,
?CMid = CMid,
?CMin = CMin,
?Color = Color,
?ColorAxis = ColorAxis,
?Colorscale = Colorscale,
?ReverseScale = ReverseScale,
?ShowScale = ShowScale,
?ColorBar = ColorBar,
?Dash = Dash,
?Shape = Shape,
?Simplify = Simplify,
?Smoothing = Smoothing,
?Width = Width,
?MultiWidth = MultiWidth,
?OutlierColor = OutlierColor,
?OutlierWidth = OutlierWidth
)
)
/// <summary>
/// Sets the error for the x dimension for the chart's trace(s).
/// </summary>
/// <param name="xError">The new Error in the x dimension for the chart's trace(s)</param>
/// <param name="Combine">Wether or not to combine the objects if there is already an Error object set (default is false)</param>
[<CompiledName("SetXError")>]
static member setXError(xError: Error, ?Combine: bool) =
let combine = defaultArg Combine false
(fun (ch: GenericChart) ->
if combine then
ch |> GenericChart.mapTrace (Trace.updateXError xError)
else
ch |> GenericChart.mapTrace (Trace.setXError xError))
/// <summary>
/// Sets the error in the x dimension for the chart's trace(s).
///
/// If there is already an error set, the objects are combined.
/// </summary>
/// <param name="xError">The new error for the chart's trace(s)</param>
[<CompiledName("WithXError")>]
static member withXError(xError: Error) =
(fun (ch: GenericChart) -> ch |> Chart.setXError (xError, true))
/// <summary>
/// Applies the given styles to the error object(s) in the x dimension of the chart's trace(s). Overwrites attributes with the same name that are already set.
/// </summary>
/// <param name ="Visible">Determines whether or not this set of error bars is visible.</param>
/// <param name ="Type">Determines the rule used to generate the error bars. If "constant`, the bar lengths are of a constant value. Set this constant in `value`. If "percent", the bar lengths correspond to a percentage of underlying data. Set this percentage in `value`. If "sqrt", the bar lengths correspond to the square of the underlying data. If "data", the bar lengths are set with data set `array`.</param>
/// <param name ="Symmetric">Determines whether or not the error bars have the same length in both direction (top/bottom for vertical bars, left/right for horizontal bars.</param>
/// <param name ="Array">Sets the data corresponding the length of each error bar. Values are plotted relative to the underlying data.</param>
/// <param name ="Arrayminus">Sets the data corresponding the length of each error bar in the bottom (left) direction for vertical (horizontal) bars Values are plotted relative to the underlying data.</param>
/// <param name ="Value">Sets the value of either the percentage (if `type` is set to "percent") or the constant (if `type` is set to "constant") corresponding to the lengths of the error bars.</param>
/// <param name ="Valueminus">Sets the value of either the percentage (if `type` is set to "percent") or the constant (if `type` is set to "constant") corresponding to the lengths of the error bars in the bottom (left) direction for vertical (horizontal) bars</param>
/// <param name ="Traceref"></param>
/// <param name ="Tracerefminus"></param>
/// <param name ="Copy_ystyle"></param>
/// <param name ="Color">Sets the stoke color of the error bars.</param>
/// <param name ="Thickness">Sets the thickness (in px) of the error bars.</param>
/// <param name ="Width">Sets the width (in px) of the cross-bar at both ends of the error bars.</param>
[<CompiledName("WithXErrorStyle")>]
static member withXErrorStyle
(
[<Optional; DefaultParameterValue(null)>] ?Visible: bool,
[<Optional; DefaultParameterValue(null)>] ?Type: StyleParam.ErrorType,
[<Optional; DefaultParameterValue(null)>] ?Symmetric: bool,
[<Optional; DefaultParameterValue(null)>] ?Array: seq<#IConvertible>,
[<Optional; DefaultParameterValue(null)>] ?Arrayminus: seq<#IConvertible>,
[<Optional; DefaultParameterValue(null)>] ?Value: float,
[<Optional; DefaultParameterValue(null)>] ?Valueminus: float,
[<Optional; DefaultParameterValue(null)>] ?Traceref: int,
[<Optional; DefaultParameterValue(null)>] ?Tracerefminus: int,
[<Optional; DefaultParameterValue(null)>] ?Copy_ystyle: bool,
[<Optional; DefaultParameterValue(null)>] ?Color: Color,
[<Optional; DefaultParameterValue(null)>] ?Thickness: float,
[<Optional; DefaultParameterValue(null)>] ?Width: float
) =
fun (ch: GenericChart) ->
ch
|> mapTrace (
TraceStyle.XError(
?Visible = Visible,
?Type = Type,
?Symmetric = Symmetric,
?Array = Array,
?Arrayminus = Arrayminus,
?Value = Value,
?Valueminus = Valueminus,
?Traceref = Traceref,
?Tracerefminus = Tracerefminus,
?Copy_ystyle = Copy_ystyle,
?Color = Color,
?Thickness = Thickness,
?Width = Width
)
)
/// <summary>
/// Sets the error for the y dimension for the chart's trace(s).
/// </summary>
/// <param name="yError">The new Error in the x dimension for the chart's trace(s)</param>
/// <param name="Combine">Wether or not to combine the objects if there is already an Error object set (default is false)</param>
[<CompiledName("SetYError")>]
static member setYError(yError: Error, ?Combine: bool) =
let combine = defaultArg Combine false
(fun (ch: GenericChart) ->
if combine then
ch |> GenericChart.mapTrace (Trace.updateYError yError)
else
ch |> GenericChart.mapTrace (Trace.setYError yError))
/// <summary>
/// Sets the error in the y dimension for the chart's trace(s).
///
/// If there is already an error set, the objects are combined.
/// </summary>
/// <param name="yError">The new error for the chart's trace(s)</param>
[<CompiledName("WithYError")>]
static member withYError(yError: Error) =
(fun (ch: GenericChart) -> ch |> Chart.setYError (yError, true))
/// <summary>
/// Applies the given styles to the error object(s) in the y dimension of the chart's trace(s). Overwrites attributes with the same name that are already set.
/// </summary>
/// <param name ="Visible">Determines whether or not this set of error bars is visible.</param>
/// <param name ="Type">Determines the rule used to generate the error bars. If "constant`, the bar lengths are of a constant value. Set this constant in `value`. If "percent", the bar lengths correspond to a percentage of underlying data. Set this percentage in `value`. If "sqrt", the bar lengths correspond to the square of the underlying data. If "data", the bar lengths are set with data set `array`.</param>
/// <param name ="Symmetric">Determines whether or not the error bars have the same length in both direction (top/bottom for vertical bars, left/right for horizontal bars.</param>
/// <param name ="Array">Sets the data corresponding the length of each error bar. Values are plotted relative to the underlying data.</param>
/// <param name ="Arrayminus">Sets the data corresponding the length of each error bar in the bottom (left) direction for vertical (horizontal) bars Values are plotted relative to the underlying data.</param>
/// <param name ="Value">Sets the value of either the percentage (if `type` is set to "percent") or the constant (if `type` is set to "constant") corresponding to the lengths of the error bars.</param>
/// <param name ="Valueminus">Sets the value of either the percentage (if `type` is set to "percent") or the constant (if `type` is set to "constant") corresponding to the lengths of the error bars in the bottom (left) direction for vertical (horizontal) bars</param>
/// <param name ="Traceref"></param>
/// <param name ="Tracerefminus"></param>
/// <param name ="Copy_ystyle"></param>
/// <param name ="Color">Sets the stoke color of the error bars.</param>
/// <param name ="Thickness">Sets the thickness (in px) of the error bars.</param>
/// <param name ="Width">Sets the width (in px) of the cross-bar at both ends of the error bars.</param>
[<CompiledName("WithYErrorStyle")>]
static member withYErrorStyle
(
[<Optional; DefaultParameterValue(null)>] ?Visible: bool,
[<Optional; DefaultParameterValue(null)>] ?Type: StyleParam.ErrorType,
[<Optional; DefaultParameterValue(null)>] ?Symmetric: bool,
[<Optional; DefaultParameterValue(null)>] ?Array: seq<#IConvertible>,
[<Optional; DefaultParameterValue(null)>] ?Arrayminus: seq<#IConvertible>,
[<Optional; DefaultParameterValue(null)>] ?Value: float,
[<Optional; DefaultParameterValue(null)>] ?Valueminus: float,
[<Optional; DefaultParameterValue(null)>] ?Traceref: int,
[<Optional; DefaultParameterValue(null)>] ?Tracerefminus: int,
[<Optional; DefaultParameterValue(null)>] ?Copy_ystyle: bool,
[<Optional; DefaultParameterValue(null)>] ?Color: Color,
[<Optional; DefaultParameterValue(null)>] ?Thickness: float,
[<Optional; DefaultParameterValue(null)>] ?Width: float
) =
fun (ch: GenericChart) ->
ch
|> mapTrace (
TraceStyle.YError(
?Visible = Visible,
?Type = Type,
?Symmetric = Symmetric,
?Array = Array,
?Arrayminus = Arrayminus,
?Value = Value,
?Valueminus = Valueminus,
?Traceref = Traceref,
?Tracerefminus = Tracerefminus,
?Copy_ystyle = Copy_ystyle,
?Color = Color,
?Thickness = Thickness,
?Width = Width
)
)
/// <summary>
/// Sets the error for the z dimension for the chart's trace(s).
/// </summary>
/// <param name="zError">The new Error in the x dimension for the chart's trace(s)</param>
/// <param name="Combine">Wether or not to combine the objects if there is already an Error object set (default is false)</param>
[<CompiledName("SetZError")>]
static member setZError(zError: Error, ?Combine: bool) =
let combine = defaultArg Combine false
(fun (ch: GenericChart) ->
if combine then
ch |> GenericChart.mapTrace (Trace.updateZError zError)
else
ch |> GenericChart.mapTrace (Trace.setZError zError))
/// <summary>
/// Sets the error in the z dimension for the chart's trace(s).
///
/// If there is already an error set, the objects are combined.
/// </summary>
/// <param name="zError">The new error for the chart's trace(s)</param>
[<CompiledName("WithZError")>]
static member withZError(zError: Error) =
(fun (ch: GenericChart) -> ch |> Chart.setZError (zError, true))
/// <summary>
/// Applies the given styles to the error object(s) in the z dimension of the chart's trace(s). Overwrites attributes with the same name that are already set.
/// </summary>
/// <param name ="Visible">Determines whether or not this set of error bars is visible.</param>
/// <param name ="Type">Determines the rule used to generate the error bars. If "constant`, the bar lengths are of a constant value. Set this constant in `value`. If "percent", the bar lengths correspond to a percentage of underlying data. Set this percentage in `value`. If "sqrt", the bar lengths correspond to the square of the underlying data. If "data", the bar lengths are set with data set `array`.</param>
/// <param name ="Symmetric">Determines whether or not the error bars have the same length in both direction (top/bottom for vertical bars, left/right for horizontal bars.</param>
/// <param name ="Array">Sets the data corresponding the length of each error bar. Values are plotted relative to the underlying data.</param>
/// <param name ="Arrayminus">Sets the data corresponding the length of each error bar in the bottom (left) direction for vertical (horizontal) bars Values are plotted relative to the underlying data.</param>
/// <param name ="Value">Sets the value of either the percentage (if `type` is set to "percent") or the constant (if `type` is set to "constant") corresponding to the lengths of the error bars.</param>
/// <param name ="Valueminus">Sets the value of either the percentage (if `type` is set to "percent") or the constant (if `type` is set to "constant") corresponding to the lengths of the error bars in the bottom (left) direction for vertical (horizontal) bars</param>
/// <param name ="Traceref"></param>
/// <param name ="Tracerefminus"></param>
/// <param name ="Copy_ystyle"></param>
/// <param name ="Color">Sets the stoke color of the error bars.</param>
/// <param name ="Thickness">Sets the thickness (in px) of the error bars.</param>
/// <param name ="Width">Sets the width (in px) of the cross-bar at both ends of the error bars.</param>
[<CompiledName("WithZErrorStyle")>]
static member withZErrorStyle
(
[<Optional; DefaultParameterValue(null)>] ?Visible: bool,
[<Optional; DefaultParameterValue(null)>] ?Type: StyleParam.ErrorType,
[<Optional; DefaultParameterValue(null)>] ?Symmetric: bool,
[<Optional; DefaultParameterValue(null)>] ?Array: seq<#IConvertible>,
[<Optional; DefaultParameterValue(null)>] ?Arrayminus: seq<#IConvertible>,
[<Optional; DefaultParameterValue(null)>] ?Value: float,
[<Optional; DefaultParameterValue(null)>] ?Valueminus: float,
[<Optional; DefaultParameterValue(null)>] ?Traceref: int,
[<Optional; DefaultParameterValue(null)>] ?Tracerefminus: int,
[<Optional; DefaultParameterValue(null)>] ?Copy_ystyle: bool,
[<Optional; DefaultParameterValue(null)>] ?Color: Color,
[<Optional; DefaultParameterValue(null)>] ?Thickness: float,
[<Optional; DefaultParameterValue(null)>] ?Width: float
) =
fun (ch: GenericChart) ->
ch
|> mapTrace (
TraceStyle.ZError(
?Visible = Visible,
?Type = Type,
?Symmetric = Symmetric,
?Array = Array,
?Arrayminus = Arrayminus,
?Value = Value,
?Valueminus = Valueminus,
?Traceref = Traceref,
?Tracerefminus = Tracerefminus,
?Copy_ystyle = Copy_ystyle,
?Color = Color,
?Thickness = Thickness,
?Width = Width
)
)
/// <summary>
/// Sets the ColorBar for the chart's trace(s).
/// </summary>
/// <param name="colorBar">The new ColorBar for the chart's trace(s)</param>
/// <param name="Combine">Wether or not to combine the objects if there is already a ColorBar object set (default is false)</param>
[<CompiledName("SetColorBar")>]
static member setColorBar(colorBar: ColorBar, ?Combine: bool) =
let combine = defaultArg Combine false
(fun (ch: GenericChart) ->
if combine then
ch |> GenericChart.mapTrace (Trace.updateColorBar colorBar)
else
ch |> GenericChart.mapTrace (Trace.setColorBar colorBar))
/// <summary>
/// Sets the ColorBar for the chart's trace(s).
///
/// If there is already a ColorBar set, the objects are combined.
/// </summary>
/// <param name="colorbar">The new ColorBar for the chart's trace(s)</param>
[<CompiledName("WithColorBar")>]
static member withColorBar(colorbar: ColorBar) =
(fun (ch: GenericChart) -> ch |> Chart.setColorBar (colorbar, true))
/// <summary>
/// Applies the given styles to the ColorBar object(s) of the chart's trace(s). Overwrites attributes with the same name that are already set.
/// </summary>
/// <param name="TitleText">Sets the text of the colorbar title.</param>
/// <param name="TitleFont">Sets the font of the colorbar title.</param>
/// <param name="TitleStandoff">Sets the standoff distance (in px) between the colorbar labels and the title text.</param>
/// <param name="Title">Sets the Title (use this for more finegrained control than the other title-associated arguments)</param>
/// <param name="Len">Sets the length of the color bar This measure excludes the padding of both ends. That is, the color bar length is this length minus the padding on both ends.</param>
/// <param name="LenMode">Determines whether this color bar's length (i.e. the measure in the color variation direction) is set in units of plot "fraction" or in "pixels. Use `len` to set the value.</param>
/// <param name="BGColor">Sets the color of padded area.</param>
/// <param name="BorderColor">Sets the axis line color.</param>
/// <param name="OutlineColor">Sets the axis line color.</param>
/// <param name="X">Sets the x position of the color bar (in plot fraction).</param>
/// <param name="XAnchor">Sets this color bar's horizontal position anchor. This anchor binds the `x` position to the "left", "center" or "right" of the color bar.</param>
/// <param name="XPad">Sets the amount of padding (in px) along the x direction.</param>
/// <param name="Y">Sets the y position of the color bar (in plot fraction).</param>
/// <param name="YAnchor">Sets this color bar's vertical position anchor This anchor binds the `y` position to the "top", "middle" or "bottom" of the color bar.</param>
/// <param name="YPad">Sets the amount of padding (in px) along the y direction.</param>
[<CompiledName("WithColorbarStyle")>]
static member withColorBarStyle
(
[<Optional; DefaultParameterValue(null)>] ?TitleText: string,
[<Optional; DefaultParameterValue(null)>] ?TitleFont: Font,
[<Optional; DefaultParameterValue(null)>] ?TitleStandoff: int,
[<Optional; DefaultParameterValue(null)>] ?Title: Title,
[<Optional; DefaultParameterValue(null)>] ?Len: float,
[<Optional; DefaultParameterValue(null)>] ?LenMode: StyleParam.UnitMode,
[<Optional; DefaultParameterValue(null)>] ?BGColor: Color,
[<Optional; DefaultParameterValue(null)>] ?BorderColor: Color,
[<Optional; DefaultParameterValue(null)>] ?OutlineColor: Color,
[<Optional; DefaultParameterValue(null)>] ?X: float,
[<Optional; DefaultParameterValue(null)>] ?XAnchor: StyleParam.HorizontalAlign,
[<Optional; DefaultParameterValue(null)>] ?XPad: float,
[<Optional; DefaultParameterValue(null)>] ?Y: float,
[<Optional; DefaultParameterValue(null)>] ?YAnchor: StyleParam.VerticalAlign,
[<Optional; DefaultParameterValue(null)>] ?YPad: float
) =
let title =
Title
|> Option.defaultValue (Plotly.NET.Title())
|> Plotly.NET.Title.style (?Text = TitleText, ?Font = TitleFont, ?Standoff = TitleStandoff)
let colorbar =
ColorBar.init (
Title = title,
?Len = Len,
?LenMode = LenMode,
?BGColor = BGColor,
?BorderColor = BorderColor,
?OutlineColor = OutlineColor,
?X = X,
?XAnchor = XAnchor,
?XPad = XPad,
?Y = Y,
?YAnchor = YAnchor,
?YPad = YPad
)
Chart.withColorBar (colorbar)
//==============================================================================================================
//======================================= General Layout object styling ========================================
//==============================================================================================================
// <summary>
/// Sets the given layout on the input chart.
///
/// If there is already an layout set, the object is replaced.
/// </summary>
[<CompiledName("SetLayout")>]
static member setLayout(layout: Layout) =
(fun (ch: GenericChart) -> GenericChart.setLayout layout ch)
/// <summary>
/// Sets the given layout on the input chart.
///
/// If there is already an layout set, the objects are combined.
/// </summary>
[<CompiledName("WithLayout")>]
static member withLayout(layout: Layout) =
(fun (ch: GenericChart) -> GenericChart.addLayout layout ch)
/// <summary>
/// Applies the given styles to the chart's Layout object. Overwrites attributes with the same name that are already set.
/// </summary>
/// <param name="Title">Sets the title of the layout.</param>
/// <param name="ShowLegend">Determines whether or not a legend is drawn. Default is `true` if there is a trace to show and any of these: a) Two or more traces would by default be shown in the legend. b) One pie trace is shown in the legend. c) One trace is explicitly given with `showlegend: true`.</param>
/// <param name="Legend">Sets the legend styles of the layout.</param>
/// <param name="Margin">Sets the margins around the layout.</param>
/// <param name="AutoSize">Determines whether or not a layout width or height that has been left undefined by the user is initialized on each relayout. Note that, regardless of this attribute, an undefined layout width or height is always initialized on the first call to plot.</param>
/// <param name="Width">Sets the plot's width (in px).</param>
/// <param name="Height">Sets the plot's height (in px).</param>
/// <param name="Font">Sets the global font. Note that fonts used in traces and other layout components inherit from the global font.</param>
/// <param name="UniformText">Determines how the font size for various text elements are uniformed between each trace type.</param>
/// <param name="Separators">Sets the decimal and thousand separators. For example, ". " puts a '.' before decimals and a space between thousands. In English locales, dflt is ".," but other locales may alter this default.</param>
/// <param name="PaperBGColor">Sets the background color of the paper where the graph is drawn.</param>
/// <param name="PlotBGColor">Sets the background color of the plotting area in-between x and y axes.</param>
/// <param name="AutoTypeNumbers">Using "strict" a numeric string in trace data is not converted to a number. Using "convert types" a numeric string in trace data may be treated as a number during automatic axis `type` detection. This is the default value; however it could be overridden for individual axes.</param>
/// <param name="Colorscale">Sets the default colorscales that are used by plots using autocolorscale.</param>
/// <param name="Colorway">Sets the default trace colors.</param>
/// <param name="ModeBar">Sets the modebar of the layout.</param>
/// <param name="HoverMode">Determines the mode of hover interactions. If "closest", a single hoverlabel will appear for the "closest" point within the `hoverdistance`. If "x" (or "y"), multiple hoverlabels will appear for multiple points at the "closest" x- (or y-) coordinate within the `hoverdistance`, with the caveat that no more than one hoverlabel will appear per trace. If "x unified" (or "y unified"), a single hoverlabel will appear multiple points at the closest x- (or y-) coordinate within the `hoverdistance` with the caveat that no more than one hoverlabel will appear per trace. In this mode, spikelines are enabled by default perpendicular to the specified axis. If false, hover interactions are disabled.</param>
/// <param name="ClickMode">Determines the mode of single click interactions. "event" is the default value and emits the `plotly_click` event. In addition this mode emits the `plotly_selected` event in drag modes "lasso" and "select", but with no event data attached (kept for compatibility reasons). The "select" flag enables selecting single data points via click. This mode also supports persistent selections, meaning that pressing Shift while clicking, adds to / subtracts from an existing selection. "select" with `hovermode`: "x" can be confusing, consider explicitly setting `hovermode`: "closest" when using this feature. Selection events are sent accordingly as long as "event" flag is set as well. When the "event" flag is missing, `plotly_click` and `plotly_selected` events are not fired.</param>
/// <param name="DragMode">Determines the mode of drag interactions. "select" and "lasso" apply only to scatter traces with markers or text. "orbit" and "turntable" apply only to 3D scenes.</param>
/// <param name="SelectDirection">When `dragmode` is set to "select", this limits the selection of the drag to horizontal, vertical or diagonal. "h" only allows horizontal selection, "v" only vertical, "d" only diagonal and "any" sets no limit.</param>
/// <param name="ActiveSelection">Sets the styling of the active selection</param>
/// <param name="NewSelection">Controls the behavior of newly drawn selections</param>
/// <param name="HoverDistance">Sets the default distance (in pixels) to look for data to add hover labels (-1 means no cutoff, 0 means no looking for data). This is only a real distance for hovering on point-like objects, like scatter points. For area-like objects (bars, scatter fills, etc) hovering is on inside the area and off outside, but these objects will not supersede hover on point-like objects in case of conflict.</param>
/// <param name="SpikeDistance">Sets the default distance (in pixels) to look for data to draw spikelines to (-1 means no cutoff, 0 means no looking for data). As with hoverdistance, distance does not apply to area-like objects. In addition, some objects can be hovered on but will not generate spikelines, such as scatter fills.</param>
/// <param name="Hoverlabel">Sets the style ov hover labels.</param>
/// <param name="Transition">Sets transition options used during Plotly.react updates.</param>
/// <param name="DataRevision">If provided, a changed value tells `Plotly.react` that one or more data arrays has changed. This way you can modify arrays in-place rather than making a complete new copy for an incremental change. If NOT provided, `Plotly.react` assumes that data arrays are being treated as immutable, thus any data array with a different identity from its predecessor contains new data.</param>
/// <param name="UIRevision">Used to allow user interactions with the plot to persist after `Plotly.react` calls that are unaware of these interactions. If `uirevision` is omitted, or if it is given and it changed from the previous `Plotly.react` call, the exact new figure is used. If `uirevision` is truthy and did NOT change, any attribute that has been affected by user interactions and did not receive a different value in the new figure will keep the interaction value. `layout.uirevision` attribute serves as the default for `uirevision` attributes in various sub-containers. For finer control you can set these sub-attributes directly. For example, if your app separately controls the data on the x and y axes you might set `xaxis.uirevision="time"` and `yaxis.uirevision="cost"`. Then if only the y data is changed, you can update `yaxis.uirevision="quantity"` and the y axis range will reset but the x axis range will retain any user-driven zoom.</param>
/// <param name="EditRevision">Controls persistence of user-driven changes in `editable: true` configuration, other than trace names and axis titles. Defaults to `layout.uirevision`.</param>
/// <param name="SelectRevision">Controls persistence of user-driven changes in `editable: true` configuration, other than trace names and axis titles. Defaults to `layout.uirevision`.</param>
/// <param name="Template">Default attributes to be applied to the plot. Templates can be created from existing plots using `Plotly.makeTemplate`, or created manually. They should be objects with format: `{layout: layoutTemplate, data: {[type]: [traceTemplate, ...]}, ...}` `layoutTemplate` and `traceTemplate` are objects matching the attribute structure of `layout` and a data trace. Trace templates are applied cyclically to traces of each type. Container arrays (eg `annotations`) have special handling: An object ending in `defaults` (eg `annotationdefaults`) is applied to each array item. But if an item has a `templateitemname` key we look in the template array for an item with matching `name` and apply that instead. If no matching `name` is found we mark the item invisible. Any named template item not referenced is appended to the end of the array, so you can use this for a watermark annotation or a logo image, for example. To omit one of these items on the plot, make an item with matching `templateitemname` and `visible: false`.</param>
/// <param name="Meta">Assigns extra meta information that can be used in various `text` attributes. Attributes such as the graph, axis and colorbar `title.text`, annotation `text` `trace.name` in legend items, `rangeselector`, `updatemenus` and `sliders` `label` text all support `meta`. One can access `meta` fields using template strings: `%{meta[i]}` where `i` is the index of the `meta` item in question. `meta` can also be an object for example `{key: value}` which can be accessed %{meta[key]}.</param>
/// <param name="Computed">Placeholder for exporting automargin-impacting values namely `margin.t`, `margin.b`, `margin.l` and `margin.r` in "full-json" mode.</param>
/// <param name="Grid">Sets the layout grid for arranging multiple plots</param>
/// <param name="Calendar">Sets the default calendar system to use for interpreting and displaying dates throughout the plot.</param>
/// <param name="MinReducedHeight">Minimum height of the plot with margin.automargin applied (in px)</param>
/// <param name="MinReducedWidth">Minimum width of the plot with margin.automargin applied (in px)</param>
/// <param name="NewShape">Controls the behavior of newly drawn shapes</param>
/// <param name="ActiveShape">Sets the styling of the active shape</param>
/// <param name="HideSources">Determines whether or not a text link citing the data source is placed at the bottom-right cored of the figure. Has only an effect only on graphs that have been generated via forked graphs from the Chart Studio Cloud (at https://chart-studio.plotly.com or on-premise).</param>
/// <param name="ScatterGap">Sets the gap (in plot fraction) between scatter points of adjacent location coordinates. Defaults to `bargap`.</param>
/// <param name="ScatterMode">Determines how scatter points at the same location coordinate are displayed on the graph. With "group", the scatter points are plotted next to one another centered around the shared location. With "overlay", the scatter points are plotted over one another, you might need to reduce "opacity" to see multiple scatter points.</param>
/// <param name="BarGap">Sets the gap (in plot fraction) between bars of adjacent location coordinates.</param>
/// <param name="BarGroupGap">Sets the gap (in plot fraction) between bars of adjacent location coordinates.</param>
/// <param name="BarMode">Determines how bars at the same location coordinate are displayed on the graph. With "stack", the bars are stacked on top of one another With "relative", the bars are stacked on top of one another, with negative values below the axis, positive values above With "group", the bars are plotted next to one another centered around the shared location. With "overlay", the bars are plotted over one another, you might need to an "opacity" to see multiple bars.</param>
/// <param name="BarNorm">Sets the normalization for bar traces on the graph. With "fraction", the value of each bar is divided by the sum of all values at that location coordinate. "percent" is the same but multiplied by 100 to show percentages.</param>
/// <param name="ExtendPieColors">If `true`, the pie slice colors (whether given by `piecolorway` or inherited from `colorway`) will be extended to three times its original length by first repeating every color 20% lighter then each color 20% darker. This is intended to reduce the likelihood of reusing the same color when you have many slices, but you can set `false` to disable. Colors provided in the trace, using `marker.colors`, are never extended.</param>
/// <param name="HiddenLabels">If `true`, the pie slice colors (whether given by `piecolorway` or inherited from `colorway`) will be extended to three times its original length by first repeating every color 20% lighter then each color 20% darker. This is intended to reduce the likelihood of reusing the same color when you have many slices, but you can set `false` to disable. Colors provided in the trace, using `marker.colors`, are never extended.</param>
/// <param name="PieColorWay">Sets the default pie slice colors. Defaults to the main `colorway` used for trace colors. If you specify a new list here it can still be extended with lighter and darker colors, see `extendpiecolors`.</param>
/// <param name="BoxGap">Sets the gap (in plot fraction) between boxes of adjacent location coordinates. Has no effect on traces that have "width" set.</param>
/// <param name="BoxGroupGap">Sets the gap (in plot fraction) between boxes of the same location coordinate. Has no effect on traces that have "width" set.</param>
/// <param name="BoxMode">Sets the gap (in plot fraction) between boxes of the same location coordinate. Has no effect on traces that have "width" set.</param>
/// <param name="ViolinGap">Sets the gap (in plot fraction) between boxes of the same location coordinate. Has no effect on traces that have "width" set.</param>
/// <param name="ViolinGroupGap">Sets the gap (in plot fraction) between violins of the same location coordinate. Has no effect on traces that have "width" set.</param>
/// <param name="ViolinMode">Determines how violins at the same location coordinate are displayed on the graph. If "group", the violins are plotted next to one another centered around the shared location. If "overlay", the violins are plotted over one another, you might need to set "opacity" to see them multiple violins. Has no effect on traces that have "width" set.</param>
/// <param name="WaterfallGap">Sets the gap (in plot fraction) between bars of adjacent location coordinates.</param>
/// <param name="WaterfallGroupGap">Sets the gap (in plot fraction) between bars of the same location coordinate.</param>
/// <param name="WaterfallMode">Determines how bars at the same location coordinate are displayed on the graph. With "group", the bars are plotted next to one another centered around the shared location. With "overlay", the bars are plotted over one another, you might need to an "opacity" to see multiple bars.</param>
/// <param name="FunnelGap">Sets the gap (in plot fraction) between bars of adjacent location coordinates.</param>
/// <param name="FunnelGroupGap">Sets the gap (in plot fraction) between bars of adjacent location coordinates.</param>
/// <param name="FunnelMode">Determines how bars at the same location coordinate are displayed on the graph. With "stack", the bars are stacked on top of one another With "group", the bars are plotted next to one another centered around the shared location. With "overlay", the bars are plotted over one another, you might need to an "opacity" to see multiple bars.</param>
/// <param name="ExtendFunnelAreaColors">If `true`, the funnelarea slice colors (whether given by `funnelareacolorway` or inherited from `colorway`) will be extended to three times its original length by first repeating every color 20% lighter then each color 20% darker. This is intended to reduce the likelihood of reusing the same color when you have many slices, but you can set `false` to disable. Colors provided in the trace, using `marker.colors`, are never extended.</param>
/// <param name="FunnelAreaColorWay">Sets the default funnelarea slice colors. Defaults to the main `colorway` used for trace colors. If you specify a new list here it can still be extended with lighter and darker colors, see `extendfunnelareacolors`.</param>
/// <param name="ExtendSunBurstColors">If `true`, the sunburst slice colors (whether given by `sunburstcolorway` or inherited from `colorway`) will be extended to three times its original length by first repeating every color 20% lighter then each color 20% darker. This is intended to reduce the likelihood of reusing the same color when you have many slices, but you can set `false` to disable. Colors provided in the trace, using `marker.colors`, are never extended.</param>
/// <param name="SunBurstColorWay">If `true`, the sunburst slice colors (whether given by `sunburstcolorway` or inherited from `colorway`) will be extended to three times its original length by first repeating every color 20% lighter then each color 20% darker. This is intended to reduce the likelihood of reusing the same color when you have many slices, but you can set `false` to disable. Colors provided in the trace, using `marker.colors`, are never extended.</param>
/// <param name="ExtendTreeMapColors">If `true`, the treemap slice colors (whether given by `treemapcolorway` or inherited from `colorway`) will be extended to three times its original length by first repeating every color 20% lighter then each color 20% darker. This is intended to reduce the likelihood of reusing the same color when you have many slices, but you can set `false` to disable. Colors provided in the trace, using `marker.colors`, are never extended.</param>
/// <param name="TreeMapColorWay">Sets the default treemap slice colors. Defaults to the main `colorway` used for trace colors. If you specify a new list here it can still be extended with lighter and darker colors, see `extendtreemapcolors`.</param>
/// <param name="ExtendIcicleColors">If `true`, the icicle slice colors (whether given by `iciclecolorway` or inherited from `colorway`) will be extended to three times its original length by first repeating every color 20% lighter then each color 20% darker. This is intended to reduce the likelihood of reusing the same color when you have many slices, but you can set `false` to disable. Colors provided in the trace, using `marker.colors`, are never extended.</param>
/// <param name="IcicleColorWay">Sets the default icicle slice colors. Defaults to the main `colorway` used for trace colors. If you specify a new list here it can still be extended with lighter and darker colors, see `extendiciclecolors`.</param>
/// <param name="Annotations">A collection containing all Annotations of this layout. An annotation is a text element that can be placed anywhere in the plot. It can be positioned with respect to relative coordinates in the plot or with respect to the actual data coordinates of the graph. Annotations can be shown with or without an arrow.</param>
/// <param name="Shapes">A collection containing all Shapes of this layout.</param>
/// <param name="Selections">A collection containing all Selections of this layout.</param>
/// <param name="Images">A collection containing all Images of this layout. </param>
/// <param name="Sliders">A collection containing all Sliders of this layout. </param>
/// <param name="UpdateMenus">A collection containing all UpdateMenus of this layout. </param>
[<CompiledName("WithLayoutStyle")>]
static member withLayoutStyle
(
[<Optional; DefaultParameterValue(null)>] ?Title: Title,
[<Optional; DefaultParameterValue(null)>] ?ShowLegend: bool,
[<Optional; DefaultParameterValue(null)>] ?Legend: Legend,
[<Optional; DefaultParameterValue(null)>] ?Margin: Margin,
[<Optional; DefaultParameterValue(null)>] ?AutoSize: bool,
[<Optional; DefaultParameterValue(null)>] ?Width: int,
[<Optional; DefaultParameterValue(null)>] ?Height: int,
[<Optional; DefaultParameterValue(null)>] ?Font: Font,
[<Optional; DefaultParameterValue(null)>] ?UniformText: UniformText,
[<Optional; DefaultParameterValue(null)>] ?Separators: string,
[<Optional; DefaultParameterValue(null)>] ?PaperBGColor: Color,
[<Optional; DefaultParameterValue(null)>] ?PlotBGColor: Color,
[<Optional; DefaultParameterValue(null)>] ?AutoTypeNumbers: StyleParam.AutoTypeNumbers,
[<Optional; DefaultParameterValue(null)>] ?Colorscale: DefaultColorScales,
[<Optional; DefaultParameterValue(null)>] ?Colorway: Color,
[<Optional; DefaultParameterValue(null)>] ?ModeBar: ModeBar,
[<Optional; DefaultParameterValue(null)>] ?HoverMode: StyleParam.HoverMode,
[<Optional; DefaultParameterValue(null)>] ?ClickMode: StyleParam.ClickMode,
[<Optional; DefaultParameterValue(null)>] ?DragMode: StyleParam.DragMode,
[<Optional; DefaultParameterValue(null)>] ?SelectDirection: StyleParam.SelectDirection,
[<Optional; DefaultParameterValue(null)>] ?ActiveSelection: ActiveSelection,
[<Optional; DefaultParameterValue(null)>] ?NewSelection: NewSelection,
[<Optional; DefaultParameterValue(null)>] ?HoverDistance: int,
[<Optional; DefaultParameterValue(null)>] ?SpikeDistance: int,
[<Optional; DefaultParameterValue(null)>] ?Hoverlabel: Hoverlabel,
[<Optional; DefaultParameterValue(null)>] ?Transition: Transition,
[<Optional; DefaultParameterValue(null)>] ?DataRevision: string,
[<Optional; DefaultParameterValue(null)>] ?UIRevision: string,
[<Optional; DefaultParameterValue(null)>] ?EditRevision: string,
[<Optional; DefaultParameterValue(null)>] ?SelectRevision: string,
[<Optional; DefaultParameterValue(null)>] ?Template: DynamicObj,
[<Optional; DefaultParameterValue(null)>] ?Meta: string,
[<Optional; DefaultParameterValue(null)>] ?Computed: string,
[<Optional; DefaultParameterValue(null)>] ?Grid: LayoutGrid,
[<Optional; DefaultParameterValue(null)>] ?Calendar: StyleParam.Calendar,
[<Optional; DefaultParameterValue(null)>] ?MinReducedHeight: int,
[<Optional; DefaultParameterValue(null)>] ?MinReducedWidth: int,
[<Optional; DefaultParameterValue(null)>] ?NewShape: NewShape,
[<Optional; DefaultParameterValue(null)>] ?ActiveShape: ActiveShape,
[<Optional; DefaultParameterValue(null)>] ?HideSources: bool,
[<Optional; DefaultParameterValue(null)>] ?ScatterGap: float,
[<Optional; DefaultParameterValue(null)>] ?ScatterMode: StyleParam.ScatterMode,
[<Optional; DefaultParameterValue(null)>] ?BarGap: float,
[<Optional; DefaultParameterValue(null)>] ?BarGroupGap: float,
[<Optional; DefaultParameterValue(null)>] ?BarMode: StyleParam.BarMode,
[<Optional; DefaultParameterValue(null)>] ?BarNorm: StyleParam.BarNorm,
[<Optional; DefaultParameterValue(null)>] ?ExtendPieColors: bool,
[<Optional; DefaultParameterValue(null)>] ?HiddenLabels: seq<#IConvertible>,
[<Optional; DefaultParameterValue(null)>] ?PieColorWay: Color,
[<Optional; DefaultParameterValue(null)>] ?BoxGap: float,
[<Optional; DefaultParameterValue(null)>] ?BoxGroupGap: float,
[<Optional; DefaultParameterValue(null)>] ?BoxMode: StyleParam.BoxMode,
[<Optional; DefaultParameterValue(null)>] ?ViolinGap: float,
[<Optional; DefaultParameterValue(null)>] ?ViolinGroupGap: float,
[<Optional; DefaultParameterValue(null)>] ?ViolinMode: StyleParam.ViolinMode,
[<Optional; DefaultParameterValue(null)>] ?WaterfallGap: float,
[<Optional; DefaultParameterValue(null)>] ?WaterfallGroupGap: float,
[<Optional; DefaultParameterValue(null)>] ?WaterfallMode: StyleParam.WaterfallMode,
[<Optional; DefaultParameterValue(null)>] ?FunnelGap: float,
[<Optional; DefaultParameterValue(null)>] ?FunnelGroupGap: float,
[<Optional; DefaultParameterValue(null)>] ?FunnelMode: StyleParam.FunnelMode,
[<Optional; DefaultParameterValue(null)>] ?ExtendFunnelAreaColors: bool,
[<Optional; DefaultParameterValue(null)>] ?FunnelAreaColorWay: Color,
[<Optional; DefaultParameterValue(null)>] ?ExtendSunBurstColors: bool,
[<Optional; DefaultParameterValue(null)>] ?SunBurstColorWay: Color,
[<Optional; DefaultParameterValue(null)>] ?ExtendTreeMapColors: bool,
[<Optional; DefaultParameterValue(null)>] ?TreeMapColorWay: Color,
[<Optional; DefaultParameterValue(null)>] ?ExtendIcicleColors: bool,
[<Optional; DefaultParameterValue(null)>] ?IcicleColorWay: Color,
[<Optional; DefaultParameterValue(null)>] ?Annotations: seq<Annotation>,
[<Optional; DefaultParameterValue(null)>] ?Shapes: seq<Shape>,
[<Optional; DefaultParameterValue(null)>] ?Selections: seq<Selection>,
[<Optional; DefaultParameterValue(null)>] ?Images: seq<LayoutImage>,
[<Optional; DefaultParameterValue(null)>] ?Sliders: seq<Slider>,
[<Optional; DefaultParameterValue(null)>] ?UpdateMenus: seq<UpdateMenu>
) =
(fun (ch: GenericChart) ->
let layout' =
Layout.init (
?Title = Title,
?ShowLegend = ShowLegend,
?Legend = Legend,
?Margin = Margin,
?AutoSize = AutoSize,
?Width = Width,
?Height = Height,
?Font = Font,
?UniformText = UniformText,
?Separators = Separators,
?PaperBGColor = PaperBGColor,
?PlotBGColor = PlotBGColor,
?AutoTypeNumbers = AutoTypeNumbers,
?Colorscale = Colorscale,
?Colorway = Colorway,
?ModeBar = ModeBar,
?HoverMode = HoverMode,
?ClickMode = ClickMode,
?DragMode = DragMode,
?SelectDirection = SelectDirection,
?NewSelection = NewSelection,
?ActiveSelection = ActiveSelection,
?HoverDistance = HoverDistance,
?SpikeDistance = SpikeDistance,
?Hoverlabel = Hoverlabel,
?Transition = Transition,
?DataRevision = DataRevision,
?UIRevision = UIRevision,
?EditRevision = EditRevision,
?SelectRevision = SelectRevision,
?Template = Template,
?Meta = Meta,
?Computed = Computed,
?Grid = Grid,
?Calendar = Calendar,
?NewShape = NewShape,
?MinReducedHeight = MinReducedHeight,
?MinReducedWidth = MinReducedWidth,
?ActiveShape = ActiveShape,
?HideSources = HideSources,
?ScatterGap = ScatterGap,
?ScatterMode = ScatterMode,
?BarGap = BarGap,
?BarGroupGap = BarGroupGap,
?BarMode = BarMode,
?BarNorm = BarNorm,
?ExtendPieColors = ExtendPieColors,
?HiddenLabels = HiddenLabels,
?PieColorWay = PieColorWay,
?BoxGap = BoxGap,
?BoxGroupGap = BoxGroupGap,
?BoxMode = BoxMode,
?ViolinGap = ViolinGap,
?ViolinGroupGap = ViolinGroupGap,
?ViolinMode = ViolinMode,
?WaterfallGap = WaterfallGap,
?WaterfallGroupGap = WaterfallGroupGap,
?WaterfallMode = WaterfallMode,
?FunnelGap = FunnelGap,
?FunnelGroupGap = FunnelGroupGap,
?FunnelMode = FunnelMode,
?ExtendFunnelAreaColors = ExtendFunnelAreaColors,
?FunnelAreaColorWay = FunnelAreaColorWay,
?ExtendSunBurstColors = ExtendSunBurstColors,
?SunBurstColorWay = SunBurstColorWay,
?ExtendTreeMapColors = ExtendTreeMapColors,
?TreeMapColorWay = TreeMapColorWay,
?ExtendIcicleColors = ExtendIcicleColors,
?IcicleColorWay = IcicleColorWay,
?Annotations = Annotations,
?Shapes = Shapes,
?Selections = Selections,
?Images = Images,
?Sliders = Sliders,
?UpdateMenus = UpdateMenus
)
GenericChart.addLayout layout' ch)
/// <summary>
/// Sets the given axis with the given id on the input chart's layout.
/// </summary>
/// <param name="axis">The x axis to set on the chart's layout</param>
/// <param name="id">The target axis id with which the axis should be set.</param>
/// <param name="SceneAxis">If set on a scene, define wether it is the x, y or z axis. default is x.</param>
/// <param name="Combine">Wether or not to combine the objects if there is already an axis set (default is false)</param>
[<CompiledName("SetAxis")>]
static member setAxis
(
axis: LinearAxis,
id: StyleParam.SubPlotId,
[<Optional; DefaultParameterValue(null)>] ?SceneAxis: StyleParam.SubPlotId,
[<Optional; DefaultParameterValue(null)>] ?Combine: bool
) =
fun (ch: GenericChart) ->
let combine = defaultArg Combine false
match id with
// x and y axes for 2d cartesion plots are set on the layout directly
| StyleParam.SubPlotId.XAxis _
| StyleParam.SubPlotId.YAxis _ ->
ch