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

## ----demo-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="../dragmap-demo-poster.png" src="../dragmap-demo.mp4">
    <p>
      Your browser does not support embedded video.
      <a href="../dragmap-demo.mp4">Download the dragmapr demo video.</a>
    </p>
  </video>
</div>
')
} else {
  cat("[Watch the dragmap demo video on the pkgdown site](https://prigasg.github.io/dragmapr/articles/dragmap-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,
#   open = interactive()
# )
# 
# render_dragged_map(
#   hhs$states,
#   region_offsets = hhs$region_offsets,
#   region_col = "hhs_region",
#   labels = hhs$labels,
#   label_offsets = hhs$label_offsets,
#   region_palette = hhs$region_colors,
#   region_labels = hhs$region_names,
#   title = "US Map by HHS Regions"
# )

