|
| 1 | +(*** hide ***) |
| 2 | +#r "netstandard" |
| 3 | +#r @"../../lib/Formatting/FSharp.Plotly.dll" |
| 4 | + |
| 5 | +(** |
| 6 | +# FSharp.Plotly: Tables |
| 7 | +
|
| 8 | +This example shows how to create tables in F#. |
| 9 | +
|
| 10 | +
|
| 11 | +*) |
| 12 | + |
| 13 | +open FSharp.Plotly |
| 14 | +open FSharp.Plotly.StyleParam |
| 15 | + |
| 16 | +let header = ["RowIndex";"A";"simple";"table"] |
| 17 | +let rows = |
| 18 | + [ |
| 19 | + ["0";"I";"am";"a"] |
| 20 | + ["1";"little";"example";"!"] |
| 21 | + ] |
| 22 | + |
| 23 | +let table1 = |
| 24 | + Chart.Table(header, rows) |
| 25 | + |
| 26 | + |
| 27 | + |
| 28 | +(***do-not-eval***) |
| 29 | +table1 |> Chart.Show |
| 30 | + |
| 31 | +(*** include-value:table1 ***) |
| 32 | + |
| 33 | +(** |
| 34 | +A little bit of styling: |
| 35 | +*) |
| 36 | + |
| 37 | +let table2 = |
| 38 | + Chart.Table( |
| 39 | + header, |
| 40 | + rows, |
| 41 | + //sets global header alignment |
| 42 | + AlignHeader= [HorizontalAlign.Center], |
| 43 | + //sets alignment for each column separately (The last alignment is applied to all potential following columns) |
| 44 | + AlignCells= [HorizontalAlign.Left;HorizontalAlign.Center;HorizontalAlign.Right], |
| 45 | + //sets global header color |
| 46 | + ColorHeader="#45546a", |
| 47 | + //sets single header color to each header column |
| 48 | + //ColorHeader=["#45546a";"#deebf7";"#45546a";"#deebf7"], |
| 49 | + //sets global cell color |
| 50 | + //ColorRows="#deebf7", |
| 51 | + //sets single header color to each header column |
| 52 | + ColorCells=["#deebf7";"lightgrey";"#deebf7";"lightgrey"], |
| 53 | + //sets font of header |
| 54 | + FontHeader=Font.init(FontFamily.Courier_New, Size=12, Color="white"), |
| 55 | + //sets the height of the header |
| 56 | + HeightHeader= 30., |
| 57 | + //sets lines of header |
| 58 | + LineHeader=Line.init(2.,"black"), |
| 59 | + ColumnWidth=[70;50;100;70], |
| 60 | + //defines order of columns |
| 61 | + ColumnOrder= [1;2;3;4] |
| 62 | + ) |
| 63 | + |
| 64 | +(***do-not-eval***) |
| 65 | +table2 |> Chart.Show |
| 66 | + |
| 67 | +(*** include-value:table2 ***) |
| 68 | + |
| 69 | +(** |
| 70 | +FastA Representation |
| 71 | +
|
| 72 | +*) |
| 73 | + |
| 74 | + |
| 75 | + |
| 76 | + |
0 commit comments