Skip to content

Commit 15ea8d4

Browse files
committed
Update release notes and docs
1 parent 266facf commit 15ea8d4

File tree

5 files changed

+180
-24
lines changed

5 files changed

+180
-24
lines changed

Diff for: Plotly.NET.sln

+2
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "content", "content", "{60FB
7676
docs\4_5_splom.fsx = docs\4_5_splom.fsx
7777
docs\5_0_choropleth-map.fsx = docs\5_0_choropleth-map.fsx
7878
docs\6_0_candlestick.fsx = docs\6_0_candlestick.fsx
79+
docs\6_1_funnel.fsx = docs\6_1_funnel.fsx
80+
docs\6_2_funnel_area.fsx = docs\6_2_funnel_area.fsx
7981
docs\7_0_polar-charts.fsx = docs\7_0_polar-charts.fsx
8082
docs\7_1_windrose-charts.fsx = docs\7_1_windrose-charts.fsx
8183
docs\8_0_parallel-categories.fsx = docs\8_0_parallel-categories.fsx

Diff for: RELEASE_NOTES.md

+2
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
* [Add Waterfall Chart](https://github.com/plotly/Plotly.NET/commit/4d93598aa03a965abc75007aea2885ff4d282059)
2828
* [Add ScatterGeo, PointGeo, LineGeo Charts](https://github.com/plotly/Plotly.NET/commit/4865c5ac0356bfb2465422a2352e18c4fce018c3)
2929
* [Add HeatmapGL, thanks [@Joott](https://github.com/Joott)](https://github.com/plotly/Plotly.NET/commit/b39f4705b86653aebf8ccb0fadf5d12b89150848)
30+
* [Add Funnel Chart, thanks [@Joott](https://github.com/Joott)](https://github.com/plotly/Plotly.NET/commit/aae24a780e88d74786f25854559ff44c7350d035)
31+
* [Add FunnelArea Chart, thanks [@Joott](https://github.com/Joott)](https://github.com/plotly/Plotly.NET/commit/126f5513afcc259ba2945ffe32aaeb987a1ded71)
3032

3133
**Minor Additions/fixes:**
3234

Diff for: docs/6_1_funnel.fsx

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
(**
2+
---
3+
title: Funnel Charts
4+
category: Finance Charts
5+
categoryindex: 7
6+
index: 2
7+
---
8+
*)
9+
10+
(*** hide ***)
11+
12+
(*** condition: prepare ***)
13+
#r "nuget: Newtonsoft.JSON, 12.0.3"
14+
#r "../bin/Plotly.NET/netstandard2.0/Plotly.NET.dll"
15+
16+
(*** condition: ipynb ***)
17+
#if IPYNB
18+
#r "nuget: Plotly.NET, {{fsdocs-package-version}}"
19+
#r "nuget: Plotly.NET.Interactive, {{fsdocs-package-version}}"
20+
#endif // IPYNB
21+
22+
(**
23+
# Funnel Charts
24+
25+
[![Binder]({{root}}img/badge-binder.svg)](https://mybinder.org/v2/gh/plotly/Plotly.NET/gh-pages?filepath={{fsdocs-source-basename}}.ipynb) 
26+
[![Script]({{root}}img/badge-script.svg)]({{root}}{{fsdocs-source-basename}}.fsx) 
27+
[![Notebook]({{root}}img/badge-notebook.svg)]({{root}}{{fsdocs-source-basename}}.ipynb)
28+
29+
*Summary:* This example shows how to create funnel charts in F#.
30+
31+
let's first create some data for the purpose of creating example charts:
32+
*)
33+
34+
let y = [|"Sales person A"; "Sales person B"; "Sales person C"; "Sales person D"; "Sales person E"|]
35+
let x = [|1200.; 909.4; 600.6; 300.; 80.|]
36+
37+
(**
38+
Funnel charts visualize stages in a process using length-encoded bars. This trace can be used to show data in either a part-to-whole
39+
representation wherein each item appears in a single stage, or in a "drop-off" representation wherein each item appears in each stage
40+
it traversed. See also the [FunnelArea]({{root}}/6_2_funnel_area.html) chart for a different approach to visualizing funnel data.
41+
*)
42+
43+
open Plotly.NET
44+
45+
// Customize the connector lines used to connect the funnel bars
46+
let connectorLine = Line.init (Color="royalblue", Dash=StyleParam.DrawingStyle.Dot, Width=3.)
47+
let connector = FunnelConnector.init(Line=connectorLine)
48+
49+
// Customize the outline of the funnel bars
50+
let line = Line.init(Width=2.,Color="3E4E88")
51+
52+
// create a funnel chart using custom connectors and outlines
53+
let funnel =
54+
Chart.Funnel (x,y,Color="59D4E8", Line=line, Connector=connector)
55+
|> Chart.withMarginSize(Left=100)
56+
57+
(*** condition: ipynb ***)
58+
#if IPYNB
59+
funnel
60+
#endif // IPYNB
61+
62+
(***hide***)
63+
funnel |> GenericChart.toChartHTML
64+
(***include-it-raw***)

Diff for: docs/6_2_funnel_area.fsx

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
(**
2+
---
3+
title: FunnelArea Charts
4+
category: Finance Charts
5+
categoryindex: 7
6+
index: 3
7+
---
8+
*)
9+
10+
(*** hide ***)
11+
12+
(*** condition: prepare ***)
13+
#r "nuget: Newtonsoft.JSON, 12.0.3"
14+
#r "../bin/Plotly.NET/netstandard2.0/Plotly.NET.dll"
15+
16+
(*** condition: ipynb ***)
17+
#if IPYNB
18+
#r "nuget: Plotly.NET, {{fsdocs-package-version}}"
19+
#r "nuget: Plotly.NET.Interactive, {{fsdocs-package-version}}"
20+
#endif // IPYNB
21+
22+
(**
23+
# FunnelArea Charts
24+
25+
[![Binder]({{root}}img/badge-binder.svg)](https://mybinder.org/v2/gh/plotly/Plotly.NET/gh-pages?filepath={{fsdocs-source-basename}}.ipynb) 
26+
[![Script]({{root}}img/badge-script.svg)]({{root}}{{fsdocs-source-basename}}.fsx) 
27+
[![Notebook]({{root}}img/badge-notebook.svg)]({{root}}{{fsdocs-source-basename}}.ipynb)
28+
29+
*Summary:* This example shows how to create funnel area charts in F#.
30+
31+
let's first create some data for the purpose of creating example charts:
32+
*)
33+
34+
let values = [|5; 4; 3; 2; 1|]
35+
let text = [|"The 1st"; "The 2nd"; "The 3rd"; "The 4th"; "The 5th"|]
36+
37+
(**
38+
FunnelArea charts visualize stages in a process using area-encoded trapezoids.
39+
This trace can be used to show data in a part-to-whole representation similar to a "pie" trace,
40+
wherein each item appears in a single stage. See also the the [Funnel]({{root}}/6_1_funnel.html) chart for a different approach
41+
to visualizing funnel data.
42+
*)
43+
44+
open Plotly.NET
45+
46+
let line = Line.init (Color="purple", Width=3.)
47+
48+
let funnelArea =
49+
Chart.FunnelArea(Values=values, Text=text, Line=line)
50+
51+
(*** condition: ipynb ***)
52+
#if IPYNB
53+
funnelArea
54+
#endif // IPYNB
55+
56+
(***hide***)
57+
funnelArea |> GenericChart.toChartHTML
58+
(***include-it-raw***)
59+

Diff for: src/Plotly.NET/Playground.fsx

+53-24
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,57 @@
4949
open Plotly.NET
5050
open GenericChart
5151

52+
// Funnel examples adapted from Plotly docs: https://plotly.com/javascript/funnel-charts/
53+
let funnel =
54+
let y = [|"Sales person A"; "Sales person B"; "Sales person C"; "Sales person D"; "Sales person E"|]
55+
let x = [|1200.; 909.4; 600.6; 300.; 80.|]
56+
let line = Line.init(Width=2.,Color="3E4E88")
57+
let connectorLine = Line.init (Color="royalblue", Dash=StyleParam.DrawingStyle.Dot, Width=3.)
58+
let connector = FunnelConnector.init(Line=connectorLine)
59+
Chart.Funnel (x,y,Color="59D4E8", Line=line, Connector=connector)
60+
|> Chart.withMarginSize(Left=100)
61+
|> Chart.Show
62+
63+
let funnelArea =
64+
let values = [|5; 4; 3; 2; 1|]
65+
let text = [|"The 1st"; "The 2nd"; "The 3rd"; "The 4th"; "The 5th"|]
66+
let line = Line.init (Color="purple", Width=3.)
67+
Chart.FunnelArea(Values=values, Text=text, Line=line)
68+
|> Chart.Show
69+
70+
let funnelArea2 =
71+
let labels = [|1;2;2;3;3;3|]
72+
Chart.FunnelArea(Labels=labels)
73+
|> Chart.Show
74+
75+
let yAxis =
76+
Axis.LinearAxis.init(
77+
Title = "Y",
78+
Showline = true,
79+
Range = StyleParam.Range.MinMax (0.0, 2.0),
80+
Tickvals = [0.0 .. 2.0],
81+
Ticktext = [ "zero"; "one"; "two" ]
82+
)
83+
84+
Chart.Range(
85+
[1;2],
86+
[1;1],
87+
[0.0;0.53622183],
88+
[1.0;2.0],
89+
StyleParam.Mode.None,
90+
Name = "",
91+
LowerName = "Lower",
92+
UpperName = "Upper",
93+
Labels = [])
94+
|> Chart.withY_Axis (yAxis)
95+
|> GenericChart.mapiTrace (fun i t ->
96+
match i with
97+
| 0 -> t |> Trace.TraceStyle.TextLabel ["upperOne";"upperTwo"]
98+
| 1 -> t |> Trace.TraceStyle.TextLabel ["lowerOne";"lowerTwo"]
99+
| 2 -> t
100+
)
101+
|> Chart.Show
102+
52103
let testAnnotation =
53104
Annotation.init(X=System.DateTime.Now, Y=0,Text="test")
54105

@@ -125,7 +176,7 @@ let xAxis =
125176
tmp?showline <- true
126177
tmp
127178

128-
let yAxis =
179+
let yAxis2 =
129180
let tmp = Axis.LinearAxis()
130181
tmp?title <- "yAxis"
131182
tmp?showgrid <- false
@@ -135,7 +186,7 @@ let yAxis =
135186
let layout =
136187
let tmp = Layout()
137188
tmp?xaxis <- xAxis
138-
tmp?yaxis <- yAxis
189+
tmp?yaxis <- yAxis2
139190
tmp?showlegend <- true
140191
tmp
141192

@@ -572,25 +623,3 @@ let doughnut1 =
572623
)
573624
|> Chart.Show
574625

575-
// Funnel examples adapted from Plotly docs: https://plotly.com/javascript/funnel-charts/
576-
let funnel =
577-
let y = [|"Sales person A"; "Sales person B"; "Sales person C"; "Sales person D"; "Sales person E"|]
578-
let x = [|1200.; 909.4; 600.6; 300.; 80.|]
579-
let line = Line.init(Width=2.,Color="3E4E88")
580-
let connectorLine = Line.init (Color="royalblue", Dash=StyleParam.DrawingStyle.Dot, Width=3.)
581-
let connector = FunnelConnector.init(Line=connectorLine)
582-
Chart.Funnel (x,y,Color="59D4E8", Line=line, Connector=connector)
583-
|> Chart.withMarginSize(Left=100)
584-
|> Chart.Show
585-
586-
let funnelArea =
587-
let values = [|5; 4; 3; 2; 1|]
588-
let text = [|"The 1st"; "The 2nd"; "The 3rd"; "The 4th"; "The 5th"|]
589-
let line = Line.init (Color="purple", Width=3.)
590-
Chart.FunnelArea(Values=values, Text=text, Line=line)
591-
|> Chart.Show
592-
593-
let funnelArea2 =
594-
let labels = [|1;2;2;3;3;3|]
595-
Chart.FunnelArea(Labels=labels)
596-
|> Chart.Show

0 commit comments

Comments
 (0)