Skip to content

Commit bfa98fe

Browse files
committed
Fix and improve 3D docs
1 parent 986a313 commit bfa98fe

File tree

3 files changed

+82
-11
lines changed

3 files changed

+82
-11
lines changed

docs/01_2_multiple-charts.fsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ let multipleTraceTypesGrid =
255255
Chart.Point([1,2; 2,3])
256256
Chart.PointTernary([1,2,3; 2,3,4])
257257
Chart.Heatmap([[1; 2];[3; 4]], ShowScale=false)
258-
Chart.Point3d([1,3,2])
258+
Chart.Point3D([1,3,2])
259259
Chart.PointMapbox([1,2]) |> Chart.withMapbox(Mapbox.init(Style = StyleParam.MapboxStyle.OpenStreetMap))
260260
[
261261
// you can use nested combined charts, but they have to have the same trace type (Cartesian2D in this case)

docs/03_0_3d-scatter-plots.fsx

+80-9
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,18 @@ index: 1
3030
3131
*Summary:* This example shows how to create three-dimensional point and line charts in F#.
3232
33-
A Scatter3d chart report shows a three-dimensional spinnable view of your data
33+
Point3D, Line3D, and Bubble3D charts are all derived from `Chart.Scatter3D` and can be generated by that function as well.
34+
However, `Chart.Point3D`, `Chart.Line3D`, or `Chart.Bubble3D` provide sensible defaults and arguments for the respective derived chart, and are recommended to use.
35+
36+
## 3D point chart
3437
*)
3538

3639
open Plotly.NET
3740

3841
let point3d =
39-
Chart.Point3d(
42+
Chart.Point3D(
4043
[1,3,2; 6,5,4; 7,9,8],
41-
Labels = ["A"; "B"; "C"],
44+
MultiText = ["A"; "B"; "C"],
4245
TextPosition = StyleParam.TextPosition.BottomCenter
4346
)
4447
|> Chart.withXAxisStyle("my x-axis", Id=StyleParam.SubPlotId.Scene 1) // in contrast to 2D plots, x and y axes of 3D charts have to be set via the scene object
@@ -55,16 +58,35 @@ point3d
5558
point3d |> GenericChart.toChartHTML
5659
(*** include-it-raw ***)
5760

61+
(**
62+
## 3D point chart with marker colorscale
63+
*)
64+
65+
let point3d2 =
66+
Chart.Point3D(
67+
[1,3,2; 6,5,4; 7,9,8],
68+
MarkerColor = Color.fromColorScaleValues [0;1;2],
69+
MultiText = ["A"; "B"; "C"],
70+
TextPosition = StyleParam.TextPosition.BottomCenter
71+
)
5872

73+
(*** condition: ipynb ***)
74+
#if IPYNB
75+
point3d2
76+
#endif // IPYNB
77+
78+
(***hide***)
79+
point3d2 |> GenericChart.toChartHTML
80+
(*** include-it-raw ***)
5981

6082
(**
61-
# 3D Line plots
83+
# 3D Line chart
6284
*)
6385

6486
let line3d =
65-
Chart.Line3d(
87+
Chart.Line3D(
6688
[1,3,2; 6,5,4; 7,9,8],
67-
Labels = ["A"; "B"; "C"],
89+
MultiText = ["A"; "B"; "C"],
6890
TextPosition = StyleParam.TextPosition.BottomCenter,
6991
ShowMarkers = true
7092
)
@@ -78,15 +100,39 @@ line3d
78100
line3d |> GenericChart.toChartHTML
79101
(*** include-it-raw ***)
80102

103+
(**
104+
## 3D line chart with line colorscale
105+
*)
106+
107+
let line3d2 =
108+
Chart.Line3D(
109+
[1,3,2; 6,5,4; 7,9,8],
110+
MultiText = ["A"; "B"; "C"],
111+
TextPosition = StyleParam.TextPosition.BottomCenter,
112+
ShowMarkers = true,
113+
LineColor = Color.fromColorScaleValues [0;1;2],
114+
LineWidth = 10.
115+
)
116+
117+
(*** condition: ipynb ***)
118+
#if IPYNB
119+
line3d2
120+
#endif // IPYNB
121+
122+
(***hide***)
123+
line3d2 |> GenericChart.toChartHTML
124+
(*** include-it-raw ***)
125+
126+
81127
(**
82128
# 3D Bubble plots
83129
*)
84130

85131
let bubble3d =
86-
Chart.Bubble3d(
132+
Chart.Bubble3D(
87133
[1,3,2; 6,5,4; 7,9,8],
88134
[10;20;30],
89-
Labels = ["A"; "B"; "C"],
135+
MultiText = ["A"; "B"; "C"],
90136
TextPosition = StyleParam.TextPosition.BottomCenter
91137
)
92138

@@ -97,4 +143,29 @@ bubble3d
97143

98144
(***hide***)
99145
bubble3d |> GenericChart.toChartHTML
100-
(*** include-it-raw ***)
146+
(*** include-it-raw ***)
147+
148+
149+
(**
150+
## 3D bubble chart with colorscale
151+
*)
152+
153+
let bubble3d2 =
154+
Chart.Bubble3D(
155+
[1,3,2; 6,5,4; 7,9,8],
156+
[10;20;30],
157+
MultiText = ["A"; "B"; "C"],
158+
TextPosition = StyleParam.TextPosition.BottomCenter,
159+
MarkerColor = Color.fromColorScaleValues [0;1;2],
160+
MarkerColorScale = StyleParam.Colorscale.Viridis
161+
)
162+
163+
(*** condition: ipynb ***)
164+
#if IPYNB
165+
bubble3d2
166+
#endif // IPYNB
167+
168+
(***hide***)
169+
bubble3d2 |> GenericChart.toChartHTML
170+
(*** include-it-raw ***)
171+

docs/03_2_3d-mesh-plots.fsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ let c = Array.init 50 (fun _ -> rnd.NextDouble())
6565
open Plotly.NET.TraceObjects
6666

6767
let mesh3d =
68-
Trace3D.initMesh3d
68+
Trace3D.initMesh3D
6969
(fun mesh3d ->
7070
mesh3d?x <- a
7171
mesh3d?y <- b

0 commit comments

Comments
 (0)