Deliver Advanced Analytics Faster with Dashboard Engine

Nicolas Kruchten
Plotly
Published in
4 min readDec 2, 2021

In 2017, Plotly open-sourced Dash and set off the low-code analytical app revolution in Python. Using Dash, data scientists and developers can build richly interactive, data-driven web applications in pure Python — “no Javascript required!” Since then, organizations around the world have adopted Dash Enterprise to build and deploy analytical apps using Dash, and the results have been stunning:

“The work we’re doing is turning heads. Nobody here, or anyone in our industry, can turn around an app in 3 days. There are full-stack apps that people make in 3 months that don’t even work right.”
–Fortune 100 Dash Enterprise Customer

In addition to providing a one-command application deployment platform and built-in workspaces for building apps, Dash Enterprise adds capabilities to Dash such as Design Kit, for building attractive, mobile-responsive applications without writing any CSS, and Snapshot Engine, for saving point-in-time views of apps and generating print-ready PDFs. Even with these capabilities, however, our customers are always pushing the envelope with two key questions:

  1. How can developers build apps even faster, with even less code?
  2. How can non-developers tailor applications to their needs without needing to involve developers at all?

To answer these questions, we are introducing Dashboard Engine: a new Dash Enterprise capability that provides a point-and-click, drag-and-drop experience for adding elements to Dash applications.

Recreating https://dash.gallery/ddk-oil-and-gas-demo/ in 4 minutes with just a mouse

Using Dashboard Engine, developers and data scientists can focus on the data processing and modelling parts of their application, and easily add a Canvas component to their layout. Developers and non-developers can then use the Canvas to build visualizations in the browser using a mix of Plotly-powered charts, controls like dropdowns, sliders and checkboxes, as well as flexible pivot tables that can aggregate millions of rows of data. The resulting Canvas configuration can then be pasted back into the source file to become a part of the app, or the app can provide saving, loading and sharing capabilities to leave the developer completely out of the loop.

Here’s what a minimal Dashboard Engine-powered app looks like which displays a blank canvas tied to an in-memory data frame:

import dash
import dash_design_kit as ddk
import dashboard_engine as dbe
# all you need is a data frame
# or a function to query one from a remote API or database
df = dbe.demo_data.world_bank()
app = dash.Dash(__name__)# configure the engine
conn_provider = dbe.PandasConnectionProvider(df)
engine = dbe.DashboardEngine(app, conn_provider)
# get a Canvas and place it in the layout
state, canvas = engine.make_state_and_canvas(dashboard_id="db")
app.layout = ddk.App(children=[state, canvas])
app.run_server()

If you’ve written a Dash app before, you might be asking yourself, “hey, where’s the layout? where are the callbacks?” In the app above, all that’s needed in the layout is the Canvas and its associated state. Canvas components come pre-wired with all the callbacks they need to display a UI to let users build their own arrangement of elements which automatically interact with each other.

The secret is crossfiltering: every element in a Dashboard Engine Canvas is automatically connected to every other element, so a selection made in one element is reflected in the others. This means that dropdowns and sliders automatically filters every chart on a page, but so does zooming in on a map or selecting bars in a bar chart.

Crossfiltering in action on 40 million rows of data.

If that sounds like too much magic, have no fear: Dashboard Engine is 100% built on Dash. This means you can just add a Canvas to an existing app without needing to modify anything, you can mix and match Dashboard Engine components with other Dash components in the same app, and you can write your own callbacks to implement custom behaviour that doesn’t fit into the crossfiltering paradigm. And because Dashboard Engine is built on Dash, it can be connected to any data source you can query from Python, be that in-memory data frames, remote databases, or the output of a model that was run on-demand.

To learn more, please watch this webinar recorded on December 8, 2022, where I showed Dashboard Engine in action!

https://tinyurl.com/2p94vs86

--

--