简体   繁体   中英

No Arrows on DiagrammeR Sequence Diagram

There are no arrows on the lines in DiagrammeR mermaid sequence diagrams in R. I get this result when running locally and also when hosting the code on shinyapps.io

First just copying the example code here: http://rich-iannone.github.io/DiagrammeR/mermaid.html#sequence-diagrams into RStudio and running shows no arrows. Note the arrows in the diagram in the link.

So I created the following Shiny presentation and pushed it to Shinyapps here: https://mattbrigida.shinyapps.io/seq_ex/seq_diag_example.Rmd#2

---
title: "Sequence Diagram Example Presentation"
author: "Matt Brigida"
affiliation: 
date: "03/10/2016"
output: ioslides_presentation
runtime: shiny
smaller: true
---

## 

```{r, echo=FALSE, message=FALSE, warning=FALSE, error=FALSE}
library(shiny)
library(DiagrammeR)

ui = shinyUI(fluidPage(
titlePanel("No Arrows on Shinyapps"),

fluidRow(
    column(12, numericInput("test", "Does Nothing", value = 1))
    ),
fluidRow(
    column(12,
           DiagrammeROutput('diagram2', width = "100%")
           )
    )
    )
           )
server = function(input, output){

    output$diagram2 <- renderDiagrammeR({
        mermaid("
sequenceDiagram
X->>Y: No Arrows when run locally
Y->>X: No arrows when on Shinyapps
X-->>X: why??
")
    })
}
shinyApp(ui = ui, server = server)
```

There are no arrows there also, so this must not be my local setup.

This problem may be related to: https://github.com/knsv/mermaid/issues/209 with a proposed solution: https://github.com/knsv/mermaid/blob/fcb2af780dac7f42d8e467948f311177b54a62d2/src/diagrams/sequenceDiagram/sequenceRenderer.js#L231-L235

however I am not sure how to incorporate this potential fix into my shiny apps to render the arrows? Any ideas?

Running locally:

  • DiagrammeR version 0.8.2
  • R 3.2.3
  • x86_64 GNU/Linux
  • Chromium 49.0.2623.87

This problem has been fixed in DiagrammeR version 0.8.3 which is available from GitHub. Adding

devtools::install_github('rich-iannone/DiagrammeR')

in the app, so it pulls the library from GitHub instead of CRAN, solved the problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM