-
Notifications
You must be signed in to change notification settings - Fork 101
Expand file tree
/
Copy pathChartDomain.fs
More file actions
684 lines (640 loc) · 37.7 KB
/
ChartDomain.fs
File metadata and controls
684 lines (640 loc) · 37.7 KB
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
namespace Plotly.NET
open Plotly.NET.LayoutObjects
open Plotly.NET.TraceObjects
open DynamicObj
open System
open System.IO
open GenericChart
open StyleParam
open System.Runtime.InteropServices
open System.Runtime.CompilerServices
[<AutoOpen>]
module ChartDomain =
[<Extension>]
type Chart =
/// Shows how proportions of data, shown as pie-shaped pieces, contribute to the data.
[<Extension>]
static member Pie
(
values : seq<#IConvertible>,
[<Optional;DefaultParameterValue(null)>] ?Labels : seq<#IConvertible>,
[<Optional;DefaultParameterValue(null)>] ?Name : string,
[<Optional;DefaultParameterValue(null)>] ?TextLabels : seq<#IConvertible>,
[<Optional;DefaultParameterValue(null)>] ?TextPosition : StyleParam.TextPosition,
[<Optional;DefaultParameterValue(null)>] ?Direction : StyleParam.Direction,
[<Optional;DefaultParameterValue(null)>] ?Pull : float,
[<Optional;DefaultParameterValue(null)>] ?ShowLegend : bool,
[<Optional;DefaultParameterValue(null)>] ?SectionColors : seq<Color>,
[<Optional;DefaultParameterValue(null)>] ?Opacity : float,
[<Optional;DefaultParameterValue(null)>] ?Sort : bool
) =
TraceDomain.initPie(
TraceDomainStyle.Pie(
Values = values,
?Labels = Labels,
?Name = Name,
?Text = TextLabels,
?TextPosition = TextPosition,
?Direction = Direction,
?Pull = Pull,
?ShowLegend = ShowLegend,
?Opacity = Opacity,
?Sort = Sort
)
)
|> TraceStyle.Marker(?Colors=SectionColors)
|> TraceStyle.TextLabel(?Text=(if TextLabels.IsSome then TextLabels else Labels),?Textposition=TextPosition)
|> GenericChart.ofTraceObject
/// Shows how proportions of data, shown as pie-shaped pieces, contribute to the data.
[<Extension>]
static member Pie
(
valuesLabels:seq<#IConvertible*#IConvertible>,
[<Optional;DefaultParameterValue(null)>] ?Name : string,
[<Optional;DefaultParameterValue(null)>] ?TextLabels : seq<#IConvertible>,
[<Optional;DefaultParameterValue(null)>] ?TextPosition : StyleParam.TextPosition,
[<Optional;DefaultParameterValue(null)>] ?Direction : StyleParam.Direction,
[<Optional;DefaultParameterValue(null)>] ?Pull : float,
[<Optional;DefaultParameterValue(null)>] ?ShowLegend : bool,
[<Optional;DefaultParameterValue(null)>] ?SectionColors : seq<Color>,
[<Optional;DefaultParameterValue(null)>] ?Opacity : float,
[<Optional;DefaultParameterValue(null)>] ?Sort : bool
) =
let values,labels = Seq.unzip valuesLabels
Chart.Pie(
values,
Labels = labels,
?Name = Name ,
?TextLabels = TextLabels ,
?TextPosition = TextPosition ,
?Direction = Direction ,
?Pull = Pull ,
?ShowLegend = ShowLegend ,
?SectionColors = SectionColors,
?Opacity = Opacity ,
?Sort = Sort
)
/// Shows how proportions of data, shown as pie-shaped pieces, contribute to the data as a whole.
[<Extension>]
static member Doughnut
(
values : seq<#IConvertible>,
[<Optional;DefaultParameterValue(null)>] ?Labels : seq<#IConvertible>,
[<Optional;DefaultParameterValue(null)>] ?Hole : float,
[<Optional;DefaultParameterValue(null)>] ?Name : string,
[<Optional;DefaultParameterValue(null)>] ?TextLabels : seq<#IConvertible>,
[<Optional;DefaultParameterValue(null)>] ?TextPosition : StyleParam.TextPosition,
[<Optional;DefaultParameterValue(null)>] ?Direction : StyleParam.Direction,
[<Optional;DefaultParameterValue(null)>] ?Pull : float,
[<Optional;DefaultParameterValue(null)>] ?ShowLegend : bool,
[<Optional;DefaultParameterValue(null)>] ?SectionColors : seq<Color>,
[<Optional;DefaultParameterValue(null)>] ?Opacity : float,
[<Optional;DefaultParameterValue(null)>] ?Sort : bool
) =
let hole' = Option.defaultValue 0.4 Hole
TraceDomain.initPie(
TraceDomainStyle.Pie(
Values = values,
?Labels = Labels,
?Name = Name,
?Text = TextLabels,
?TextPosition = TextPosition,
?Direction = Direction,
?Pull = Pull,
?ShowLegend = ShowLegend,
?Opacity = Opacity,
Hole = hole',
?Sort = Sort
)
)
|> TraceStyle.Marker(?Colors=SectionColors)
|> TraceStyle.TextLabel(?Text=(if TextLabels.IsSome then TextLabels else Labels),?Textposition=TextPosition)
|> GenericChart.ofTraceObject
/// Shows how proportions of data, shown as pie-shaped pieces, contribute to the data as a whole.
[<Extension>]
static member Doughnut
(
valuesLabels:seq<#IConvertible*#IConvertible>,
[<Optional;DefaultParameterValue(null)>] ?Hole : float,
[<Optional;DefaultParameterValue(null)>] ?Name : string,
[<Optional;DefaultParameterValue(null)>] ?TextLabels : seq<#IConvertible>,
[<Optional;DefaultParameterValue(null)>] ?TextPosition : StyleParam.TextPosition,
[<Optional;DefaultParameterValue(null)>] ?Direction : StyleParam.Direction,
[<Optional;DefaultParameterValue(null)>] ?Pull : float,
[<Optional;DefaultParameterValue(null)>] ?ShowLegend : bool,
[<Optional;DefaultParameterValue(null)>] ?SectionColors : seq<Color>,
[<Optional;DefaultParameterValue(null)>] ?Opacity : float,
[<Optional;DefaultParameterValue(null)>] ?Sort : bool
) =
let values,labels = Seq.unzip valuesLabels
Chart.Doughnut(
values,
Labels = labels,
?Name = Name ,
?TextLabels = TextLabels ,
?TextPosition = TextPosition ,
?Direction = Direction ,
?Pull = Pull ,
?ShowLegend = ShowLegend ,
?SectionColors = SectionColors,
?Opacity = Opacity ,
?Hole = Hole ,
?Sort = Sort
)
/// Creates a FunnelArea chart.
/// FunnelArea charts visualize stages in a process using area-encoded trapezoids. This trace can be used to show data in a part-to-whole representation similar to a "pie" trace, wherein each item appears in a single stage. See also the "funnel" trace type for a different approach to visualizing funnel data.
///
/// Parameters:
///
/// Values : Sets the values of the sectors. If omitted, we count occurrences of each label.
///
/// Labels : Sets the sector labels. If `labels` entries are duplicated, we sum associated `values` or simply count occurrences if `values` is not provided. For other array attributes (including color) we use the first non-empty entry among all occurrences of the label.
///
/// dLabel : Sets the label step. See `label0` for more info.
///
/// Label0 : Alternate to `labels`. Builds a numeric set of labels. Use with `dlabel` where `label0` is the starting label and `dlabel` the step.
///
/// Name : Sets the trace name. The trace name appear as the legend item and on hover.
///
/// ShowLegend : Determines whether or not an item corresponding to this trace is shown in the legend.
///
/// Opacity : Sets the opacity of the trace.
///
/// Color : Sets Marker Color
///
/// Line : Line type
///
/// Text : Sets text elements associated with each sector. If trace `textinfo` contains a "text" flag, these elements will be seen on the chart. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels.
///
/// TextPosition : Specifies the location of the `textinfo`.
///
/// X : Sets the horizontal domain of this funnelarea trace (in plot fraction).
///
/// Y : Sets the vertical domain of this funnelarea trace (in plot fraction).
///
/// Row : If there is a layout grid, use the domain for this row in the grid for this funnelarea trace .
///
/// Column : If there is a layout grid, use the domain for this column in the grid for this funnelarea trace .
///
/// Aspectratio : Sets the ratio between height and width
///
/// Baseratio : Sets the ratio between bottom length and maximum top length.
///
/// Insidetextfont: Sets the font used for `textinfo` lying inside the sector.
///
/// Scalegroup : If there are multiple funnelareas that should be sized according to their totals, link them by providing a non-empty group id here shared by every trace in the same group.
[<Extension>]
static member FunnelArea
(
[<Optional;DefaultParameterValue(null)>] ?Values ,
[<Optional;DefaultParameterValue(null)>] ?Labels ,
[<Optional;DefaultParameterValue(null)>] ?dLabel ,
[<Optional;DefaultParameterValue(null)>] ?Label0 ,
[<Optional;DefaultParameterValue(null)>] ?Name ,
[<Optional;DefaultParameterValue(null)>] ?ShowLegend ,
[<Optional;DefaultParameterValue(null)>] ?Opacity ,
[<Optional;DefaultParameterValue(null)>] ?Color ,
[<Optional;DefaultParameterValue(null)>] ?Line ,
[<Optional;DefaultParameterValue(null)>] ?Text ,
[<Optional;DefaultParameterValue(null)>] ?TextPosition ,
[<Optional;DefaultParameterValue(null)>] ?X ,
[<Optional;DefaultParameterValue(null)>] ?Y ,
[<Optional;DefaultParameterValue(null)>] ?Row ,
[<Optional;DefaultParameterValue(null)>] ?Column ,
[<Optional;DefaultParameterValue(null)>] ?Aspectratio ,
[<Optional;DefaultParameterValue(null)>] ?Baseratio ,
[<Optional;DefaultParameterValue(null)>] ?Insidetextfont,
[<Optional;DefaultParameterValue(null)>] ?Scalegroup
) =
TraceDomain.initFunnelArea(
TraceDomainStyle.FunnelArea(
?Values = Values ,
?Labels = Labels ,
?dLabel = dLabel ,
?Label0 = Label0 ,
?Aspectratio = Aspectratio ,
?Baseratio = Baseratio ,
?Insidetextfont = Insidetextfont,
?Scalegroup = Scalegroup
)
)
|> TraceStyle.TraceInfo(?Name=Name,?ShowLegend=ShowLegend,?Opacity=Opacity)
|> TraceStyle.Marker(?Color=Color,?Outline=Line)
|> TraceStyle.Domain(?X=X,?Y=Y,?Row=Row,?Column=Column)
|> TraceStyle.TextLabel(?Text=Text,?Textposition=TextPosition)
|> GenericChart.ofTraceObject
/// Creates a sunburst chart. Visualize hierarchical data spanning outward radially from root to leaves.
/// Applies the styles of sundburst plot to TraceObjects
///
/// Parameters:
///
/// labels: Sets the labels of each of the sectors.
///
/// parents: Sets the parent sectors for each of the sectors. Empty string items '' are understood to reference the root node in the hierarchy. If `ids` is filled, `parents` items are understood to be "ids" themselves. When `ids` is not set, plotly attempts to find matching items in `labels`, but beware they must be unique.
///
/// Ids: Assigns id labels to each datum. These ids for object constancy of data points during animation.
///
/// Values: Sets the values associated with each of the sectors. Use with `branchvalues` to determine how the values are summed.
///
/// Text: Sets text elements associated with each sector. If trace `textinfo` contains a "text" flag, these elements will be seen on the chart. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels.
///
/// Branchvalues: Determines how the items in `values` are summed. When set to "total", items in `values` are taken to be value of all its descendants. When set to "remainder", items in `values` corresponding to the root and the branches sectors are taken to be the extra part not part of the sum of the values at their leaves.
///
/// Level: Sets the level from which this trace hierarchy is rendered. Set `level` to `''` to start from the root node in the hierarchy. Must be an "id" if `ids` is filled in, otherwise plotly attempts to find a matching item in `labels`.
///
/// Maxdepth: Sets the number of rendered sectors from any given `level`. Set `maxdepth` to "-1" to render all the levels in the hierarchy.
///
/// ColorBar: Sets the ColorBar for the chart
///
///Colors: Sets the color of each sector of this trace. If not specified, the default trace color set is used to pick the sector colors.
[<Extension>]
static member Sunburst(labels,parents,
[<Optional;DefaultParameterValue(null)>]?Ids,
[<Optional;DefaultParameterValue(null)>]?Values,
[<Optional;DefaultParameterValue(null)>]?Text,
[<Optional;DefaultParameterValue(null)>]?Branchvalues,
[<Optional;DefaultParameterValue(null)>]?Level,
[<Optional;DefaultParameterValue(null)>]?Maxdepth,
[<Optional;DefaultParameterValue(null)>]?Color,
[<Optional;DefaultParameterValue(null)>]?ColorBar:ColorBar
) =
TraceDomain.initSunburst(
TraceDomainStyle.Sunburst(
labels = labels,
parents = parents,
?Ids = Ids,
?Values = Values,
?Text = Text,
?Branchvalues = Branchvalues,
?Level = Level,
?Maxdepth = Maxdepth
)
)
|> TraceStyle.Marker(?Color=Color,?ColorBar=ColorBar)
|> GenericChart.ofTraceObject
/// Creates a treemap chart. Treemap charts visualize hierarchical data using nested rectangles. Same as Sunburst the hierarchy is defined by labels and parents attributes. Click on one sector to zoom in/out, which also displays a pathbar in the upper-left corner of your treemap. To zoom out you can use the path bar as well.
///
/// Parameters:
///
/// labels: Sets the labels of each of the sectors.
///
/// parents: Sets the parent sectors for each of the sectors. Empty string items '' are understood to reference the root node in the hierarchy. If `ids` is filled, `parents` items are understood to be "ids" themselves. When `ids` is not set, plotly attempts to find matching items in `labels`, but beware they must be unique.
///
/// Ids: Assigns id labels to each datum. These ids for object constancy of data points during animation.
///
/// Values: Sets the values associated with each of the sectors. Use with `branchvalues` to determine how the values are summed.
///
/// Text: Sets text elements associated with each sector. If trace `textinfo` contains a "text" flag, these elements will be seen on the chart. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels.
///
/// Branchvalues: Determines how the items in `values` are summed. When set to "total", items in `values` are taken to be value of all its descendants. When set to "remainder", items in `values` corresponding to the root and the branches sectors are taken to be the extra part not part of the sum of the values at their leaves.
///
/// Level: Sets the level from which this trace hierarchy is rendered. Set `level` to `''` to start from the root node in the hierarchy. Must be an "id" if `ids` is filled in, otherwise plotly attempts to find a matching item in `labels`.
///
/// Maxdepth: Sets the number of rendered sectors from any given `level`. Set `maxdepth` to "-1" to render all the levels in the hierarchy.
///
/// ColorBar: Sets the ColorBar for the chart
///
///Colors: Sets the color of each sector of this trace. If not specified, the default trace color set is used to pick the sector colors.
[<Extension>]
static member Treemap(labels,parents,
[<Optional;DefaultParameterValue(null)>]?Ids,
[<Optional;DefaultParameterValue(null)>]?Values,
[<Optional;DefaultParameterValue(null)>]?Text,
[<Optional;DefaultParameterValue(null)>]?Branchvalues,
[<Optional;DefaultParameterValue(null)>]?Tiling,
[<Optional;DefaultParameterValue(null)>]?PathBar,
[<Optional;DefaultParameterValue(null)>]?Level,
[<Optional;DefaultParameterValue(null)>]?Maxdepth,
[<Optional;DefaultParameterValue(null)>]?Color,
[<Optional;DefaultParameterValue(null)>]?ColorBar:ColorBar
) =
TraceDomain.initTreemap(
TraceDomainStyle.Treemap(
labels = labels,
parents = parents,
?Ids = Ids,
?Values = Values,
?Text = Text,
?Branchvalues = Branchvalues,
?Tiling = Tiling,
?PathBar = PathBar,
?Level = Level,
?Maxdepth = Maxdepth
)
)
|> TraceStyle.Marker(?Color=Color,?ColorBar=ColorBar)
|> GenericChart.ofTraceObject
/// Computes the parallel coordinates plot
[<Extension>]
static member ParallelCoord
(
dims:seq<'key*#seq<'values>>,
[<Optional;DefaultParameterValue(null)>] ?Range,
[<Optional;DefaultParameterValue(null)>] ?Constraintrange,
[<Optional;DefaultParameterValue(null)>] ?Color,
[<Optional;DefaultParameterValue(null)>] ?Colorscale,
[<Optional;DefaultParameterValue(null)>] ?Width,
[<Optional;DefaultParameterValue(null)>] ?Dash,
[<Optional;DefaultParameterValue(null)>] ?Domain,
[<Optional;DefaultParameterValue(null)>] ?Labelfont,
[<Optional;DefaultParameterValue(null)>] ?Tickfont,
[<Optional;DefaultParameterValue(null)>] ?Rangefont
) =
let dims' =
dims
|> Seq.map (fun (k,vals) ->
Dimensions.init(vals)
|> Dimensions.style(vals,?Range=Range,?Constraintrange=Constraintrange,Label=k)
)
TraceDomain.initParallelCoord(
TraceDomainStyle.ParallelCoord(
Dimensions=dims',
?Domain=Domain,
?Labelfont=Labelfont,
?Tickfont=Tickfont,
?Rangefont=Rangefont
)
)
|> TraceStyle.Line(?Width=Width,?Color=Color,?Dash=Dash,?Colorscale=Colorscale)
|> GenericChart.ofTraceObject
/// Computes the parallel coordinates plot
[<Extension>]
static member ParallelCoord
(
dims:seq<Dimensions>,
[<Optional;DefaultParameterValue(null)>] ?Color,
[<Optional;DefaultParameterValue(null)>] ?Colorscale,
[<Optional;DefaultParameterValue(null)>] ?Width,
[<Optional;DefaultParameterValue(null)>] ?Dash,
[<Optional;DefaultParameterValue(null)>] ?Domain,
[<Optional;DefaultParameterValue(null)>] ?Labelfont,
[<Optional;DefaultParameterValue(null)>] ?Tickfont,
[<Optional;DefaultParameterValue(null)>] ?Rangefont
) =
TraceDomain.initParallelCoord (
TraceDomainStyle.ParallelCoord (
Dimensions=dims,
?Domain=Domain,
?Labelfont=Labelfont,
?Tickfont=Tickfont,
?Rangefont=Rangefont
)
)
|> TraceStyle.Line(?Width=Width,?Color=Color,?Dash=Dash,?Colorscale=Colorscale)
|> GenericChart.ofTraceObject
///Parallel categories diagram for multidimensional categorical data.
[<Extension>]
static member ParallelCategories
(
dims:seq<'key*#seq<'values>>,
[<Optional;DefaultParameterValue(null)>] ?Range,
[<Optional;DefaultParameterValue(null)>] ?Constraintrange,
[<Optional;DefaultParameterValue(null)>] ?Color,
[<Optional;DefaultParameterValue(null)>] ?Colorscale,
[<Optional;DefaultParameterValue(null)>] ?Width,
[<Optional;DefaultParameterValue(null)>] ?Dash,
[<Optional;DefaultParameterValue(null)>] ?Domain,
[<Optional;DefaultParameterValue(null)>] ?Labelfont,
[<Optional;DefaultParameterValue(null)>] ?Tickfont,
[<Optional;DefaultParameterValue(null)>] ?Rangefont
) =
let dims' =
dims
|> Seq.map (fun (k,vals) ->
Dimensions.init(vals)
|> Dimensions.style(vals,?Range=Range,?Constraintrange=Constraintrange,Label=k)
)
TraceDomain.initParallelCategories (
TraceDomainStyle.ParallelCategories(
Dimensions=dims',
?Domain=Domain,
?Labelfont=Labelfont,
?Tickfont=Tickfont,
?Rangefont=Rangefont
)
)
|> TraceStyle.Line(?Width=Width,?Color=Color,?Dash=Dash,?Colorscale=Colorscale)
|> GenericChart.ofTraceObject
///
[<Extension>]
static member ParallelCategories
(
dims:seq<Dimensions>,
[<Optional;DefaultParameterValue(null)>] ?Color,
[<Optional;DefaultParameterValue(null)>] ?Colorscale,
[<Optional;DefaultParameterValue(null)>] ?Width,
[<Optional;DefaultParameterValue(null)>] ?Dash,
[<Optional;DefaultParameterValue(null)>] ?Domain,
[<Optional;DefaultParameterValue(null)>] ?Labelfont,
[<Optional;DefaultParameterValue(null)>] ?Tickfont,
[<Optional;DefaultParameterValue(null)>] ?Rangefont
) =
TraceDomain.initParallelCategories(
TraceDomainStyle.ParallelCategories(
Dimensions=dims,
?Domain=Domain,
?Color=Color,
?Labelfont=Labelfont,
?Tickfont=Tickfont,
?Rangefont=Rangefont
)
)
|> TraceStyle.Line(?Width=Width,?Dash=Dash,?Colorscale=Colorscale)
|> GenericChart.ofTraceObject
/// creates table out of header sequence and row sequences
[<Extension>]
static member Table
(
headerValues, cellValues,
[<Optional;DefaultParameterValue(null)>] ?AlignHeader,
[<Optional;DefaultParameterValue(null)>] ?AlignCells,
[<Optional;DefaultParameterValue(null)>] ?ColumnWidth,
[<Optional;DefaultParameterValue(null)>] ?ColumnOrder,
[<Optional;DefaultParameterValue(null)>] ?ColorHeader,
[<Optional;DefaultParameterValue(null)>] ?ColorCells,
[<Optional;DefaultParameterValue(null)>] ?FontHeader,
[<Optional;DefaultParameterValue(null)>] ?FontCells,
[<Optional;DefaultParameterValue(null)>] ?HeightHeader,
[<Optional;DefaultParameterValue(null)>] ?HeightCells,
[<Optional;DefaultParameterValue(null)>] ?LineHeader,
[<Optional;DefaultParameterValue(null)>] ?LineCells
) =
TraceDomain.initTable (
let CellFilling =
match ColorCells with
| Some color -> Some (CellColor.init (?Color=ColorCells))
| Option.None -> Option.None
let HeaderFilling =
match ColorHeader with
| Some color -> Some (CellColor.init (?Color=ColorHeader))
| Option.None -> Option.None
TraceDomainStyle.Table (
header = TableHeader.init (headerValues|> Seq.map seq, ?Align=AlignHeader, ?Fill=HeaderFilling, ?Font=FontHeader, ?Height=HeightHeader, ?Line=LineHeader),
cells = TableCells.init(cellValues |> Seq.transpose, ?Align=AlignCells, ?Fill=CellFilling, ?Font=FontCells, ?Height=HeightCells, ?Line=LineCells),
?ColumnWidth = ColumnWidth,
?ColumnOrder = ColumnOrder
)
)
|> GenericChart.ofTraceObject
/// creates table out of header sequence and row sequences
[<Extension>]
static member Indicator
(
value : IConvertible,
mode : StyleParam.IndicatorMode,
[<Optional;DefaultParameterValue(null)>] ?Range : StyleParam.Range,
[<Optional;DefaultParameterValue(null)>] ?Name : string,
[<Optional;DefaultParameterValue(null)>] ?Title : string,
[<Optional;DefaultParameterValue(null)>] ?ShowLegend : bool,
[<Optional;DefaultParameterValue(null)>] ?Domain : Domain,
[<Optional;DefaultParameterValue(null)>] ?Align : StyleParam.IndicatorAlignment,
[<Optional;DefaultParameterValue(null)>] ?DeltaReference : #IConvertible,
[<Optional;DefaultParameterValue(null)>] ?Delta : IndicatorDelta,
[<Optional;DefaultParameterValue(null)>] ?Number : IndicatorNumber,
[<Optional;DefaultParameterValue(null)>] ?GaugeShape : StyleParam.IndicatorGaugeShape,
[<Optional;DefaultParameterValue(null)>] ?Gauge : IndicatorGauge,
[<Optional;DefaultParameterValue(null)>] ?ShowGaugeAxis : bool,
[<Optional;DefaultParameterValue(null)>] ?GaugeAxis : LinearAxis
) =
let axis =
GaugeAxis
|> Option.defaultValue(LinearAxis.init())
|> LinearAxis.style(?Range=Range, ?Visible=ShowGaugeAxis)
let gauge =
Gauge
|> Option.defaultValue(IndicatorGauge.init())
|> IndicatorGauge.style(Axis=axis, ?Shape=GaugeShape)
let delta =
Delta
|> Option.defaultValue(IndicatorDelta.init())
|> IndicatorDelta.style(?Reference = DeltaReference)
TraceDomain.initIndicator(
TraceDomainStyle.Indicator(
?Name = Name ,
?Title = Title ,
?ShowLegend = ShowLegend,
Mode = mode ,
Value = value ,
?Domain = Domain ,
?Align = Align ,
Delta = delta ,
?Number = Number ,
Gauge = gauge
)
)
|> GenericChart.ofTraceObject
/// creates table out of header sequence and row sequences
[<Extension>]
static member Icicle
(
labels : seq<#IConvertible>,
parents : seq<#IConvertible>,
[<Optional;DefaultParameterValue(null)>] ?Name : string,
[<Optional;DefaultParameterValue(null)>] ?ShowLegend : bool,
[<Optional;DefaultParameterValue(null)>] ?Values : seq<#IConvertible>,
[<Optional;DefaultParameterValue(null)>] ?Opacity : float,
[<Optional;DefaultParameterValue(null)>] ?MultiOpacity : seq<float>,
[<Optional;DefaultParameterValue(null)>] ?Color : Color,
[<Optional;DefaultParameterValue(null)>] ?ColorScale : StyleParam.Colorscale,
[<Optional;DefaultParameterValue(null)>] ?ShowScale : bool,
[<Optional;DefaultParameterValue(null)>] ?Marker : Marker,
[<Optional;DefaultParameterValue(null)>] ?Text : #IConvertible,
[<Optional;DefaultParameterValue(null)>] ?MultiText : seq<#IConvertible>,
[<Optional;DefaultParameterValue(null)>] ?TextPosition : StyleParam.TextPosition,
[<Optional;DefaultParameterValue(null)>] ?MultiTextPosition : seq<StyleParam.TextPosition>,
[<Optional;DefaultParameterValue(null)>] ?Domain : Domain,
[<Optional;DefaultParameterValue(null)>] ?BranchValues : StyleParam.BranchValues,
[<Optional;DefaultParameterValue(null)>] ?Count : StyleParam.IcicleCount,
[<Optional;DefaultParameterValue(null)>] ?TilingOrientation : StyleParam.Orientation,
[<Optional;DefaultParameterValue(null)>] ?TilingFlip : StyleParam.TilingFlip,
[<Optional;DefaultParameterValue(null)>] ?Tiling : IcicleTiling,
[<Optional;DefaultParameterValue(null)>] ?PathBarEdgeShape : StyleParam.PathbarEdgeShape,
[<Optional;DefaultParameterValue(null)>] ?PathBar : Pathbar
) =
let tiling =
Tiling
|> Option.defaultValue(IcicleTiling.init())
|> IcicleTiling.style(?Orientation = TilingOrientation, ?Flip = TilingFlip)
let pathbar =
PathBar
|> Option.defaultValue(Pathbar.init())
|> Pathbar.style(?EdgeShape = PathBarEdgeShape)
TraceDomain.initIcicle(
TraceDomainStyle.Icicle(
?Name = Name ,
?ShowLegend = ShowLegend ,
?Opacity = Opacity ,
Parents = parents ,
?Values = Values ,
Labels = labels ,
?Text = Text ,
?MultiText = MultiText ,
?TextPosition = TextPosition ,
?MultiTextPosition = MultiTextPosition ,
?Domain = Domain ,
?Marker = Marker ,
?BranchValues = BranchValues ,
?Count = Count ,
Tiling = tiling ,
PathBar = pathbar
)
>> TraceStyle.Marker (
?Color = Color,
?MultiOpacity = MultiOpacity,
?Colorscale = ColorScale,
?ShowScale = ShowScale
)
)
|> GenericChart.ofTraceObject
/// creates table out of header sequence and row sequences
[<Extension>]
static member Icicle
(
labelsParents: seq<#IConvertible * #IConvertible>,
[<Optional;DefaultParameterValue(null)>] ?Name : string,
[<Optional;DefaultParameterValue(null)>] ?ShowLegend : bool,
[<Optional;DefaultParameterValue(null)>] ?Values : seq<#IConvertible>,
[<Optional;DefaultParameterValue(null)>] ?Opacity : float,
[<Optional;DefaultParameterValue(null)>] ?MultiOpacity : seq<float>,
[<Optional;DefaultParameterValue(null)>] ?Color : Color,
[<Optional;DefaultParameterValue(null)>] ?ColorScale : StyleParam.Colorscale,
[<Optional;DefaultParameterValue(null)>] ?ShowScale : bool,
[<Optional;DefaultParameterValue(null)>] ?Marker : Marker,
[<Optional;DefaultParameterValue(null)>] ?Text : #IConvertible,
[<Optional;DefaultParameterValue(null)>] ?MultiText : seq<#IConvertible>,
[<Optional;DefaultParameterValue(null)>] ?TextPosition : StyleParam.TextPosition,
[<Optional;DefaultParameterValue(null)>] ?MultiTextPosition : seq<StyleParam.TextPosition>,
[<Optional;DefaultParameterValue(null)>] ?Domain : Domain,
[<Optional;DefaultParameterValue(null)>] ?BranchValues : StyleParam.BranchValues,
[<Optional;DefaultParameterValue(null)>] ?Count : StyleParam.IcicleCount,
[<Optional;DefaultParameterValue(null)>] ?TilingOrientation : StyleParam.Orientation,
[<Optional;DefaultParameterValue(null)>] ?TilingFlip : StyleParam.TilingFlip,
[<Optional;DefaultParameterValue(null)>] ?Tiling : IcicleTiling,
[<Optional;DefaultParameterValue(null)>] ?PathBarEdgeShape : StyleParam.PathbarEdgeShape,
[<Optional;DefaultParameterValue(null)>] ?PathBar : Pathbar
) =
let labels, parents = Seq.unzip labelsParents
Chart.Icicle(
labels, parents,
?Name = Name ,
?ShowLegend = ShowLegend ,
?Values = Values ,
?Opacity = Opacity ,
?MultiOpacity = MultiOpacity ,
?Color = Color ,
?ColorScale = ColorScale ,
?ShowScale = ShowScale ,
?Marker = Marker ,
?Text = Text ,
?MultiText = MultiText ,
?TextPosition = TextPosition ,
?MultiTextPosition = MultiTextPosition ,
?Domain = Domain ,
?BranchValues = BranchValues ,
?Count = Count ,
?TilingOrientation = TilingOrientation ,
?TilingFlip = TilingFlip ,
?Tiling = Tiling ,
?PathBarEdgeShape = PathBarEdgeShape ,
?PathBar = PathBar
)