Improve your shiny dashboard with Disqus panel

[This article was first published on r-addict.com, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Getting users feedback is always a pleasant moment. In most cases in World of Open Source we are creating tools and applications for people and we love to hear that someone thinks our (generally pet) project is useful. Mostly this moment is nicer than any paycheck.

But how author can enable easy contact with him as the author of the project or application? I’ve seen home websites having special contact panel where authors provide e-mail address or links to specially prepared forums. I found that providing e-mail address isn’t the best solution as people keep asking the same questions, not knowing they were asked and, what is even WORSE, not knowing they were already answered . Sometimes it’s good to use Issue panel at the GitHub repository of the project but this works mostly for packages development and gathering users requests about improving bugs. What if I have prepared shiny dashboard and I would not like to have application under one URL and discussion panel under other (Issues at GitHub repository, forum or Google group)? I would like to have an application and panel in one place, preferably within the application. This is possible!

I have found a great and easy to implement solution to this challenge. It consists of a few clicks and one copy and paste operation. So it’s a standard in the present reality of StackOverflow.

It’s a Disqus panel! It is widely used by RStudio in their homepage of rmarkdown package. You can see it at the bottom of each sub site (and even on my blog sub websites).

To start you just click Add Disqus to your site and follow the creation instructions. If you’d better follow print-screen tutorial check the gallery that is below (visible under Mozilla Firefox).

Finally you can click on the Universal Code option to gain a code that you should include to your website if you would like to add Disqus panel. This might encourage users to provide user requests and to share their ideas without much effort.

This disqus code can be added as a plain HTML text to shinydashboard as in the following example (you can also copy code from this gist)

library(shiny)
library(shinydashboard)
ui <- dashboardPage(
  dashboardHeader(),
  dashboardSidebar(
   sidebarMenu(
    menuItem(
     "Comments",
     tabName = "disqus_here",
     icon = icon("info")
    )
   )
  ),
  dashboardBody(
     tabItems(
        tabItem(tabName = "disqus_here",
         div(id="disqus_thread",
         HTML(
"<script>
    (function() {  
        var d = document, s = d.createElement('script');
        s.src = '//CHANEL_NAME.disqus.com/embed.js';
        s.setAttribute('data-timestamp', +new Date());
        (d.head || d.body).appendChild(s);
    })();
</script>
<noscript>Please enable JavaScript to view the
<a href='https://disqus.com/?ref_noscript' rel='nofollow'>comments powered by Disqus.</a>
</noscript>"
         )
        )
      )
    ),
    div(HTML('<script id="dsq-count-scr" src="//CHANEL_NAME.disqus.com/count.js" async></script>'))
  )
) 

server <- function(input, output, session) {
}

shinyApp(ui, server)

Now you can improve your shinydashboard with disqus panel as we have done to provide easier feedback collecting at our shinydashboard in MI2 group where we present available rooms to rent in the desired localization with user constraints as price, room size and time to work.

If you think I can improve my blog or this post please use Disqus at the end of this page :)!

To leave a comment for the author, please follow the link and comment on their blog: r-addict.com.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)