Creating Page Elements
00:00 Creating the page elements. In this first section on interactivity, you’ll concentrate on creating the elements on the page that the user will interact with and make changes to the rest of the code to allow Dash’s interactivity to function.
It expects a dictionary with labels and values.
value is the default value when the page loads.
clearable allows the user to leave this field empty if set to
className is a selector used for applying styles.
dcc.Dropdown component will be used again later on in this course and will be a common component in your own dashboard code, so it’s worth taking the time to understand the available parameters.
03:35 This CSS code allows the elements you’ve added to be styled appropriately and provides clear indication to the user of the different sections of the dashboard. Next, the graph components in the page are redefined, as seen onscreen.
04:58 Whenever a watched input is changed, the function is called again, and the page content gets updated. In fact, if you run the app at this point, you’ll see that the charts will be empty, precisely because the callback function that generates the chart is missing, so there’s nothing to display.
Become a Member to join the conversation.