Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reconfigure baseurl usage for interactive figures #157

Open
ect123 opened this issue Jun 10, 2022 · 3 comments
Open

reconfigure baseurl usage for interactive figures #157

ect123 opened this issue Jun 10, 2022 · 3 comments
Assignees

Comments

@ect123
Copy link
Contributor

ect123 commented Jun 10, 2022

non-gif interactive figures use code chunks that do not render urls in LaTex output. Each one should be reset to use the the following syntax:

{r 9-sink-fill, fig.cap = fig_cap, out.width= "75%", echo = FALSE}
    if (knitr:::is_latex_output()) { fig_cap <- paste0("Animated process of filling sinks in a DEM. Pickell, CC-BY-SA-4.0. Animated figure can be viewed in the web browser version of the textbook: https://ubc-geomatics-textbook.github.io/geomatics-textbook/raster-analysis-and-terrain-modelling.html")
  knitr::include_graphics("images/09-sink-fill.png")
} else { fig_cap <- paste0("Animated process of filling sinks in a DEM. Pickell, CC-BY-SA-4.0.")
  knitr::include_graphics("images/09-sink-fill.gif")
}
@ect123 ect123 self-assigned this Jun 10, 2022
@ect123
Copy link
Contributor Author

ect123 commented Jun 10, 2022

Specifically, these figures:

  • 2-CGVD-leaflet
  • 5-situational-vulnerability-leaflet
  • 5-vegetation-diversity-leaflet
  • 7-3d-alpha-hull-deciduous
  • 7-native-land-leaflet
  • 7-3d-alpha-hull-conifer
  • 7-haida-gwaii-leaflet
  • 8-vancouver-transit-graph
  • 8-directed-graph
  • 8-vancouver-rail-transit
  • 8-stanley-park-seawall
  • 8-tree-canopy-mesh
  • 8-origin-destination
  • 8-spatial-structure-garden
  • 8-boat-marina
  • 8-connections-houses-streets
  • 8-fraser-river-flows
  • 8-least-cost-path
  • 8-reach-analysis
  • 8-closeness-centrality-UBC
  • 8-betweenness-centrality
  • 8-closeness-centrality-vancouver
  • 9-leaflet-map-layers
  • 14-dnbr-leaflet

@ect123
Copy link
Contributor Author

ect123 commented Jun 10, 2022

Several Leaflet maps will need the addition of a variable (example below using m) at the end of the code chunk (in the else condition) to build the interactive content:

if (knitr:::is_latex_output()) { fig_cap <- paste0("The difference (in meters) between the Canadian Geodetic Vertical Datum of 2013 (CGVD2013) and the Canadian Geodetic Vertical Datum of 1928 (CGVD28). Data from Natural Resources Canada and licensed under the Open Government Licence - Canada. Pickell, CC-BY-SA-4.0. Animated figure can be viewed in the web browser version of the textbook: https://ubc-geomatics-textbook.github.io/geomatics-textbook/mapping-data.html")
  knitr::include_graphics("images/02-CGVD-leaflet.PNG")
} else { fig_cap <- paste0("The difference (in meters) between the Canadian Geodetic Vertical Datum of 2013 (CGVD2013) and the Canadian Geodetic Vertical Datum of 1928 (CGVD28). Data from Natural Resources Canada and licensed under the Open Government Licence - Canada. Pickell, CC-BY-SA-4.0.")
m
}

Variable used can be found in the respective chunk of Leaflet code.

@ect123
Copy link
Contributor Author

ect123 commented Jun 12, 2022

The second Leaflet map chunk in chapter 9 (line 514) does not run - stops with the following error:

Error in leaflet() %>% addProviderTiles("Esri.WorldImagery") %>% addScaleBar(position = c("topleft")) %>%  : 
  could not find function "%>%"

Depending in the severity of the above error, I may close this issue and open a new one for this problem specifically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant