hafen / trelliscopejs

TrelliscopeJS R Package
https://hafen.github.io/trelliscopejs
Other
262 stars 36 forks source link

Pokemon and TrelliscopeJS - Blank Viewer, No Images #112

Closed valmetisrinivas closed 3 years ago

valmetisrinivas commented 3 years ago

I have executed the below code both in 'R' console (RGui(64bit)) as well as in Rstudio. I am getting blank Trelliscope viewer with 801 panels (1-18 screens) but there are no images. It is just blank screen. WHat is going wrong here? Appreciate inputs.


library(readr)
library(dplyr)
library(trelliscopejs)
pok <-
  read_csv("https://raw.githubusercontent.com/hafen/pokRdex/master/pokRdex_mod.csv") %>%
  mutate_at(vars(matches("_id$")), as.character)

pok %>%
  mutate(panel = img_panel(url_image)) %>%
  trelliscope("pokemon", nrow = 3, ncol = 6)
valmetisrinivas commented 3 years ago

I have downloaded the images (all are in .png format) 001 and used image_panel_local() on the images. Still the same result. I have observed the downloaded images (though the data is downloaded) are not opening with Paint, Photo Editor etc., simple tools. This could be the reason. There seems to be some problem with the picture format (sample image 001 attached).

valmetisrinivas commented 3 years ago

0 First, I understood that I have to set the mode to "wb" while importing the CSV for the binary encapsulation.

The, after several trial and error attempts, I have discovered that I need to add "state" variable with a list of labels of "pokemon" and "pokdex" 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 "gapminder" dataset (which is, unlike "pokemon dataset", not about images), we do not need to create "state" variable.

So if we change the trelliscope() function code in the original issue with the below code, will work. trelliscope(p, name="pokemon", nrow=3, ncol=6, state = list(labels = c("pokemon", "pokedex")))