Skip to content

Commit 53c8aaf

Browse files
committed
Link to interactives in video figure captions; interactives for rest of creating part
1 parent 6561a64 commit 53c8aaf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+1239
-65731
lines changed

creating-bars.Rmd

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ subplot(
1818
)
1919
```
2020

21-
```{r bars-numeric, echo = FALSE, fig.cap = "(ref:bars-numeric)"}
21+
```{r bars-numeric, echo = FALSE, fig.cap = "(ref:bars-numeric)", out.extra = 'data-url="/interactives/bars-numeric.html"'}
2222
knitr::include_graphics("images/bars-numeric.svg")
2323
```
2424

@@ -36,7 +36,7 @@ p2 <- diamonds %>%
3636
subplot(p1, p2) %>% hide_legend()
3737
```
3838

39-
```{r bars-discrete, echo = FALSE, fig.cap = "(ref:bars-discrete)"}
39+
```{r bars-discrete, echo = FALSE, fig.cap = "(ref:bars-discrete)", out.extra = 'data-url="/interactives/bars-discrete.html"'}
4040
knitr::include_graphics("images/bars-discrete.svg")
4141
```
4242

@@ -60,7 +60,7 @@ diamonds %>%
6060
hide_legend()
6161
```
6262

63-
```{r many-prices, echo = FALSE, fig.cap = "(ref:many-prices)"}
63+
```{r many-prices, echo = FALSE, fig.cap = "(ref:many-prices)", out.extra = 'data-url="/interactives/many-prices.html"'}
6464
knitr::include_graphics("images/many-prices.svg")
6565
```
6666

@@ -74,7 +74,7 @@ plot_ly(diamonds, x = ~cut, color = ~clarity) %>%
7474
add_histogram()
7575
```
7676

77-
```{r cut-by-clarity, echo = FALSE, fig.cap = "(ref:cut-by-clarity)"}
77+
```{r cut-by-clarity, echo = FALSE, fig.cap = "(ref:cut-by-clarity)", out.extra = 'data-url="/interactives/cut-by-clarity.html"'}
7878
knitr::include_graphics("images/cut-by-clarity.svg")
7979
```
8080

@@ -92,7 +92,7 @@ cc2 %>%
9292
layout(barmode = "stack")
9393
```
9494

95-
```{r cut-by-clarity-prop, echo = FALSE, fig.cap = "(ref:cut-by-clarity-prop)"}
95+
```{r cut-by-clarity-prop, echo = FALSE, fig.cap = "(ref:cut-by-clarity-prop)", out.extra = 'data-url="/interactives/cut-by-clarity-prop.html"'}
9696
knitr::include_graphics("images/cut-by-clarity-prop.svg")
9797
```
9898

@@ -105,7 +105,7 @@ p <- ggplot(data = cc) +
105105
ggplotly(p)
106106
```
107107

108-
```{r ggmosaic, echo = FALSE, fig.cap = "(ref:ggmosaic)"}
108+
```{r ggmosaic, echo = FALSE, fig.cap = "(ref:ggmosaic)", out.extra = 'data-url="/interactives/ggmosaic.html"'}
109109
knitr::include_graphics("images/ggmosaic.svg")
110110
```
111111

@@ -124,7 +124,7 @@ subplot(
124124
) %>% hide_legend()
125125
```
126126

127-
```{r cut-boxes, echo = FALSE, fig.cap = "(ref:cut-boxes)"}
127+
```{r cut-boxes, echo = FALSE, fig.cap = "(ref:cut-boxes)", out.extra = 'data-url="/interactives/bars-numeric.html"', out.extra = 'data-url="/interactives/cut-boxes.html"'}
128128
knitr::include_graphics("images/cut-boxes.svg")
129129
```
130130

@@ -136,7 +136,7 @@ plot_ly(diamonds, x = ~price, y = ~interaction(clarity, cut)) %>%
136136
layout(yaxis = list(title = ""))
137137
```
138138

139-
```{r cut-by-clarity-boxes, echo = FALSE, fig.cap = "(ref:cut-by-clarity-boxes)"}
139+
```{r cut-by-clarity-boxes, echo = FALSE, fig.cap = "(ref:cut-by-clarity-boxes)", out.extra = 'data-url="/interactives/cut-by-clarity-boxes.html"'}
140140
knitr::include_graphics("images/cut-by-clarity-boxes.svg")
141141
```
142142

