flourish: Plot a Flourish graph.

View source: R/flourish.R

flourishR Documentation

Plot a Flourish graph.

Description

Create a graph using Flourish's API (https://developers.flourish.studio/api/introduction/).

Usage

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")
)

Arguments

chart_type

Required - a chart type string for each graph in Flourish's library. Preferred usage compared to template_id and template_version.

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 chart_type.

template_version_number

Optional - the template's version number. Also found at https://app.flourish.studio/@flourish. Use if you cannot use chart_type.

api_key

Required - our API key which can be generated within your profile account. Defaults to Sys.getenv("FLOURISH_API_KEY").

Value

A Flourish chart

Examples

try(
  flourish(
    chart_type = "scatter", api_key = Sys.getenv("FLOURISH_API_KEY")
  ) |> 
  bind_scatter_data(
    data = subset(gapminder, year == 2007), 
    y = "gdpPercap", x = "lifeExp"
  )
 )

flourishcharts documentation built on Oct. 30, 2024, 9:07 a.m.