context.vars
to receive the values entered in the input form and filter the data for the chart to be returned.
In this tutorial, we also introduce how to obtain the options for the input form using SQL in addition to the above.
generate_population_data
: Generates the data used in the tutorial. In a production environment, this function can be used to fetch data. Additionally, this function can be replaced with an SQL file to fetch data from a database.filter_plotly_chart
: Filters the data generated by generate_population_data
and returns a Plotly chart.<Embed />
.