Giter Club home page Giter Club logo

Comments (40)

rich-iannone avatar rich-iannone commented on May 24, 2024

@vbakella thanks for using and testing the package! I'll try to reproduce here on my end and try to fix. If you should find some other clues as to why this is happening, let me know here.

from diagrammer.

timelyportfolio avatar timelyportfolio commented on May 24, 2024

shiny is difficult with mermaid, but I think I have a working version in an experimental branch fix/mermaid-shiny. If possible, @rich-iannone and @vbakella, could you test?

devtools::install_github("timelyportfolio/DiagrammeR@fix/mermaid-shiny")

I have noticed it doesn't work well with RStudio Viewer, but worked well in Chrome.

If ok, I'll submit pull. Thanks.

from diagrammer.

rich-iannone avatar rich-iannone commented on May 24, 2024

Going to test it now. Thanks!

from diagrammer.

rich-iannone avatar rich-iannone commented on May 24, 2024

I seem to get 'parse error' each time. I believe I put in a valid mermaid diagram spec each time. It should work just with the graph definition ("graph LR").

shiny-test

from diagrammer.

timelyportfolio avatar timelyportfolio commented on May 24, 2024

That is the issue I mentioned with RStudio Viewer. Can you try in the browser?

from diagrammer.

rich-iannone avatar rich-iannone commented on May 24, 2024

I did try it in Safari (in screenshot). I'll also try in Firefox.

from diagrammer.

timelyportfolio avatar timelyportfolio commented on May 24, 2024

Ok, I see it now. Maybe it only works with Chrome then. hmmm...

from diagrammer.

rich-iannone avatar rich-iannone commented on May 24, 2024

Maybe. Same problem with latest Firefox on Mac.
diagrammer_shiny_firefox mac _test

from diagrammer.

timelyportfolio avatar timelyportfolio commented on May 24, 2024

Well, it does need a ; or line break, so does graph LR; give you no error and a blank space?

from diagrammer.

rich-iannone avatar rich-iannone commented on May 24, 2024

Pretty sure I exhausted all possibilities. I'll try again shortly with a ; and a space.

from diagrammer.

timelyportfolio avatar timelyportfolio commented on May 24, 2024

ok, I think I see the problem. Let me play a bit.

from diagrammer.

timelyportfolio avatar timelyportfolio commented on May 24, 2024

Does a non-shiny static mermaid work? If it is what I think it is, then it should not.

from diagrammer.

rich-iannone avatar rich-iannone commented on May 24, 2024

I'll check that out once I get into the office. About 20 min.

Sent from my iPhone

On Jan 26, 2015, at 7:22 AM, timelyportfolio [email protected] wrote:

Does a non-shiny static mermaid work? If it is what I think it is, then it should not.


Reply to this email directly or view it on GitHub.

from diagrammer.

rich-iannone avatar rich-iannone commented on May 24, 2024

Okay. Tested it out! It's fine with the space following the ;. Sorry about that.

from diagrammer.

timelyportfolio avatar timelyportfolio commented on May 24, 2024

Will you try again with my newest push? I think it will be more robust. Still does not work in RStudio viewer though :(

devtools::install_github("timelyportfolio/DiagrammeR@fix/mermaid-shiny")

from diagrammer.

rich-iannone avatar rich-iannone commented on May 24, 2024

I'm sorry but I just went to the field so I'm away from that test computer. Might have to do this by the end of the day.

Sent from my iPhone

On Jan 26, 2015, at 8:48 AM, timelyportfolio [email protected] wrote:

Will you try again with my newest push? I think it will be more robust. Still does not work in RStudio viewer though :(

devtools::install_github("timelyportfolio/DiagrammeR@fix/mermaid-shiny")

Reply to this email directly or view it on GitHub.

from diagrammer.

vbakella avatar vbakella commented on May 24, 2024

Hi,

I installed the fix mentioned above. I am able to generate Mermaid and GraphViz plots as per the examples. However, a Shiny program with a single DiagrammeR call is not working - gives a parser error.

Here is the code I tried:
library(shiny)
library(DiagrammeR)

ui = shinyUI(fluidPage(
textInput('spec', 'Diagram Spec', value = ""),
DiagrammeROutput('diagram')
))

server = function(input, output){
output$diagram <- renderDiagrammeR(DiagrammeR(
input$spec
))
}

shinyApp(ui = ui, server = server)

dd

from diagrammer.

timelyportfolio avatar timelyportfolio commented on May 24, 2024

Try separating by ; so

graph LR; a;

from diagrammer.

rich-iannone avatar rich-iannone commented on May 24, 2024

Okay, back to the test computer. Tried this:

graph LR; F-->R

Got this:

parse error with graph LR; F-->R
s.rules is undefined

from diagrammer.

timelyportfolio avatar timelyportfolio commented on May 24, 2024

Well unexpected but not surprising. So the old behavior from this morning did work on all your browsers? I'll revert back to that if so.

from diagrammer.

rich-iannone avatar rich-iannone commented on May 24, 2024

The earlier build was okay. Perhaps revert to that and continue a bit later with testing of the Shiny app. Also, @jjallaire, is the new Preview release of RStudio the one that supports syntax highlighting of Graphviz and mermaid graphs?

from diagrammer.

jjallaire avatar jjallaire commented on May 24, 2024

No the preview doesn't yet support syntax highlighting, for that you need the daily build which you can get from here: http://www.rstudio.org/download/daily/desktop/

from diagrammer.

rich-iannone avatar rich-iannone commented on May 24, 2024

Still a problem for me. Get a DOM exception 12. Tried in both RStudio and in browser.

dom_exception_12

from diagrammer.

jjallaire avatar jjallaire commented on May 24, 2024

I can't repro this but I'll bet if I get more info on your configuration I
will be able to:

(1) What OS and exact version of RStudio are you running?

(2) Could you share the source code of your example from above?

On Wed, Jan 28, 2015 at 12:05 AM, Richard Iannone [email protected]
wrote:

Still a problem for me. Get a DOM exception 12. Tried in both RStudio and
in browser.

[image: dom_exception_12]
https://cloud.githubusercontent.com/assets/5612024/5932705/13168aa2-a668-11e4-9063-ac129d6bb442.png


Reply to this email directly or view it on GitHub
#51 (comment)
.

from diagrammer.

timelyportfolio avatar timelyportfolio commented on May 24, 2024

What about without shiny? Wonder why it worked before. Hmmmm...

from diagrammer.

jjallaire avatar jjallaire commented on May 24, 2024

I tried it without Shiny (in RStudio and in R Markdown). I could have
constructed a Shiny example but wanted to make sure I was using the exact
code that Rich was before proceeding.

On Wed, Jan 28, 2015 at 7:07 AM, timelyportfolio [email protected]
wrote:

What about without shiny? Wonder why it worked before. Hmmmm...


Reply to this email directly or view it on GitHub
#51 (comment)
.

from diagrammer.

timelyportfolio avatar timelyportfolio commented on May 24, 2024

Let's wait to hear from @rich-iannone. Works for me static with RStudio Viewer, Chrome, and Firefox. Works for me shiny with Chrome and Firefox and not on RStudio (0.99.179). I'll try the nightly build to see if it fixes.

from diagrammer.

rich-iannone avatar rich-iannone commented on May 24, 2024

I'll be able to test this shortly...

from diagrammer.

timelyportfolio avatar timelyportfolio commented on May 24, 2024

Does not work for me in shiny context with newest RStudio viewer. @jjallaire, if you want to try on yours with shiny, the code above allows a quick test:

library(shiny)

ui = shinyUI(fluidPage(
textInput('spec', 'Diagram Spec', value = ""),
DiagrammeROutput('diagram'),
DiagrammeROutput('diagram2')
))

server = function(input, output){
output$diagram <- renderDiagrammeR(DiagrammeR(
input$spec
))
output$diagram2 <- renderDiagrammeR(DiagrammeR(
input$spec
))

}

shinyApp(ui = ui, server = server)

from diagrammer.

rich-iannone avatar rich-iannone commented on May 24, 2024

Yesterday's testing that didn't work for me used the following:

Jan 26 build of RStudio for Mac
Latest version of Safari/Mac

from diagrammer.

timelyportfolio avatar timelyportfolio commented on May 24, 2024

What about static?

from diagrammer.

rich-iannone avatar rich-iannone commented on May 24, 2024

Just to be sure I'm testing this correctly, how do you run a static test?

from diagrammer.

timelyportfolio avatar timelyportfolio commented on May 24, 2024

non-shiny, so mermaid(...)

from diagrammer.

rich-iannone avatar rich-iannone commented on May 24, 2024

Ah, of course :) (morning time). I'll test again shortly once I get onto my train.

from diagrammer.

rich-iannone avatar rich-iannone commented on May 24, 2024

Okay was able to test.
— static: works
— Shiny in RStudio: doesn't work
— Shiny in Safari 8.0.2 (10600.3.5) Mac: doesn't work
— Shiny in Firefox 35.0 Mac: works

from diagrammer.

rich-iannone avatar rich-iannone commented on May 24, 2024

Here is the screen grab of it working in Firefox:

firefox 35 0_mac

from diagrammer.

timelyportfolio avatar timelyportfolio commented on May 24, 2024

Ok, that is helpful, so we have contained it. I thought it was caused by the css changes, but actually it is happening somewhere else (in mermaid.init it seems). I'll report back.

from diagrammer.

timelyportfolio avatar timelyportfolio commented on May 24, 2024

It seems the error comes due to a security constraint with the websocket. Don't have the skillset to fix this, so @rich-iannone up to you how we proceed unless @jjallaire has other ideas.

image

from diagrammer.

rich-iannone avatar rich-iannone commented on May 24, 2024

Ah, good investigative work. I think we should simply proceed and state the compatibility amongst browsers in a table and update that as we go on.
@jjallaire, what do you think?

from diagrammer.

jjallaire avatar jjallaire commented on May 24, 2024

Yes, that sounds fine to me!

On Wed, Jan 28, 2015 at 11:07 AM, Richard Iannone [email protected]
wrote:

Ah, good investigative work. I think we should simply proceed and state
the compatibility amongst browsers in a table and update that as we go on.
@jjallaire https://github.com/jjallaire, what do you think?


Reply to this email directly or view it on GitHub
#51 (comment)
.

from diagrammer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.