rich-iannone / DiagrammeR

Graph and network visualization using tabular data in R
https://rich-iannone.github.io/DiagrammeR/
Other
1.7k stars 248 forks source link

No output when use includeMarkdown in Shiny #68

Open happyshows opened 9 years ago

happyshows commented 9 years ago

Hi,

I am attempting to use renderUI {includeMarkdown(render(".Rmd"))} to generate a diagram. The following Rmd is fine when ran standalone. But there's no output running through shiny.

"Index.Rmd"

library(DiagrammeR)
DiagrammeR("
  graph LR;
    A-->B;
    A-->C;
    C-->E;
    B-->D;
    C-->D;
    D-->F;
    E-->F;
")

"server.R" library(shiny) library(shinydashboard) library(DiagrammeR)

function(input, output, session) {
output$ui_framework <- renderUI({ includeMarkdown(rmarkdown::render("index.Rmd",quiet=TRUE,clean=TRUE)) }) }

"ui.R" dashboardPage(skin="black", dashboardHeader( ),
dashboardSidebar( sidebarMenu( menuItem("Design Flow",tabName = "tab_framework") ) ), dashboardBody( tabItems( tabItem("tab_framework",uiOutput("ui_framework")) ) ) )

happyshows commented 9 years ago

Also, standalone Rmd does not seem to work without the runtime: shiny in header section?

dmpe commented 9 years ago

Have same problem when rendering graph in shiny presentation, any ideas @rich-iannone ?

i.e. I get

parse error with 
graph TD
  A[Start]-->B[Einarbeitung in R]
  B-->H[u.a.  z.B. in Shiny]
  A-->C[Explorative Datenanalyse]
  C-->D[Korrelation]
  D-->E[Normalverteilung]
  E-->F[Potenz Transformation]
  F-->G[Regression]

when having

library(DiagrammeR)

mermaid("
graph TD
  A[Start]-->B[Einarbeitung in R]
  B-->H[u.a.  z.B. in Shiny]
  A-->C[Explorative Datenanalyse]
  C-->D[Korrelation]
  D-->E[Normalverteilung]
  E-->F[Potenz Transformation]
  F-->G[Regression]
")