Concept | Static insights#

Static insights are data files created in Dataiku notebooks and recipes using code. You can render them on dashboards.

Like webapps, static insights allow coders to create visualizations that aren’t natively found in Dataiku. You can then publish these visualizations on a dashboard so that other users can consume them. Unlike webapps, however, static insights are typically 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. 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 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. You can publish it 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. You can do this:

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

  • With a regular Build / Train scenario step to refresh the code in a Dataiku 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!