Path: blob/main/doc/explanation/api/examples/stocks_reactive.md
2014 views
Stock Explorer - Reactive API
Before launching into the application code we will first declare some components of the app that will be shared, including the title of the app, a set of stock tickers, a function to return a dataframe given the stock ticker
and the rolling mean window_size
, and another function to return a plot given those same inputs:
This example demonstrates how APIs in Panel differ, to see the same app implemented using a different API visit:
The reactive programming model relies on the user (a) explicitly instantiating widgets, (b) declaring how those widgets relate to the function arguments (using the bind
function), and (c) laying out the widgets and other components explicitly. In principle we could reuse the get_plot
function from above here but for clarity we will repeat it: