1

I am now more or less familiar with programming dashboards in R shiny, however have no broad knowledge of html, xml and json.

Grafana offers a plugin which allows to display diagrams created in draw.io (FlowCharting documentation), feed it live data and define how the data will interact with the diagram.

Similar to that, I would like to insert a diagram, which I created in draw.io, to a shiny app and interact with that diagram through shiny, e.g.

  • insert live data as values in specific areas in the diagram
  • highlight areas, when certain thresholds are crossed
  • show a graph, wenn the mouse hovers over an object in the diagram

For now, I created a simple diagram example in draw.io and inserted a custom action, as explained in the draw.io documentation. It contains two overlaying rectangles and a button, which shows/hides one of the rectangles, when clicked. I exported it as a html file and imported it to a shinydashbard (reproducible example below). The desired function in this simplified example would be to show and hide the red rectangle when clicking the actionButton "buttonblock1red".

library(shiny)
library(shinydashboard)

ui <- dashboardPage(
  dashboardHeader(),
  dashboardSidebar(),
  dashboardBody(
    actionButton(
      "buttonblock1red",
      "show/hide red block"
      ),
    includeHTML(
      "data/input/example.drawio.html"
    )
  )
)

server <- function(input, output) { }

shinyApp(ui, server)
MaxM
  • 11
  • 3

0 Answers0