-
Notifications
You must be signed in to change notification settings - Fork 247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updated version of mermaid.js #160
Conversation
Updated version of mermaid.js
@vnijs Thanks very much! I always appreciate PRs and I accept them without hesitation about 99% of the time (and this is a good one). |
@rich-iannone Great! The one thing you may want to double-check is the mermaid.css file. The previous version had .mermaid in front of most entries. I did try that but then circle coloring broke again. |
@vnijs I really appreciate you doing this. I have lost touch a little with mermaid. The lack of |
@vnijs, was there a particular example/test that failed, so I can insure that my changes work or fail? |
It is what I remember a battle of specificity, so will require changes to mermaid source. In general I shy away from manipulating the source since maintenance then becomes very troublesome. |
Mermaid plots currently don't render at all (at least in Chrome). Here is an example and how it should look. This works with the PR. graph LR |
@vnijs Now, this is far from being beautiful, and it doesn't have the angled edges as you like them, and it's also less complex. But it renders fine. It's in from the latest data.tree release's application vignette. The reason I replaced the Mermaid code is that a few weeks ago, I had problems with the arrow heads. And since I also added a generic plot functionality to data.tree (based on DiagrammeR grViz), I figured this would make sense. |
Thanks for sharing the plot @gluc. However, I much prefer mermaid for these plots, mainly because of how edge-labels are added. @timelyportfolio's point is an important one of course. However, mermaid plots no longer work in Chrome with the old version of mermaid.slim.min.js that was part DiagrammeR. I noticed that @achubaty put back the .mermaid entries in the CSS once already but it isn't clear to me what changes would be needed in the source code to use this CSS structure appropriately. I'm happy to help but could use a few pointers to get started. In addition to possible conflicts it seems that with the github version of knitr, mermaid plots are rendered incorrectly in R-studio with the github version of mermaid.slim.min.js and mermaid.css in DiagrammeR. See example below. Although I don't think this is a knitr issue, it is odd that if you remove the cc @yihui ---
title: "Test"
output: html_document
---
## A header
Note that if the previous header is removed the rendered HTML looks fine.
```{r echo}
library(DiagrammeR)
mermaid("
graph LR
A-->B
A-->C
C-->E
B-->D
C-->D
D-->F
E-->F
") |
Fixes rendering problems in Chrome (mermaid-js/mermaid#281) and color for circles (mermaid-js/mermaid#271).
I talked to @ramnathv shiny-conference in SF this past weekend. He suggested the pull request. Also cc-ing @timelyportfolio