process-analytics / bpmn-visualization-R

A R package for visualizing process execution data on BPMN diagrams
https://process-analytics.github.io/bpmn-visualization-R/
Apache License 2.0
16 stars 4 forks source link

[FEAT] Support usage in Shiny Apps #23

Closed tbouffard closed 3 years ago

tbouffard commented 3 years ago

Note: this is supported by the experimental implementation

See http://www.htmlwidgets.org/develop_intro.html#r-binding See #22 for documentation

tbouffard commented 3 years ago

✔️ Tested with commit 0192a9d1

image

# Install and load packages
install.packages("shiny")
library(shiny)
devtools::install_github("process-analytics/bpmn-visualization-R")
library(bpmnVisualization)

displayBpmn <- function() {
    bpmn_file <- system.file("examples/Travel_Booking.bpmn", package = "bpmnVisualization")
    overlays <- list(bpmnVisualization::create_overlay("_6-203", "9"))
    bpmnVisualization::display(bpmn_file, overlays = overlays)
}

ui <- shinyUI(fluidPage(
    titlePanel("Display bpmn diagrams with execution data"),
    bpmnVisualizationOutput('bpmnContainer')
  )
)

server = function(input, output) {
    # renderBpmnVisualization is the R bridge function to the html widgets
    output$bpmnContainer <- renderBpmnVisualization({ displayBpmn() })
}

shinyApp(ui = ui, server = server)
tbouffard commented 3 years ago

Fully working so closing.