The Insights Module in Directus allows you to rapidly build a no-code analytics dashboard and set up key data metrics in just minutes. Each dashboard starts with a blank drag-and-drop canvas where you can add and organize different Panels, such as Labels, Lists, Metrics, and Time Series, to quickly and easily build out customized insights. The Directus Insights Module can be extended, customized, and modified for teams that require highly advanced and specialized analytics.
In this article, we’ll dive into the latest Directus Insights dashboard overhaul, starting with the GitHub pull request: Refactor Insights Dashboard to use a single query #12960, where our team of developers worked with several contributors to merge 70+ related commits.
Before this update, dashboards individually reloaded their panels after every change. Since each panel made its own request to the API, this would often lead to hitting the rate limiter. This led to a slow and taxing experience editing dashboards. The goal of this overhaul was to optimize the loading times and the caching strategy within Insights, also making room for new features such as auto-reloading, real-time WebSockets, and global variables.
Project Overview, Goals and Changes
Work in April of 2022, moving through R&D, testing, and final polish over the following few months. Other developers started taking notice, “Seems very helpful… Does this PR mean the 30 Metric Panels I currently have that load asynchronous will load together once?” That's right! And this approach also means that we can cache the results of the whole dashboard, so the overall experience is greatly improved. 🎉
Now, the dashboard makes one single query for all data, which resolves the main issue of being rate limited. After that broad initial query, if query parameters on a panel change, the dashboard makes a smaller, scoped query only for that specific panel’s data.
More importantly, this laid the groundwork for other big updates also released for Insights. Notably, we’ve built out new interactive panels allowing users to update the dashboard's global variables. This allows for exciting new capabilities, such as adding “Date Range” dropdowns to control all Time Series at once, tailoring the dashboard based on a chosen Customer, or other dynamic dashboards leveraging user-controlled variables.
The Directus team is currently working on developing several new insight panel types, including bar charts, pie charts, meters, and more. These new options will be released to the Directus Cloud service soon.
Visit our Directus Insights Docs and set up your Dashboard.