@@ -159,7 +159,7 @@ plot_ly(d, x = ~price, y = ~factor(cc, lvls)) %>%
159159
layout(yaxis = list(title = ""))
160160
```
161161

162-
```{r cut-by-clarity-boxes-sorted, echo = FALSE, fig.cap = "(ref:cut-by-clarity-boxes-sorted)"}
162+
```{r cut-by-clarity-boxes-sorted, echo = FALSE, fig.cap = "(ref:cut-by-clarity-boxes-sorted)", out.extra = 'data-url="/interactives/cut-by-clarity-boxes-sorted.html"'}
163163
knitr::include_graphics("images/cut-by-clarity-boxes-sorted.svg")
164164
```
165165

creating-maps.Rmd

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ library(htmltools)
124124
browsable(tagList(map1, map2))
125125
```
126126

127-
```{r maps, echo = FALSE, fig.cap = "(ref:maps)"}
127+
```{r maps, echo = FALSE, fig.cap = "(ref:maps)", out.extra = 'data-url="/interactives/maps.html"'}
128128
knitr::include_graphics("images/maps.png")
129129
```
130130

@@ -149,7 +149,7 @@ plot_geo() %>%
149149
layout(geo = g)
150150
```
151151

152-
```{r us-density, echo = FALSE, fig.cap = "(ref:us-density)"}
152+
```{r us-density, echo = FALSE, fig.cap = "(ref:us-density)", out.extra = 'data-url="/interactives/us-density.html"'}
153153
knitr::include_graphics("images/us-density.svg")
154154
```
155155

@@ -175,7 +175,7 @@ class(world)
175175
plot_ly(world, color = I("gray90"), stroke = I("black"), span = I(1))
176176
```
177177

178-
```{r world, echo = FALSE, fig.cap = "(ref:world)"}
178+
```{r world, echo = FALSE, fig.cap = "(ref:world)", out.extra = 'data-url="/interactives/world.html"'}
179179
knitr::include_graphics("images/world.svg")
180180
```
181181

@@ -199,7 +199,7 @@ canada <- ne_states(country = "Canada", returnclass = "sf")
199199
plot_ly(canada, split = ~name, color = ~provnum_ne)
200200
```
201201

202-
```{r split-color, echo = FALSE, fig.cap = "(ref:split-color)"}
202+
```{r split-color, echo = FALSE, fig.cap = "(ref:split-color)", out.extra = 'data-url="/interactives/split-color.html"'}
203203
knitr::include_graphics("images/split-color.svg")
204204
```
205205

@@ -217,7 +217,7 @@ plot_ly(
217217
)
218218
```
219219

220-
```{r split-text, echo = FALSE, fig.cap = "(ref:split-text)"}
220+
```{r split-text, echo = FALSE, fig.cap = "(ref:split-text)", out.extra = 'data-url="/interactives/split-text.html"'}
221221
knitr::include_graphics("images/split-text.png")
222222
```
223223

@@ -249,7 +249,7 @@ p <- ggplot() +
249249
ggplotly(p)
250250
```
251251

252-
```{r canada-ggplotly, echo = FALSE, fig.cap = "(ref:canada-ggplotly)"}
252+
```{r canada-ggplotly, echo = FALSE, fig.cap = "(ref:canada-ggplotly)", out.extra = 'data-url="/interactives/canada-ggplotly.html"'}
253253
knitr::include_graphics("images/canada-ggplotly.svg")
254254
```
255255

@@ -297,7 +297,7 @@ plot_ly(us_cont) %>%
297297
colorbar(title = "Population \n 2014")
298298
```
299299

300-
```{r cartogram, echo = FALSE, fig.cap = "(ref:cartogram)"}
300+
```{r cartogram, echo = FALSE, fig.cap = "(ref:cartogram)", out.extra = 'data-url="/interactives/cartogram.html"'}
301301
knitr::include_graphics("images/cartogram.png")
302302
```
303303

@@ -324,13 +324,13 @@ plot_ly(stroke = I("black"), span = I(1)) %>%
324324
layout(showlegend = FALSE)
325325
```
326326

327-
```{r cartogram-dorling, echo = FALSE, fig.cap = "(ref:cartogram-dorling)"}
327+
```{r cartogram-dorling, echo = FALSE, fig.cap = "(ref:cartogram-dorling)", out.extra = 'data-url="/interactives/cartogram-dorling.html"'}
328328
knitr::include_graphics("images/cartogram-dorling.svg")
329329
```
330330

