hafen / htmlwidgetsgallery

66 stars 63 forks source link

new widget vivagRaph #5

Closed keeganhines closed 9 years ago

keeganhines commented 9 years ago

incorporation of new widget for interactive network visualization using the VivaGraph js library.

hafen commented 9 years ago

Thanks for the PR. One thing I check is whether I can install and run examples. When trying to run the example in your README, I get a blank browser page with the following:

[Error] SyntaxError: JSON Parse error: Unexpected identifier "object"
    parse (vivagRaph.js, line 18)
    renderValue (vivagRaph.js, line 18)
    (anonymous function) (htmlwidgets.js, line 514)
    forEach ([native code], line 0)
    forEach (htmlwidgets.js, line 55)
    (anonymous function) (htmlwidgets.js, line 447)
    forEach ([native code], line 0)
    forEach (htmlwidgets.js, line 55)
    staticRender (htmlwidgets.js, line 445)
    (anonymous function) (htmlwidgets.js, line 524)

Here's my session info:

R version 3.2.0 (2015-04-16)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.10.3 (Yosemite)

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] vivagRaph_0.2.0

loaded via a namespace (and not attached):
[1] htmlwidgets_0.5 htmltools_0.2.6 yaml_2.1.13     digest_0.6.8   
[5] jsonlite_0.9.16
keeganhines commented 9 years ago

thanks @hafen - I'm having trouble recreating this error, but I'm looking into it

keeganhines commented 9 years ago

I'm still unable to replicate the error and am a bit stumped - @timelyportfolio, does anything come to mind?

hafen commented 9 years ago

Interesting. I tried again with the same error on all browsers. @keeganhines, can you send your sessionInfo? Are you using htmlwidgets 0.5? If not, that could be the issue.

keeganhines commented 9 years ago

yes i think that's exactly the issue, I see the problem now with updated htmlwidgets. Looking into it

hafen commented 9 years ago

Oh good. Yes a few things changed in 0.5 - you probably just need to make sure your object is getting serialized to the proper json expected on the js side. Good to update since people doing a fresh install will get the latest htmlwidgets from CRAN.

keeganhines commented 9 years ago

great, thanks for pointing this out, I hadn't noticed this change with 0.5 - yes, the json serialization seems to exactly the problem.

keeganhines commented 9 years ago

and there was also a change in the VivaGraph js API which I hadn't noticed, and the requisite changes to this R package have been made, so this should be good to go now with the most recent commit of vivagRaph and of htmlwidgets.

hafen commented 9 years ago

Looks great. Thanks!