hafen / trelliscopejs

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

img_panel not showing up when state is set. #30

Open alberthkcheng opened 7 years ago

alberthkcheng commented 7 years ago

First of all thank you for your awesome packages.

My data frame has two column: name (chr) and image (img_panel) So, I try to do the following:

df_clean <- data_frame(name = "google", image = img_panel("https://www.google.com.hk/logos/doodles/2017/international-womens-day-2017-5658396607905792-res.png"))

trelliscope(df_clean, name = "Card Explorer", panel_col = "image",
            width = 320, height = 320, nrow = 3, ncol = 6)

trelliscope(df_clean, name = "Card Explorer", panel_col = "image",
            width = 320, height = 320, nrow = 3, ncol = 6,
            state = list(labels = c("name")))

The first one works fine. For the second one I got a blank panel and all labels are not checked. After I manually tick the 'name' in labels, both images and labels showed up.

hafen commented 7 years ago

Interesting. If you could provide a few rows of df_clean so I can test it out that would be helpful. For example, pasting the output of dput(head(df_clean, 20)).

Also, for the second plot, could you see if there are any JavaScript errors in the viewer? On Chrome, to get to the JavaSicrpt console, go to View -> Developer -> JavaScript Console. Does anything look amiss there?

alberthkcheng commented 7 years ago

please try with this one: df_clean <- data_frame(name = "google", image = img_panel("https://www.google.com.hk/logos/doodles/2017/international-womens-day-2017-5658396607905792-res.png"))

alberthkcheng commented 7 years ago
Uncaught TypeError: Cannot read property 'type' of undefined
    at trelliscope.min.js:105079
    at w (trelliscope.min.js:105079)
    at r.render (trelliscope.min.js:20157)
    at f._renderValidatedComponentWithoutOwnerOrContext (trelliscope.min.js:20157)
    at f._renderValidatedComponent (trelliscope.min.js:20157)
    at f._updateRenderedComponent (trelliscope.min.js:20157)
    at f._performComponentUpdate (trelliscope.min.js:20157)
    at f.updateComponent (trelliscope.min.js:20157)
    at f.receiveComponent (trelliscope.min.js:20157)
    at Object.receiveComponent (trelliscope.min.js:14071)