## ----include = FALSE----------------------------------------------------------
knitr::opts_chunk$set(collapse = TRUE, comment = "#>")

## ----hhs-video, echo = FALSE, results = "asis"--------------------------------
in_pkgdown <- identical(Sys.getenv("IN_PKGDOWN"), "true") ||
  isTRUE(getOption("pkgdown.in_pkgdown"))

if (in_pkgdown) {
  cat('
<div class="dragmapr-demo-video">
  <video controls preload="metadata" poster="../hhs-placeholder-shapes-poster.png" src="../hhs-placeholder-shapes-demo.mp4">
    <p>
      Your browser does not support embedded video.
      <a href="../hhs-placeholder-shapes-demo.mp4">Download the HHS placeholder shapes demo video.</a>
    </p>
  </video>
</div>
')
} else {
  cat("[Watch the HHS placeholder shapes demo on the pkgdown site](https://prigasg.github.io/dragmapr/articles/hhs-placeholder-shapes-demo.html).")
}

## ----eval = FALSE-------------------------------------------------------------
# library(dragmapr)
# 
# hhs <- example_hhs_layout()
# 
# drag_map_prototype(
#   hhs$states,
#   region_col = "hhs_region",
#   labels = hhs$labels,
#   region_offsets = hhs$region_offsets,
#   label_offsets = hhs$label_offsets,
#   region_palette = hhs$region_colors,
#   show_legend = TRUE,
#   legend_title = "HHS region",
#   open = interactive()
# )

## ----eval = FALSE-------------------------------------------------------------
# if (interactive()) {
#   shiny::runApp(system.file(
#     "examples",
#     "shiny_spatial_studio.R",
#     package = "dragmapr"
#   ))
# }

