Skip to content

Commit f6e5695

Browse files
author
bvenn
committed
add sanky and candlestick docu to sidebar
formatting table docu
1 parent 70bbb17 commit f6e5695

File tree

2 files changed

+40
-30
lines changed

2 files changed

+40
-30
lines changed

docsrc/content/table.fsx

Lines changed: 36 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,11 @@ open FSharp.Plotly.StyleParam
1616
let header = ["<b>RowIndex</b>";"A";"simple";"table"]
1717
let rows =
1818
[
19-
["0";"I";"am";"a"]
19+
["0";"I" ;"am" ;"a"]
2020
["1";"little";"example";"!"]
2121
]
2222

23-
let table1 =
24-
Chart.Table(header, rows)
25-
23+
let table1 = Chart.Table(header, rows)
2624

2725

2826
(***do-not-eval***)
@@ -39,29 +37,29 @@ let table2 =
3937
header,
4038
rows,
4139
//sets global header alignment
42-
AlignHeader= [HorizontalAlign.Center],
40+
AlignHeader = [HorizontalAlign.Center],
4341
//sets alignment for each column separately
4442
//(The last alignment is applied to all potential following columns)
45-
AlignCells= [HorizontalAlign.Left;HorizontalAlign.Center;HorizontalAlign.Right],
43+
AlignCells = [HorizontalAlign.Left;HorizontalAlign.Center;HorizontalAlign.Right],
4644
//sets global header color
47-
ColorHeader="#45546a",
48-
//sets specific header color to each header column
45+
ColorHeader = "#45546a",
46+
//sets specific color to each header column
4947
//ColorHeader=["#45546a";"#deebf7";"#45546a";"#deebf7"],
5048
//sets global cell color
51-
//ColorRows="#deebf7",
49+
//ColorRows = "#deebf7",
5250
//sets cell column colors
53-
ColorCells=["#deebf7";"lightgrey";"#deebf7";"lightgrey"],
51+
ColorCells = ["#deebf7";"lightgrey";"#deebf7";"lightgrey"],
5452
//sets cell row colors
5553
//ColorCells=[["#deebf7";"lightgrey"]],
5654
//sets font of header
57-
FontHeader=Font.init(FontFamily.Courier_New, Size=12, Color="white"),
55+
FontHeader = Font.init(FontFamily.Courier_New, Size=12, Color="white"),
5856
//sets the height of the header
5957
HeightHeader= 30.,
6058
//sets lines of header
61-
LineHeader=Line.init(2.,"black"),
62-
ColumnWidth=[70;50;100;70],
59+
LineHeader = Line.init(2.,"black"),
60+
ColumnWidth = [70;50;100;70],
6361
//defines order of columns
64-
ColumnOrder= [1;2;3;4]
62+
ColumnOrder = [1;2;3;4]
6563
)
6664

6765
(***do-not-eval***)
@@ -88,11 +86,13 @@ let rowvalues =
8886

8987
//map color from value to hex representation
9088
let mapColor min max value =
91-
let percentage = (value - min) / (max - min)
92-
Colors.fromRgb 255 (255 - (int (255. * percentage))) (int (255. * percentage))
89+
let proportion =
90+
(255. * (value - min) / (max - min))
91+
|> int
92+
Colors.fromRgb 255 (255 - proportion) proportion
9393
|> Colors.toWebColor
9494

95-
//assign a color to every cell seperately. Matrix must be transposed for correct orientation
95+
//Assign a color to every cell seperately. Matrix must be transposed for correct orientation.
9696
let cellcolor =
9797
rowvalues
9898
|> Seq.map (fun row ->
@@ -114,7 +114,7 @@ table3 |> Chart.Show
114114

115115

116116
(**
117-
Sequence representation
117+
Sequence representation:
118118
119119
*)
120120

@@ -128,26 +128,26 @@ let sequence =
128128
]
129129
|> String.concat ""
130130

131-
let elementsperrow = 60
131+
let elementsPerRow = 60
132132

133133
let headers =
134-
[0..elementsperrow]
134+
[0..elementsPerRow]
135135
|> Seq.map (fun x ->
136136
if x%10=0 && x <> 0 then "|"
137137
else ""
138138
)
139139

