Nothing
knitr::opts_chunk$set(echo = FALSE) library(tidyverse) library(robservable)
Before canvas.
robservable("@mbostock/liquidfun", include = "canvas", height = 600, width = 500)
After canvas.
With gapminder
data, graph from https://observablehq.com/@d3/multi-line-chart.
library(gapminder) data(gapminder) series <- purrr::map(unique(gapminder$country), ~{ name <- .x values <- gapminder %>% filter(country == .x) %>% pull(lifeExp) list(name = name, values = values) }) dates <- sort(unique(gapminder$year)) dates <- as.Date(as.character(dates), format = "%Y") #dates <- (dates - 1970) * 365 * 24 * 3600 * 1000 df <- list( y = "Life expectancy", series = series, dates = to_js_date(dates) ) robservable( "@d3/multi-line-chart", include = "chart", input = list(data = df, height = 1000), width = 500, height = 1000 )
And some text after.
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.