hrbrmstr / metricsgraphics

:chart_with_upwards_trend: htmlwidget interface to the MetricsGraphics.js D3 chart library
http://hrbrmstr.github.io/metricsgraphics/
Other
132 stars 35 forks source link

Use with Reactive Data in Shiny #27

Open majerus opened 9 years ago

majerus commented 9 years ago

I am new to metricsgrphics, but it looks like a useful tool. I am trying to integrate a histogram into a shiny dashboard.

The following works, but the data is static:

output$hist <- renderMetricsgraphics(

dataset %>% mjs_plot(var1, width=300, height=300) %>% mjs_histogram() %>% mjs_labs(x_label=sprintf("x label")) )

The following does not work:

output$hist <- renderMetricsgraphics(

zipsInBounds() %>% mjs_plot(var1, width=300, height=300) %>% mjs_histogram() %>% mjs_labs(x_label=sprintf("x label")) )

Thanks for any guidance/updates.

hrbrmstr commented 9 years ago

can you do a dput(head(dataset)) and dput(head(zipsInBounds())) so I can see data types? - thx