Title: Why is that Trelliscope viewer showing empty panels, no images?
Tags: r;trellis
Question: I have the below data frame &quot;p&quot; on Pokemon.
library(&quot;dplyr&quot;)
library(&quot;trelliscopejs&quot;)
glimpse(p)
Rows: 801
Columns: 5
$ pokemon       <chr&gt; &quot;bulbasaur&quot;, &quot;ivysaur&quot;, &quot;venusaur~
$ type_1        <chr&gt; &quot;grass&quot;, &quot;grass&quot;, &quot;grass&quot;, &quot;grass~
$ attack        <int&gt; 49, 62, 82, 100, 52, 64, 84, 130,~
$ generation_id <chr&gt; &quot;1&quot;, &quot;1&quot;, &quot;1&quot;, NA, &quot;1&quot;, &quot;1&quot;, &quot;1&quot;,~
$ url_image     <chr&gt; &quot;http://assets.pokemon.com/assets~
I am creating a panel column and then applying Trelliscope in order to access and view the pokemon images from the web (corresponding to the &quot;url_image&quot; of the dataframe). Though it is generating a viewer with 18 pages covering 801 panels as expected, all the panels are empty and I cannot see the images.
p <- p %&gt;%  mutate(panel = img_panel(url_image), pokemon = cog(val = pokemon, default_label = TRUE))
trelliscope(p, name = &quot;pokemon&quot;, ncol=6, nrow=3)
I have downloaded all the 801 images to a local folder &quot;pokemon_local&quot; and tried to view them in Trelliscope using the below code. Unfortunately, again though the Trelliscope viewer is getting generated, the panels are empty.
path <- file.path(&quot;D:/xyz/pokemon_local&quot;)
dir.create(path)
for (url in p$url_image)
download.file(url, destfile=file.path(path,basename(url)), quiet=TRUE, mode=&quot;wb&quot;)
p$image <- basename(p$url_image)
p<- mutate(p, panel=img_panel_local(image))
trelliscope(p, name=&quot;pokemon&quot;, nrow=3, ncol=6, path=path)
Can someone help with an explanation and solution?

Here is the accepted answer: After several trial and error attempts, and based on the hint provided in @Waldi 's answer, I have discovered that I need to add &quot;state&quot; variable with a list of labels of &quot;pokemon&quot; and &quot;pokdex&quot; elements. If we omit either of them, it does not work. I don't know why? By the way, several other examples I tried with &quot;gapminder&quot; dataset (which is, unlike &quot;pokemon dataset&quot;, not about images), we do not need to create &quot;state&quot; variable.
So if we change the trelliscope() function code in the question with the below code, both the options, will work.
accessing and viewing images from web url directly
trelliscope(p, name=&quot;pokemon&quot;, nrow=3, ncol=6, state = list(labels = c(&quot;pokemon&quot;, &quot;pokedex&quot;)))
accessing and viewing images stored on the local disk
trelliscope(p, name=&quot;pokemon&quot;, nrow=3, ncol=6, state = list(labels = c(&quot;pokemon&quot;, &quot;pokedex&quot;)), path=path)

Here is another answer: Pokemon dataset is available online, which facilitates testing :
library(dplyr)
library(trelliscopejs)
pok <- read.csv(&quot;https://raw.githubusercontent.com/hafen/pokRdex/master/pokRdex_mod.csv&quot;) %&gt;%
mutate_at(vars(matches(&quot;_id$&quot;)), as.character)
pok %&gt;%
mutate(panel = img_panel(url_image)) %&gt;%
trelliscope(&quot;pokemon&quot;, nrow = 3, ncol = 6,
state = list(labels = c(&quot;pokemon&quot;, &quot;pokedex&quot;)))
Just go to Sort Tab in the sidebar and select a variable to sort on  : the Pokemons appear ;-)
trelliscope Issues seem on hold since 2017, which might explain why this unexpected behaviour wasn't corrected.

{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 2, 'CommentCount': 0, 'ContentLicense': 'CC BY-SA 4.0', 'CreationDate': '2021:00:05/13/21', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<r><trellis>', 'Title': 'Why is that Trelliscope viewer showing empty panels, no images?', 'ViewCount': 135, 'id': 67522747, 'user_AboutMe': '', 'user_AccountId': 16778771.0, 'user_DisplayName': 'Srinivas', 'user_Reputation': 496.0, 'user_Views': 99.0, 'user_id': 12129443.0}}