Closed MayaGans closed 4 years ago
Maybe not explained properly in the code. The gio
function you have takes an argument message
when it should be named data
.
gio <- function(data, width = NULL, height = NULL, elementId = NULL) {
# forward options using x
x = list(
data = data
)
# create widget
htmlwidgets::createWidget(
name = 'gio',
x,
width = width,
height = height,
package = 'gio',
elementId = elementId
)
}
I just tried again and everything works fine. Are you sure you have the dependencies (7.1)?
I just invited you as a collab to a private repo where I believe I have all the correct code up to 7.4.1? [I looked at the code you pasted and my code above but don't see any differences, am I missing something? In the code above I think I did change it from message
to data
?] It totally could be an error on my end but thought I should bring it up just in case!
And of course there's no errors in the console - thanks a lot JS 😆
I'm so sorry you had to go through this, I hope it's not a typo in my book.
In your DESCRIPTION
you have
Package: geo
And htmlwidgets relies on the package name in the htmlwidgets::createWidget
function (in the gio
) function to load up the dependencies.
Use this and it will work (I just tried)
# create widget
htmlwidgets::createWidget(
name = 'gio',
x,
width = width,
height = height,
package = 'geo', #Â needs package name
elementId = elementId
)
(Or alternatively you could change the package name of course)
Yay! Although slightly embarrassed.... Glad the error was on my end and not yours - thanks for looking into it!
Not at all! My pleasure :) I'm the one thanking you for so thoroughly going through the book: thank you very much!
I am trying to use this code to render the arc data in our geo widget but I only see a blank page - what am I missing?
R code from 7.3
Updated JS code 7.4.1
Now shouldn't this work?
What am I missing?