Examples
Note: the Flourish API is an enterprise-level bolt-on and not available to all customers.
Simple API example
This simple example uses d3-fetch to pull in data from a CSV file before rendering it in a Flourish template.
Flourish story API example
This example replicates the story player behavior and functionality. It adds navigation buttons, a slide count and captions, and featuring smooth transitions between slides. Click here to view the example.
Base visualization simple example
Demonstrates how to use the published visualization endpoint to directly replicate a visualization made in the app with the API. Click here to view the example.
Base visualization with overrides
Demonstrates how to use the published visualization endpoint to replicate a visualization made in the app with the API, while overriding its data, bindings, and some settings. Click here to view the example.
Control sheet basic example
This basic example demonstrates the use of a control sheet. This makes it possible to control the contents of a visualization without needing to code. Click here to view the example.
Control sheet advanced example
This advanced example demonstrates the use of a control sheet. This makes it possible to control the contents of a visualization without needing to code. Click here to view the example.
Using filters basic example
This basic example demonstrates how to use a single external filter to interact with Flourish visualizations. It also demonstrates how to download data from filtered views and download an image of the current state. Click here to view the example.
Using filters advanced example
This advanced example showcases multiple filter controls, enabling users to independently filter data across two Live API-powered charts. Click here to view the example.
API state change example
This example demonstrates how to dynamically switch between different states in a visualization based on user selections. Click here to view the example.
API line animation example
This example demonstrates animated line transitions using the Live API, smoothly updating data over time. It utilizes the base visualization method to render and update lines dynamically, featuring adjustable easing, timing, and sequential animations. Click here to view the example.
Sourcing data from a database
This example shows how to fetch data from a database, and use that data to generate visualizations using the Flourish Live API. It also demonstrates how to keep your API key secret by proxying requests to the Live API through your own server.
R/Shiny example
This is an example of how to connect the Flourish API to R's Shiny package.