- Small speed-ups from better algorithm/data structure choices can make big differences when that task executes millions of times.
- Test coverage makes refactoring easier, prevents regressions.
---
### Unique Considerations for Data Viz
- Typically little to no ongoing reuse/maintenance.
- Visualization itself unlikely to be performance bottleneck compared to data manipulation.
- Focus is on **immediate visual output**, testing de-emphasized.
- Often written by solo developer, even in larger organizations.
Code quality still matters, but your main goal should be code that you can trust is correct. Testing, documentation, and the "right way" are less essential.
---
## Dashboards
![bg fit left](plotly-dash.png)
Long-lived data visualizations that typically run against a central repository of data.
You can use the same techniques & tools, or custom dashboard-focused tools like Tableau or Dash.
Key difference: You will likely need some degree of dynamic refresh (instead of loading CSV/JSON load data from DB/API). Comes with caching and other performance considerations.
---
## Dashboard Psuedocode
```
every interval {
data = update()
visualize(data)
}
```
Can make use of animation to provide context:
- scrolling time series
- animated dials to show directional changes
---
## Are Dashboards Bad?
Dashboards saw a surge in popularity a decade or so ago, and there are now plenty of bad dashboards out there.
Golden rule of dashboards: **answer a question & make them actionable**.
Too often people just throw all their data on a dashboard.
*OK, I can see that 6 errors occurred in the last 24 hours...*
- Is that a lot? **Show trends where appropriate!**
- What can I do? **Provide links/action items!**
Without this focus, dashboards become decorations.
---
## Style Guide
It can be helpful to create or build from a style guide. Even for your own work.