Concept: Static Insights in Dataiku

Static insights are data files that are created in Dataiku DSS notebooks and recipes using code, and that can then be rendered on dashboards.

Like webapps, static insights allow coders to create visualizations that are not natively found in Dataiku DSS. These visualizations can then be published on a dashboard and consumed by other users. Unlike webapps, however, static insights are generally stand-alone charts.

../../../_images/static-insights.png

Create a Static Insight

You can leverage any code library in a Jupyter notebook or code recipe to create custom visualizations in Dataiku DSS. You can then display your figure inline with Jupyter notebooks, or better yet by publishing them as consumable static insights in dashboards.

Save a Chart

Dataiku DSS allows you to save a figure from any library as an HTML object or image.

To save a figure as a static insight, you can use the dataiku.insights.save_data() function.

dataiku.insights.save_data(id, payload, content_type, label=None, project_key=None, encoding=None)
../../../_images/custom-static-insight.png

Publish a Static Insight on a Dashboard

Once saved, your figure will appear in the Insights page and can then be published to a dashboard from the Actions menu, by clicking Add Insight.

../../../_images/publish-static-insight.png

You can also publish a figure from the dashboard directly, by clicking the green + Add Insight button and selecting “Static insights” from the menu.

../../../_images/publish-static-insight-dashboard.png

Each published Plotly chart retains its full zoom/pan/select/export capabilities.

Refresh a Static Insight With a Scenario

You can refresh static insights automatically by using a scenario to re-run the dataiku.insights() function. This can be done:

  • by using an “Export notebook” scenario step to refresh the code generating and saving the chart in a Jupyter notebook;

  • with a regular “Build” scenario step to refresh the code in a Dataiku DSS recipe; or

  • as a custom Python scenario step.

../../../_images/refresh-chart-in-scenario.png

This article introduced the concept of static insights, and how you can leverage static insights to display custom visualizations in Jupyter notebooks and dashboards. Now you can create and share your own consumable static insights in Dataiku DSS!