Skip to main content

Ad-hoc Dashboards

· 3 min read
Siva Dirisala
Creator of SQL Frames

Most data analysis workflows involve a) exploring data with ad-hoc reports b) identifying key metrics and trends c) creating dashboards consolidating important metrics and repeating the process.

Dashboards offer rich interactivity that single reports cannot and benefit the end users of the dashboards. But don't ad-hoc reports created during the data exploration stage also need dashboards for the same level of interaction? The problem with most analytics tools is that building dashboard is a ceremonial action that involves creating a new dashboard entity, giving it a name, determining the layout and then adding reports one by one and reordering with drag-n-drop all making it a lengthy process. Is there some way to make it extremely easy to create dashboards for ad-hoc reports as well with out all that extra baggage? The answer is yes, and I call it ad-hoc dashboards that are perfect in a low-code environment.

SQL Frames is designed with fast data exploration in mind and that includes taking care of all the UI wiring with simplicity.

REPL

The SQL Frames low-code IDE, REPL application, makes it easy to write a simple snippet of the analysis and get the results. Any object returned is displayed using its corresponding view if there is one registered for that object type. So all one has to do is just return something. See examples below.

value

Any value returned from the REPL script is displayed on its own.

Loading...

array

It is possible to return multiple values so that they are displayed one below the other by returning an array.

Loading...

js object

It is possible to create tabs by simply creating a js object.

Loading...

json

By returning a full fledged json that is put together on-the-fly it is possible to create very complex UI layouts.

Loading...

Widget Layouts

Just like Jupyter widgets, SQL Frames also comes with the ability to create advanced UI using various widgets along with data frames. I will cover about widgets some other time but in this post I want to talk mainly about the layout capabilities.

First, the widgets functionality is accessed within the REPL using the special variable W.

Horizontal layout

Earlier we saw that returning an array displays everything ordered vertically. What if the requirement is to organize something horizontally? This is accomplished using W.h() as shown below.

Loading...

Vertical layout

You guessed it, this is achieved by simply calling W.v().

Loading...

Ad-hoc dashboard example

Let's use all the knowledge above to create some realistic example.

Loading...

Conclusion

Hope this illustrates how SQL Frames design is influenced to make the life of a data analyst as easy as possible and more importantly help them focus on solving the critical business requirements instead of having to worry about how to stitch together the UI as they explore the data.