331331
Figure \@ref(fig:cartogram-ncont) demonstrates a non-continuous cartogram of US population in 2014 from @Olson. In contrast to the Dorling cartogram, this approach does preserve the shape of polygons. The implementation behind Figure \@ref(fig:cartogram-ncont) is to simply take the implementation of Figure \@ref(fig:cartogram-dorling) and change `cartogram_dorling()` to `cartogram_ncont()`.
332332

333-
```{r cartogram-ncont, echo = FALSE, fig.cap = "(ref:cartogram-ncont)"}
333+
```{r cartogram-ncont, echo = FALSE, fig.cap = "(ref:cartogram-ncont)", out.extra = 'data-url="/interactives/cartogram-ncont.html"'}
334334
knitr::include_graphics("images/cartogram-ncont.svg")
335335
```
336336

@@ -343,6 +343,6 @@ tiles_sf <- st_as_sf(tiles)
343343
plot_ly(tiles_sf, split = ~name)
344344
```
345345

346-
```{r cartogram-tiles, echo = FALSE, fig.cap = "(ref:cartogram-tiles)"}
346+
```{r cartogram-tiles, echo = FALSE, fig.cap = "(ref:cartogram-tiles)", out.extra = 'data-url="/interactives/cartogram-tiles.html"'}
347347
knitr::include_graphics("images/cartogram-tiles.svg")
348348
```

creating-other.Rmd

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ subplot(
2020
)
2121
```
2222

23-
```{r histogram2d, echo = FALSE, fig.cap = "(ref:histogram2d)"}
23+
```{r histogram2d, echo = FALSE, fig.cap = "(ref:histogram2d)", out.extra = 'data-url="/interactives/histogram2d.html"'}
2424
knitr::include_graphics("images/histogram2d.svg")
2525
```
2626

@@ -44,7 +44,7 @@ plot_ly(kd, x = ~x, y = ~y, z = ~count) %>%
4444
colorbar(title = "Number of diamonds")
4545
```
4646

47-
```{r heatmap-corr-diamonds, echo = FALSE, fig.cap = "(ref:heatmap-corr-diamonds)"}
47+
```{r heatmap-corr-diamonds, echo = FALSE, fig.cap = "(ref:heatmap-corr-diamonds)", out.extra = 'data-url="/interactives/heatmap-corr-diamonds.html"'}
4848
knitr::include_graphics("images/heatmap-corr-diamonds.svg")
4949
```
5050

@@ -61,7 +61,7 @@ plot_ly(x = rownames(corr), y = colnames(corr), z = corr, colors = "RdBu") %>%
6161
colorbar(limits = c(-1, 1))
6262
```
6363

64-
```{r correlation, echo = FALSE, fig.cap = "(ref:correlation)"}
64+
```{r correlation, echo = FALSE, fig.cap = "(ref:correlation)", out.extra = 'data-url="/interactives/correlation.html"'}
6565
knitr::include_graphics("images/correlation.svg")
6666
```
6767

@@ -76,7 +76,7 @@ plot_ly(mpg, x = ~cty, y = ~hwy, z = ~cyl) %>%
7676
add_markers(color = ~cyl)
7777
```
7878

79-
```{r 3D-scatterplot, echo = FALSE, fig.cap = "(ref:3D-scatterplot)"}
79+
```{r 3D-scatterplot, echo = FALSE, fig.cap = "(ref:3D-scatterplot)", out.extra = 'data-url="/interactives/3D-scatterplot.html"'}
8080
knitr::include_graphics("images/3D-scatterplot.svg")
8181
```
8282

@@ -89,7 +89,7 @@ plot_ly(mpg, x = ~cty, y = ~hwy, z = ~cyl) %>%
8989
add_paths(color = ~displ)
9090
```
9191

92-
```{r 3D-paths, echo = FALSE, fig.cap = "(ref:3D-paths)"}
92+
```{r 3D-paths, echo = FALSE, fig.cap = "(ref:3D-paths)", out.extra = 'data-url="/interactives/3D-paths.html"'}
9393
knitr::include_graphics("images/3D-paths.png")
9494
```
9595

@@ -102,7 +102,7 @@ plot_ly(mpg, x = ~cty, y = ~hwy, z = ~cyl) %>%
102102
add_lines(color = ~displ)
103103
```
104104

