Under the hood, Displayr keeps track of how items and data are dependent on one another in your Document. This map is how Displayr knows what items to recalculate when data or inputs change. You can also manually review this information in the Inputs & Outputs of an item. This is especially helpful when troubleshooting code or trying to understand how a document works. This article explains:
Inputs and outputs and how to view them
Items you create in Displayr can be either fixed — such as images and text — or dependent on data, such as calculated variables, visualizations, calculations, and tables. To see if an item is dependent on another item or if another item is dependent on it, click the item and in the floating toolbar click the Inputs & Outputs icon.
The screenshot below shows a page in the Grocery Store NPS dashboard. The NPS promoter score (NPS) breakdown clustered pie chart is selected, and its Inputs & Outputs are shown at the bottom.
The Inputs & Outputs contain two tabs:
- The Immediate tab shows only the first‑order dependencies for the current selection, that is what is directly used by and made from the item.
- The Graph tab shows all downstream and upstream dependencies of the selected output.
In this example, we've selected the clustered pie chart. At the top of Inputs & Outputs you can see its reference name is chart.2, and it takes 0.66 seconds to compute (not including the time it takes its inputs to recompute). The Immediate tab shows that chart.2 has an immediate Input - a table, named table.Q12r2_3_2.Bakery.by.Bakery that took .01s to calculate. It also shows that no other Output is dependent on chart.2. In other words, the chart isn't used as an input for any other output.
If you were to click on table.Q12r2_3_2.Bakery.by.Bakery in the Inputs column, the Inputs & Outputs would update to those of table.Q12r2_3_2.Bakery.by.Bakery. You would then see chart.2 now appears in the Outputs (along with any other items that use the table as an input). Additionally, the Inputs would show the Q12r2_3_2: Bakery and Bakery variables used to create the table (as well as any other inputs).
Instead of clicking through items in the Immediate tab, you can click the Graph tab to see all the downstream and upstream dependencies (and their calculation times) at once.
The Graph tab 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 set Shopping.sav.
Using Inputs & Outputs to navigate
You can navigate by clicking on nodes in Inputs & Outputs using either the Immediate or Graph tab.
On the Immediate tab, the panel tracks whichever item you are focused on in real time. If you click on an item listed under Inputs & Outputs , the panel updates to show that item's own inputs and outputs, and the item is selected and brought into view in the document.
On the Graph tab, the panel stays pinned to the item you originally opened Inputs & Outputs on, so the full dependency graph remains visible as you explore. This makes it easy to return to your starting point — simply switch to the Graph tab and click the original output to navigate back to it in the document.
On the Graph tab, you can also navigate by clicking nodes in Inputs & Outputs. For example, the screenshot below shows the Inputs & Outputs
from above, after table.Q12r3_3_2.Bakery.by.Bakery has been clicked on.
The Inputs & Outputs show you which objects in a document depend on which other objects. When you click on the objects, you can inspect their properties in the Properties
to see how the actual calculation is performed. For example, the word cloud depends on the variables Reasons for being a detractor: Bakery and Detractors: Bakery, and we can see in the Properties
that Detractors: Bakery is used to filter Reasons for being a detractor: Bakery.
When you are finished using Inputs & Outputs, you can click on the X in the right corner of the panel to close it. If you are looking at Inputs & Outputs
for a variable or output and there isn't anything to the right of it, then the item is not being used by any other items in the document. This is a useful way to see whether a variable or an output can be deleted.
Toggleable inputs
For the Inputs & Outputs of R Calculation outputs, items listed in the Immediate > Inputs can be toggled off if you don't want to actually use the item in the calculation. This can come up sometimes when an R function is named the same as a variable in your data set - see the protected names in R code example below. Items whose data are being used in the Calculation are denoted with the link icon
. You can unlink them, and stop their data from being used by the code, by clicking on the link icon to toggle it to a broken link icon
. If you unlink an item, your code may break if R cannot find a function or anything created inside the code with the same name. If you no longer want to use an item in the R Calculation, simply remove it from the code itself.
The picture below is an example of the links. The first Immediate Input link for the Recall - R Variable Set by Gender variable set is set to off and is not being used to calculate the output calc.1. The second output, Preferred cola by Gender, the link is set to on
and its data is being used in the output calc1.
Protected names in R Code example
Protected names in R code refer to the names of functions that R can use. If a variable or output has the name of one of the functions, Displayr automatically assumes the variable/output is used by the R calculation, which may cause problems with processing the R code. An example of this is when you have a variable or an R output called list in your data and your code contains list(). Displayr can't tell if the code is referring to R's built-in list() function, the variable, or the output called list. By unlinking the variable and output, Displayr will be sure to treat list in your code as the plain R function list().
If your code errors after toggling an input off, you may see:
{X} is referenced in your code but has been excluded as an input. To fix this, re-include it in the Inputs & Outputs pane, or remove the reference from your code.
This message only appears if the code actually fails as a result — Displayr won't warn you preemptively just for toggling something off.
Next
To examine any code within a calculation, variable, or data set, see How to Troubleshoot R Code in Displayr.
For more information on optimizing the performance of a document, see Optimize the Inputs & Outputs and How to Troubleshoot Speed and Performance Issues.
UPCOMING WEBINAR: From Chat to Agents: The New Phase of AI in Market Research