Search⌘ K
AI Features

Updating Layouts and Styles From User Interactivity

Explore how to update Plotly graph layouts and styles based on user input in Dash. Learn to adjust titles, axes labels, themes, and color schemes interactively. This lesson helps you build more personalized and visually appealing dashboards by leveraging callback functions that enhance user interactivity.

The layout

Remember that in Plotly, we are able to adjust a variety of aspects of our graph layout. This might be in the form of adjusting the title, axes, and other more nuanced features such as annotations or grid lines and so on. It is important to note that most of the time, we update the layout and style concurrently, for example, modifying the title alignment (layout) and its font color and font family (style).

Ultimately, the ability to adjust the layout (and styles within the layout) within Plotly takes us a step closer to building dashboards in Dash that meet individual and enterprise requirements to maximize the potential for delivering superlative data insights.

Adjust title text and font

In this example, we allow the user to adjust our graph’s title. More specifically, we let users adjust font color and font family, as well as display title text. For this exercise, we will use a dataset that looks at the earnings of professional athletes across different sports.

Inside this ...