Skip to content

Commit 5983d6c

Browse files
committed
fix streamtube docs, improve 3D docs, add flatshading to mesh constructor
1 parent a7e0031 commit 5983d6c

File tree

5 files changed

+28
-33
lines changed

5 files changed

+28
-33
lines changed

docs/03_2_3d-mesh-plots.fsx

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -65,16 +65,10 @@ let c = Array.init 50 (fun _ -> rnd.NextDouble())
6565
open Plotly.NET.TraceObjects
6666

6767
let mesh3d =
68-
Trace3D.initMesh3D
69-
(fun mesh3d ->
70-
mesh3d?x <- a
71-
mesh3d?y <- b
72-
mesh3d?z <- c
73-
mesh3d?flatshading <- true
74-
mesh3d?contour <- Contours.initXyz(Show=true)
75-
mesh3d
76-
)
77-
|> GenericChart.ofTraceObject true
68+
Chart.Mesh3D(
69+
a,b,c,
70+
FlatShading = true
71+
)
7872

7973
(*** condition: ipynb ***)
8074
#if IPYNB

docs/03_4_3d-streamtube-plots.fsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,12 @@ let streamTube =
5252
u = (tubeData.["u"] |> Series.values),
5353
v = (tubeData.["v"] |> Series.values),
5454
w = (tubeData.["w"] |> Series.values),
55-
Starts =
55+
TubeStarts =
5656
StreamTubeStarts.init(
5757
X = Array.init 16 (fun _ -> 80),
5858
Y = [20;30;40;50;20;30;40;50;20;30;40;50;20;30;40;50],
5959
Z = [0;0;0;0;5;5;5;5;10;10;10;10;15;15;15;15]
60-
),
61-
ColorScale = StyleParam.Colorscale.Viridis
60+
)
6261
)
6362

6463

docs/03_5_3d-volume-plots.fsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,7 @@ let volume =
7070
Opacity=0.1,
7171
Surface=(Surface.init(Count=17)),
7272
IsoMin=0.1,
73-
IsoMax=0.8,
74-
ColorScale = StyleParam.Colorscale.Viridis
73+
IsoMax=0.8
7574
)
7675

7776
(*** condition: ipynb ***)

docs/03_6_3d-isosurface-plots .fsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,7 @@ let isoSurface =
7373
X = (CapFill.init(Show=false)),
7474
Y = (CapFill.init(Show=false))
7575
),
76-
Surface = Surface.init(Count=5),
77-
ColorScale = StyleParam.Colorscale.Viridis
76+
Surface = Surface.init(Count=5)
7877
)
7978

8079
(*** condition: ipynb ***)

src/Plotly.NET/ChartAPI/Chart3D.fs

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -527,29 +527,31 @@ module Chart3D =
527527
[<Optional;DefaultParameterValue(null)>] ?ColorScale : StyleParam.Colorscale,
528528
[<Optional;DefaultParameterValue(null)>] ?ShowScale : bool,
529529
[<Optional;DefaultParameterValue(null)>] ?ColorBar : ColorBar,
530+
[<Optional;DefaultParameterValue(null)>] ?FlatShading : bool,
530531
[<Optional;DefaultParameterValue(true)>] ?UseDefaults : bool
531532
) =
532533

533534
let useDefaults = defaultArg UseDefaults true
534535

535536
Trace3D.initMesh3D (
536537
Trace3DStyle.Mesh3D(
537-
X = x,
538-
Y = y,
539-
Z = z,
540-
?I = I ,
541-
?J = J ,
542-
?K = K ,
543-
?Name = Name ,
544-
?ShowLegend = ShowLegend,
545-
?Opacity = Opacity ,
546-
?Text = Text ,
547-
?MultiText = MultiText ,
548-
?Color = Color ,
549-
?Contour = Contour ,
550-
?ColorScale = ColorScale,
551-
?ShowScale = ShowScale ,
552-
?ColorBar = ColorBar
538+
X = x,
539+
Y = y,
540+
Z = z,
541+
?I = I ,
542+
?J = J ,
543+
?K = K ,
544+
?Name = Name ,
545+
?ShowLegend = ShowLegend,
546+
?Opacity = Opacity ,
547+
?Text = Text ,
548+
?MultiText = MultiText ,
549+
?Color = Color ,
550+
?Contour = Contour ,
551+
?ColorScale = ColorScale,
552+
?ShowScale = ShowScale ,
553+
?ColorBar = ColorBar ,
554+
?FlatShading = FlatShading
553555
)
554556
)
555557
|> GenericChart.ofTraceObject useDefaults
@@ -572,6 +574,7 @@ module Chart3D =
572574
[<Optional;DefaultParameterValue(null)>] ?ColorScale : StyleParam.Colorscale,
573575
[<Optional;DefaultParameterValue(null)>] ?ShowScale : bool,
574576
[<Optional;DefaultParameterValue(null)>] ?ColorBar : ColorBar,
577+
[<Optional;DefaultParameterValue(null)>] ?FlatShading : bool,
575578
[<Optional;DefaultParameterValue(true)>] ?UseDefaults : bool
576579
) =
577580

@@ -592,6 +595,7 @@ module Chart3D =
592595
?ColorScale = ColorScale ,
593596
?ShowScale = ShowScale ,
594597
?ColorBar = ColorBar ,
598+
?FlatShading= FlatShading,
595599
?UseDefaults= UseDefaults
596600
)
597601

0 commit comments

Comments
 (0)