mattflor / chorddiag

R interface to D3 chord diagrams
158 stars 44 forks source link

Integration with opencpu #12

Open FinScience opened 7 years ago

FinScience commented 7 years ago

Hi, I am trying to create an opencpu app that would display the chordiagram created using chorddiag. Is there any way to do this. For static plots if I return print(plot1), it is working fine, but not for htmlwidgets objects.

Any help on this would be great.

mattflor commented 7 years ago

Sorry, I don't have any experience with the opencpu framework. Maybe you can use something like htmlwidgets::saveWidget() to save the chord diagram widget to HTML and then display this in your opencpu app?

efotopoulou commented 5 years ago

This is the way i did it ....if it helps...

mychord <- chorddiag::chorddiag(m, groupColors = groupColors, groupnamePadding = 20)
mychord_to_retunr <- htmlwidgets::saveWidget(mychord, file = "mychord.html")
return (mychord_to_retunr)

Then i got is as a rest opencpu response like this: /ocpu/tmp/x0034c4ecd1d175/files/mychord.html