@@ -26,6 +26,9 @@ empty_axis <- list(
26
26
title = " "
27
27
)
28
28
29
+ # for centering camera/lighting on the center of the storm paths
30
+ xyzmean <- list (x = .41 , y = - .71 , z = 0.57 )
31
+
29
32
# A 3D globe implemented with 3D lines and a spherical surface
30
33
# Note that the globe has a radius of 1, but project the lines with
31
34
# a radius of 1.001 so that we appear on top of the surface
@@ -56,7 +59,13 @@ globe <- plot_ly(height = 500) %>%
56
59
# NOTE: you can map a value to surfacecolor to encode, say air temp..
57
60
# TODO: perhaps there is a better way to specify a constant surfacecolor?
58
61
colorscale = list (c(0 , " white" ), c(1 , " white" )),
59
- showscale = FALSE , hoverinfo = " none"
62
+ showscale = FALSE , hoverinfo = " skip" ,
63
+ lightposition = xyzmean ,
64
+ contours = list (
65
+ x = list (highlight = FALSE ),
66
+ y = list (highlight = FALSE ),
67
+ z = list (highlight = FALSE )
68
+ )
60
69
) %> %
61
70
layout(
62
71
showlegend = FALSE ,
@@ -65,7 +74,7 @@ globe <- plot_ly(height = 500) %>%
65
74
yaxis = empty_axis ,
66
75
zaxis = empty_axis ,
67
76
aspectratio = list (x = 1 , y = 1 , z = 1 ),
68
- camera = list (eye = list ( x = .41 , y = - .71 , z = 0.57 ) )
77
+ camera = list (eye = xyzmean )
69
78
)
70
79
)
71
80
0 commit comments