105-
```{r 3D-lines, echo = FALSE, fig.cap = "(ref:3D-lines)"}
105+
```{r 3D-lines, echo = FALSE, fig.cap = "(ref:3D-lines)", out.extra = 'data-url="/interactives/3D-lines.html"'}
106106
knitr::include_graphics("images/3D-lines.png")
107107
```
108108

@@ -114,7 +114,7 @@ plot_ly(mpg, x = ~cty, y = ~hwy, z = ~cyl) %>%
114114
add_lines(color = ~displ)
115115
```
116116

117-
```{r 3D-lines-groups, echo = FALSE, fig.cap = "(ref:3D-lines-groups)"}
117+
```{r 3D-lines-groups, echo = FALSE, fig.cap = "(ref:3D-lines-groups)", out.extra = 'data-url="/interactives/3D-lines-groups.html"'}
118118
knitr::include_graphics("images/3D-lines-groups.png")
119119
```
120120

@@ -134,7 +134,7 @@ plot_ly(mpg, x = ~cty, y = ~hwy, z = ~cyl) %>%
134134
)
135135
```
136136

137-
```{r 3D-axes, echo = FALSE, fig.cap = "(ref:3D-axes)"}
137+
```{r 3D-axes, echo = FALSE, fig.cap = "(ref:3D-axes)", out.extra = 'data-url="/interactives/3D-axes.html"'}
138138
knitr::include_graphics("images/3D-axes.png")
139139
```
140140

@@ -149,6 +149,6 @@ y <- seq_len(ncol(volcano)) + 500
149149
plot_ly() %>% add_surface(x = ~x, y = ~y, z = ~volcano)
150150
```
151151

152-
```{r surface, echo = FALSE, fig.cap = "(ref:surface)"}
152+
```{r surface, echo = FALSE, fig.cap = "(ref:surface)", out.extra = 'data-url="/interactives/surface.html"'}
153153
knitr::include_graphics("images/surface.png")
154154
```

creating-overview.Rmd

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ plot_ly(diamonds, x = ~cut, y = ~clarity)
2828
plot_ly(diamonds, x = ~cut, color = ~clarity, colors = "Accent")
2929
```
3030

31-
```{r intro-defaults, echo = FALSE, fig.cap = "(ref:intro-defaults)", fig.link = "/interactives/intro-defaults.html"}
31+
```{r intro-defaults, echo = FALSE, fig.cap = "(ref:intro-defaults)", out.extra = '"data-url=/interactives/intro-defaults.html"'}
3232
knitr::include_graphics("images/intro-defaults.svg")
3333
```
3434

@@ -47,7 +47,7 @@ plot_ly(diamonds, x = ~cut, color = "black")
4747
plot_ly(diamonds, x = ~cut, color = I("red"), stroke = I("black"), span = I(2))
4848
```
4949

50-
```{r intro-range, echo = FALSE, fig.cap = "(ref:intro-range)", fig.link = "/interactives/intro-range.html"}
50+
```{r intro-range, echo = FALSE, fig.cap = "(ref:intro-range)", out.extra = '"data-url=/interactives/intro-range.html"'}
5151
knitr::include_graphics("images/intro-range.svg")
5252
```
5353

@@ -114,7 +114,7 @@ diamonds %>%
114114
)
115115
```
116116

117-
```{r intro-dplyr, echo = FALSE, fig.cap = "(ref:intro-dplyr)", fig.link = "/interactives/intro-dplyr.html"}
117+
```{r intro-dplyr, echo = FALSE, fig.cap = "(ref:intro-dplyr)", out.extra = '"data-url=/interactives/intro-dplyr.html"'}
118118
knitr::include_graphics("images/intro-dplyr.png")
119119
```
120120

@@ -146,7 +146,7 @@ p <- plot_ly(diamonds, x = ~cut, color = ~clarity, colors = "Accent")
146146
plotly_json(p)
147147
```
148148

149-
```{r intro-json, echo = FALSE, fig.cap = "(ref:intro-json)", out.width="70%", fig.link = "/interactives/intro-json.html"}
149+
```{r intro-json, echo = FALSE, fig.cap = "(ref:intro-json)", out.width="70%", out.extra = '"data-url=/interactives/intro-json.html"'}
150150
knitr::include_graphics("images/intro-json.png")
151151
```
152152

@@ -191,7 +191,7 @@ p <- ggplot(diamonds, aes(x = log(carat), y = log(price))) +
191191
ggplotly(p)
192192
```
193193

