# NOT RUN {
# The URL below has been chunked to comply with CRAN
# requirements; the use of file.path is optional and not required
# for this component.
if (interactive()) {
library(dash)
app <- Dash$new()
app$layout(
htmlDiv(list(
"Resize your browser window to see the image source change based on the browser width",
htmlBr(),
htmlPicture(
list(
htmlSource(
media = "(min-width: 1000px)",
srcSet = "https://apod.nasa.gov/apod/image/1907/FishheadNebula_Pham_2401.jpg"
),
htmlImg(
src = "https://apod.nasa.gov/apod/image/1907/ngc3576_campbell_1824.jpg"
)
)
)
)
)
)
app$run_server()
}
# }
Run the code above in your browser using DataLab