1. Visualizing databases of images
A special but often very useful use case of Trelliscope is visualizing large collections of image data. The trelliscope viewer is naturally a viewer for collections of images. In the examples so far, these images have been statistical plots, but Trelliscope can work just as easily with collections any kind of image.
2. Pokemon!
To illustrate this approach, we will use a not-very-statistical application, just for fun.
We have a dataset, called "pokemon", that contains several attributes about 801 Pokemon creatures, including their base experience points, type, hit points, etc. We can use this dataset to create an interactive visual library of Pokemon.
3. Image panels
You may have noticed that one of the variables in the data is called url_image. This variable provides a URL that points to an image for each pokemon. Suppose we want to create a display that allows us to interactively view each of the Pokemon based on their different attributes (gotta visualize 'em all!). Trelliscope provides a very simple way to do this.
4. img_panel()
To specify that a variable containing a URL pointing to an image should be used as the image for each panel in a display, we simply wrap the variable with a function image_panel(). The resulting variable will have an annotation that when passed to trelliscope will tell it to use this variable as the panel variable. It's as easy as that!
5. A database of images
You can think of a Trelliscope display using image panels as a database of images. Here, our pokemon data frame is a database with various attributes about each Pokemon and a pointer to an image URL for each one. The resulting display allows us to query this database with respect to these attributes and see the resulting pokemon.
You could imagine much more statistical and scientific uses for this functionality, such as navigating a large number of algorithmically-classified medical images, scanning satellite imagery, or even using this as a social media navigator for platforms such as Instagram.
You can also use this approach to manually create your own set of visualizations, build a data frame index to those images, and use that to create a trelliscope display.
6. Local images
Often instead of URLs, you will have images stored locally on your computer that you want to use as image panels in a trelliscope display. To accomplish this, the images must be placed somewhere in the directory that your trelliscope display will be placed in, and then a relative path must be supplied to a function img_panel_local().
For example, suppose we were to download all of the Pokemon images to our directory "pokemon_local" and then specify our image panel column to point to the relative location within this directory. We can then create a display in this directory and have a self-contained image database.
7. Let's practice!
Let's practice using trelliscope as an interactive image viewer.