140140
let cells =
141141
sequence
142-
|> Seq.chunkBySize elementsperrow
143-
|> Seq.mapi (fun i x -> Seq.append [string (i * elementsperrow)] (Seq.map string x))
142+
|> Seq.chunkBySize elementsPerRow
143+
|> Seq.mapi (fun i x -> Seq.append [string (i * elementsPerRow)] (Seq.map string x))
144144

145145
let cellcolors =
146146
cells
147147
|> Seq.map (fun row ->
148148
row
149-
|> Seq.map (fun nucleotid ->
150-
match nucleotid with
149+
|> Seq.map (fun element ->
150+
match element with
151151
//colors taken from DRuMS
152152
//(http://biomodel.uah.es/en/model4/dna/atgc.htm)
153153
| "A" -> "#5050FF"
@@ -163,13 +163,21 @@ let cellcolors =
163163

164164
let font = Font.init(FontFamily.Consolas,Size=14)
165165
let line = Line.init(0,"white")
166-
let chartwidth = 50. + 10. * float elementsperrow
166+
let chartwidth = 50. + 10. * float elementsPerRow
167167

168168
let table4 =
169169
Chart.Table(
170-
headers,cells,LineCells=line,LineHeader=line,HeightCells=20,
171-
FontHeader=font,FontCells=font,ColumnWidth=[50;10],
172-
AlignCells=[HorizontalAlign.Right;HorizontalAlign.Center],ColorCells=cellcolors)
170+
headers,
171+
cells,
172+
LineCells = line,
173+
LineHeader = line,
174+
HeightCells = 20,
175+
FontHeader = font,
176+
FontCells = font,
177+
ColumnWidth = [50;10],
178+
AlignCells = [HorizontalAlign.Right;HorizontalAlign.Center],
179+
ColorCells = cellcolors
180+
)
173181
|> Chart.withSize(chartwidth,nan)
174182
|> Chart.withTitle "Sequence A"
175183

docsrc/tools/templates/template.cshtml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
<li><a href="@Root/box-plots.html">Box Plots</a></li>
6060
<li><a href="@Root/violin-plots.html">Violin Plots</a></li>
6161
<li><a href="@Root/bubble-charts.html">Bubble Charts</a></li>
62+
<li><a href="@Root/candlestick.html">Candlestick Plots</a></li>
6263
<li><a href="@Root/contour-plots.html">Contour Plots</a></li>
6364
<li><a href="@Root/heatmaps.html">Heatmaps</a></li>
6465
<li><a href="@Root/histograms.html">Histograms</a></li>
@@ -70,19 +71,20 @@
7071
<li><a href="@Root/windrose-charts.html">Windrose Charts</a></li>
7172
<li><a href="@Root/range-plots.html">Range Plots</a></li>
7273
<li><a href="@Root/splom.html">Splom Plots</a></li>
74+
<li><a href="@Root/sankey.html">Sankey Plots</a></li>
7375
<li class="nav-header">Map Charts</li>
7476
<li><a href="@Root/choropleth-map.html">Choropleth</a></li>
7577
<li class="nav-header">Plotly 3d-Charts</li>
7678
<li><a href="@Root/3d-scatter-plots.html">3D Scatter Plots</a></li>
7779
<li><a href="@Root/3d-line-plots.html">3D Line Plots</a></li>
7880
<li><a href="@Root/3d-surface-plots.html">3D Surface Plots</a></li>
7981
<li><a href="@Root/3d-mesh-plots.html">3D Mesh Plots</a></li>
82+
<li class="nav-header">Plotly Tables</li>
83+
<li><a href="@Root/table.html">Table</a></li>
8084
<li class="nav-header">Styling</li>
8185
<li><a href="@Root/multiple-charts.html">Multiple Charts</a></li>
8286
<li><a href="@Root/errorbars.html">Error bars</a></li>
8387
<li><a href="@Root/shapes.html">Shapes</a></li>
84-
<li class="nav-header">Plotly Tables</li>
85-
<li><a href="@Root/table.html">Table</a></li>
8688
<li class="nav-header">Plotly WPF</li>
8789
<li><a href="@Root/plotly-wpf.html">Using Plotly PopUp window</a></li>
8890

0 commit comments

Comments
 (0)