This article explains what a dependency graph is, how to view it, how to navigate using the dependency graph, and how to use it to identify bottlenecks in your code.
The dependency graph and how to view it
Outputs in Displayr can be either fixed - such as images and text. Or, they can be dependent on data, such as visualizations, calculations, and tables. When the output is dependent on data, you can right-click on the edge of the output and choose Dependency Graph from the context menu, Displayr shows you the dependency graph used to calculate the output and any downstream outputs.
The screenshot below shows a page in the Supermarket Department NPS dashboard. The NPS promoter score (NPS) breakdown clustered pie chart is selected, and the dependency graph is shown at the bottom.
The dependency graph above shows that:
- The selected chart is named chart.2.
- chart.2 is calculated from a table called table.Q12r3_3_2.Bakery.by.Bakery.
- table.Q12r3_3_2.Bakery.by.Bakery is calculated from two variables: Q12r2_3_2: Bakery and Bakery.
- The two variables are from the data file Shopping.sav.
Using the dependency graph to navigate
You can navigate by clicking on nodes in the dependency graph. For example, the screenshot below shows the dependency graph from above, after table.Q12r3_3_2.Bakery.by.Bakery has been clicked on.
The dependency graph shows you which objects in a document depend on which other objects. When you click on the objects, you can then inspect their properties in the object inspector to work out how the actual calculation is performed. For example, the example below shows that the word cloud depends on the variables Reasons for being a detractor: Bakery and Detractors: Bakery, and we can see in the object inspector that Detractors: Bakery is used to filter Reasons for being a detractor: Bakery.
To examine any code within a calculation, variable, or data set, see How to Troubleshoot R Code in Displayr.