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 realtime.
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 inbuilt 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. Go to Insert > Visualization > Conditional Image
- 2. Under Inputs > DATA SOURCE > Data source, select the method to condition the image
- 3. Under Inputs > OUTPUT > Image type, select Displayr images from the dropdown
- 4. Set your conditions by customizing the 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. Go to Insert > Visualization > Conditional Image
- 2. Under Inputs > DATA SOURCE > Data source, select the method to condition the image
- 3. Under Inputs > OUTPUT > Image type, select Custom images from the dropdown
- 4. Set your conditions by pasting image URLs into the 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.
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
- One of the following options:
-
OUTPUT
- Image type Either Displayr images or Custom images. If Displayr images is chosen then the users can chose 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 i 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 i 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 which can automatically update.