Build and Save Visualizations

Whenever you have interesting data sets that are instrumental to addressing your research questions, and you have decided to visualize that data, saving the visualization to a study is a great way to share your results with fellow scientists. The added benefit of saving a visualization is that a track record is created at the same time that demonstrates how you arrived at this data, so that you or others can reproduce your findings. Note that the input data of a visualization is also saved as a separate file and is committed to HISE. 

When you commit a visualization to a study, the IDE instance used is being recorded. This includes all aspects of that IDE instance, including the input data, the code, the resulting data used to drive the visualization, the visualization itself, and the IDE image details (but note that the home/jupyter directory won't be saved). The resulting trace is saved to a study so that you and all other study users can return to this instance later. Note that in the study you can see the relationship between a visualization and its IDE instance (if applicable).

When visualizations are saved to a study, it is by default saved in "draft" mode. You can use this draft mode to review the results with your collaborators. If you are not quite satisfied with the visualization you can delete it and contribute an improved visualization. Once you are happy with the result, you can switch the visualization to "final". Note that only final visualizations can be used in publications.

There are two paths to saving visualizations. To create single figures, you can use either the R or Python SDK. To create complex visualizations with multiple graphs and or interactivity such as dropdown-based selections, you can use the Python SDK to construct the complex visualizations but you can pre-process the data in either R or Python.


Simple Visualizations

Visualizations involving single figures can be built using either an R or Python IDE instance. These simple visualizations are Plotly based, and includes support (in R) for the popular ggplot library. 

The best place to start is by going to the examples folder in your HISE IDE instance and looking for the Plotly subfolder - there is one under "Python" and another one under "R".

In either folder you will find notebooks with lots of example figures that you can use as the basis, supplying your own dataframes. In addition, it will show how to save visualizations to a study, either by using an UI widget to facilitate parameter value selection or by manually providing the parameter. 


Complex Visualizations

Visualizations involving multiple figures and/or interactive can be built using a Python IDE instance. These visualizations are Dash based. However, to ensure rapid rendering of the figures and a great user experience, data should be loaded as-is without processing whenever possible. Any preprocessing of data needed to render the data set for the visualizations can be done in either R or Python.

The best place to start is by going to the examples folder in your HISE IDE instance and looking for the Dash Application subfolder. There is a ReadMe.md file which you want to open with "Markdown Preview".  The ReadMe provides an elaborate explanation on the concepts and approach to complex visualizations, and will guide you through the various notebooks showing sample code.