Shiny Drill-down: r2D3 error "Error: col_plot is not defined ReferenceError: col_plot is not defined"

Hi,

I'm attempting to create a drill-down dashboard using Shiny. I've been reading multiple content on the subject, and found this question and answer to be most relevant:
https://forum.posit.co/t/drill-down-charts-in-shiny/2512

Edgar Ruiz's answers point to two articles:

  1. https://db.rstudio.com/best-practices/dashboards/
  2. https://rviews.rstudio.com/2017/09/20/dashboards-with-r-and-databases/

, which I've thoroughly worked through and tried to implement on my own code. The Flights Dashboard https://edgarruiz.shinyapps.io/flights-dashboard/ is the example used in the articles, and I've copied the full example code of the local app https://github.com/sol-eng/db-dashboard/blob/master/local/local_app.R and tried to run it from my Rstudio.

When running both my own script and the example code (hyperlink above), I get an error:


"Error: col_plot is not defined ReferenceError: col_plot is not defined"

Is there somthing I'm missing perhaps? Alternatively, is there a better way to do drill-downs to be aware of?

Kind regards,
Malan

Hi malanbos,
I failed with the same error messages.
reason for this is that 2 javascript files are referenced in th e R-code via r2d3;

  • bar_plot.js
  • col_plot.js

these two file must be in the same directory as your R-Code
unluckily the files are not there on given links in the article : https://db.rstudio.com/best-practices/dashboards/
but I found a similiar dashboard on github and both javascript-files once downloaded work fine
here : https://github.com/Hendrik147/HRDashboard

Cu
THX1188

1 Like