194-
```{r hexbin, echo = FALSE, fig.cap = "(ref:hexbin)", fig.link = "/interactives/hexbin.html"}
194+
```{r hexbin, echo = FALSE, fig.cap = "(ref:hexbin)", out.extra = '"data-url=/interactives/hexbin.html"'}
195195
knitr::include_graphics("images/hexbin.png")
196196
```
197197

docs/animating-views.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ <h2><span class="header-section-number">14.2</span> Animation support</h2>
438438
<div class="figure" style="text-align: center"><span id="fig:profile-pyramid"></span>
439439
<iframe src="https://player.vimeo.com/video/317101075?title=0&amp;byline=0&amp;portrait=0" width="100%" height="400" frameborder="0" seamless="seamless" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>
440440
<p class="caption">
441-
FIGURE 14.5: US population projections by age and gender from 2018 to 2050. This population pyramid is implemented with thick line segments to give the appearance of bars.
441+
FIGURE 14.5: US population projections by age and gender from 2018 to 2050. This population pyramid is implemented with thick line segments to give the appearance of bars. For the interactive, see <a href="https://plotly-r.com/interactives/profile-pyramid.html" class="uri">https://plotly-r.com/interactives/profile-pyramid.html</a>
442442
</p>
443443
</div>
444444
<p>Although population pyramids are quite popular, they aren’t necessarily the best way to visualize this information, especially if the goal is to compare the population profiles over time. It’s much easier to compare them along a common scale, as done in Figure <a href="animating-views.html#fig:profile-lines">14.6</a>. Note that, when animating lines in this fashion, it can help to set <a href="https://plot.ly/r/reference/#scatter-line-simplify"><code>line.simplify</code></a> to <code>FALSE</code> so that the number of points along the path are left unaffected.</p>
@@ -453,7 +453,7 @@ <h2><span class="header-section-number">14.2</span> Animation support</h2>
453453
<div class="figure" style="text-align: center"><span id="fig:profile-lines"></span>
454454
<iframe src="https://player.vimeo.com/video/317101952?title=0&amp;byline=0&amp;portrait=0" width="100%" height="400" frameborder="0" seamless="seamless" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>
455455
<p class="caption">
456-
FIGURE 14.6: Visualizing the same information in Figure <a href="animating-views.html#fig:profile-pyramid">14.5</a> using lines rather than segments.
456+
FIGURE 14.6: Visualizing the same information in Figure <a href="animating-views.html#fig:profile-pyramid">14.5</a> using lines rather than segments. For the interactive, see <a href="https://plotly-r.com/interactives/profile-lines.html" class="uri">https://plotly-r.com/interactives/profile-lines.html</a>
457457
</p>
458458
</div>
459459

docs/arranging-views.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ <h4><span class="header-section-number">13.1.2.1</span> Scatterplot matrices</h4
470470
<div class="figure" style="text-align: center"><span id="fig:splom"></span>
471471
<iframe src="https://player.vimeo.com/video/325081084?title=0&amp;byline=0&amp;portrait=0" width="100%" height="400" frameborder="0" seamless="seamless" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>
472472
<p class="caption">
473-
FIGURE 13.7: Linked brushing in a scatterplot matrix of the iris dataset.
473+
FIGURE 13.7: Linked brushing in a scatterplot matrix of the iris dataset. For the interactive, see <a href="https://plotly-r.com/interactives/splom.html" class="uri">https://plotly-r.com/interactives/splom.html</a>
474474
</p>
475475
</div>
476476
<p>See <a href="https://plot.ly/r/splom/" class="uri">https://plot.ly/r/splom/</a> for more options related to the splom trace type.</p>
@@ -639,7 +639,7 @@ <h2><span class="header-section-number">13.3</span> Arranging many views</h2>
639639
<div class="figure" style="text-align: center"><span id="fig:trelliscope"></span>
640640
<iframe src="https://player.vimeo.com/video/325778067?title=0&amp;byline=0&amp;portrait=0" width="100%" height="400" frameborder="0" seamless="seamless" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>
641641
<p class="caption">
642-
FIGURE 13.14: Using <strong>trelliscopejs</strong> to surface high-dimensional insights related to life expectancy and GDP per capita in various countries.
642+
FIGURE 13.14: Using <strong>trelliscopejs</strong> to surface high-dimensional insights related to life expectancy and GDP per capita in various countries. For the interactive, see <a href="https://plotly-r.com/interactives/trelliscope.html" class="uri">https://plotly-r.com/interactives/trelliscope.html</a>
643643
</p>
644644
</div>
645645

0 commit comments

Comments
 (0)