A Conditional Image is an image that can be altered based on numeric, categorical, or text inputs. The fill and image can be automatically set to better depict the data it is representing.
Examples
Conditional images can be conditioned on a single value, R output, table, or variable. The examples below are conditioned on an R output that is linked to a combo box, allowing you to change the image in real-time.
Conditional images can either use images provided by Displayr or link to custom images stored online.
Conditional Image with Displayr Images
Displayr provides a variety of built-in pictures and icons that can be used in conditional images. The example below shows how conditional images can be used to present satisfaction data.
Create a Conditional Image with Displayr images
1. From the toolbar, go to Visualization
> Pictographs > Conditional Image.
2. In the object inspector
under Data > Data Source > Data source, select the method to condition the image.
3. From the Format tab in the object inspector
, go to Image > Image type, select Displayr images from the dropdown.
4. Set your conditions by customizing the Default image and Threshold options.
Conditional Image with Custom Images
Any image can be included in a conditional image as long as it has a URL. The example below shows how logos and icons can be altered depending on the input.
Create a Conditional Image with custom images
1. From the toolbar, go to Visualization
> Pictographs > Conditional Image.
2. In the object inspector
under Data > Data Source > Data source, select the method to condition the image.
3. 3. From the Format tab in the object inspector
, go to Image > Image type, select Custom images from the dropdown.
4. Set your conditions by pasting image URLs into the Default image box and setting the Threshold options.
Object Inspector Options
The following is an explanation of the options available in the Object Inspector for this specific visualization. Refer to Visualization Options for general chart formatting options.
Data/Inputs
DATA SOURCE
One of the following options:
Type or paste value
Use an existing R output
Table
Variable - Average
Variable - Sum
Variable - Percentage
Variable - Most frequent
Format/OUTPUT
Image type Either Displayr images or Custom images. If Displayr images is chosen, then the users can choose from the dropdown of available images, which can be re-colored. If Custom images, then users can enter a URL to their own image.
Threshold 1 A value which the input data will be compared with to determine the image to show. If the input data is numeric or ordered, the thresholds should be numeric values supplied in increasing order. If the input data is categorical or text, then categories can be supplied in any order. Any number of thresholds can be supplied.
Image 1 The image to show if the input value is equal to Threshold i (for text or categorical) or equal to and greater than Threshold i (for numeric or ordered inputs).
See Visualization - Number Options for other options.
In the examples above, we used Type or paste value for simplicity, but users can also link to variables or other outputs that can automatically update.