> ## Documentation Index
> Fetch the complete documentation index at: https://www.canva.dev/opensource/flourish-charts/llms.txt
> Use this file to discover all available pages before exploring further.
# Extending the Flourish base visualization ID
```python
from flourishcharts import Flourish
from flourishcharts.datasets import gapminder
```
```r
library(flourishcharts)
```
Flourish allows users to extend visualizations created in the app online via the API. This feature uses a base visualization ID to call the original chart.
The original chart must be published via the app. Every Flourish URL pointing to a chart made in the editor cotains a unique ID - this is the base visualization ID. As an example, we published this chart using the default data source that Flourish provides: [https://public.flourish.studio/visualisation/17833871/](https://public.flourish.studio/visualisation/17833871/).
The base visualization ID is 17833871.
We are able to recreate this graph inside R or Python by passing the base visualization ID to the `flourish()` function in R or the `Flourish()` class in Python.
```python
graph = Flourish(base_visualisation_id = 17833871)
```
```r
graph <- flourish(base_visualisation_id = 17833871)
```
In addition to *recreating* it, we can also *extend* the graph by writing over data, data bindings, or chart settings.
```python
df = (
gapminder[gapminder['year'] == gapminder['year'].max()]
.assign(lifeExp=lambda x: x['lifeExp'].round())
.sort_values(by='lifeExp')
.head(10)
)
Flourish(
base_visualisation_id = 17833871
).bind_line_bar_pie_data(
data = df,
label = "country",
value = "lifeExp"
).set_line_bar_pie_details(
chart_y_axis_title = "Bottom 10 Life Expectancy in 2007"
)
```
```r
df <- gapminder |>
filter(year == max(year)) |>
mutate(lifeExp = round(lifeExp)) |>
arrange(lifeExp) |>
slice_head(n = 10)
graph |>
bind_line_bar_pie_data(
data = df,
label = "country",
value = "lifeExp"
) |>
set_line_bar_pie_details(
chart_y_axis_title = "Bottom 10 Life Expectancy in 2007"
)
```
This is a powerful notion because we can publish graphs with dummy data and write over them with *real* data locally. This is important for conserving the privacy of enterprise data.
Additionally, as the Flourish team note in their documentation - the base visualization ID enables non-technical stakeholders to build and style graphs to which technical stakeholders can then add data. Moreover, if a non-technical stakeholder were to update the graph inside the website, the changes will flow down into the API.