flourish | R Documentation |
Create a graph using Flourish's API (https://developers.flourish.studio/api/introduction/).
flourish(
chart_type = NULL,
chart_description = NULL,
base_visualisation_id = NULL,
template_id = NULL,
template_version_number = NULL,
api_key = Sys.getenv("FLOURISH_API_KEY")
)
chart_type |
Required - a chart type string for each graph in Flourish's library. Preferred usage compared to |
chart_description |
Optional - a screen-reader description. A text alternative to the visual content that will only be visible to screen-readers, e.g. “The line chart shows China consistently higher than the other countries since 1990”. Do no replicate your title, since that will also be read by screenreaders. |
base_visualisation_id |
Optional - provide the numerical ID of an existing public (published) Flourish visualisation to reference it's configuration |
template_id |
Optional - the Flourish template ID, found at https://app.flourish.studio/@flourish. Use if you cannot use |
template_version_number |
Optional - the template's version number. Also found at https://app.flourish.studio/@flourish. Use if you cannot use |
api_key |
Required - our API key which can be generated within your profile account. Defaults to Sys.getenv("FLOURISH_API_KEY"). |
A Flourish chart
try(
flourish(
chart_type = "scatter", api_key = Sys.getenv("FLOURISH_API_KEY")
) |>
bind_scatter_data(
data = subset(gapminder, year == 2007),
y = "gdpPercap", x = "lifeExp"
)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.