Skip to content
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

Brackets in a node with text? #213

Closed
orschiro opened this issue Sep 24, 2015 · 5 comments
Closed

Brackets in a node with text? #213

orschiro opened this issue Sep 24, 2015 · 5 comments

Comments

@orschiro
Copy link
Contributor

@orschiro orschiro commented Sep 24, 2015

Dear all,

I looked at the following example from the documentation:

id1[This is the text in the box]

I assumed to add brackets to the text as follows:

id1[This is the (text) in the box]

However, the Live Editor does not render the chart when using brackets.

Are brackets in node link texts supported?

Thankfully,

Robert

@knsv
Copy link
Collaborator

@knsv knsv commented Sep 26, 2015

Put the text within quotes and you will have a diagram:

graph LR
id1["This is the (text) in the box"]

Good luck!

@knsv
Copy link
Collaborator

@knsv knsv commented Sep 26, 2015

Thanks for bringing this up. I added a small example in the docs for this case:
http://knsv.github.io/mermaid/#special-characters-that-break-syntax

@orschiro
Copy link
Contributor Author

@orschiro orschiro commented Sep 27, 2015

It works. Thanks @knsv!

@orschiro orschiro closed this Sep 27, 2015
@shatadrusaha
Copy link

@shatadrusaha shatadrusaha commented Jun 10, 2019

I am trying to use mermaid in a RMD document. But, when I try to use bracket within quotes, it doesn't work. Although, that was the solution provided above. My code works fine, when I don't use brackets. The code is given below:

mermaid("
graph TB;
A[Data Extraction
BGL + PCD vars] --> B[WOE Binning
PCD vars];

  B --> C[Data Sampling <br/> Train - 70% <br/> Test - 30%];
")

This produces the following graph:

image

I am trying to have the graph look like this in the first block

Data Extraction
(BGL + PCD vars)

@callum-savage
Copy link

@callum-savage callum-savage commented Oct 8, 2019

@shatadrusaha

In an RMD document, you can still use double quotes for the node label if you surround the mermaid diagram with single quotes (the reverse doesn't seem to work).

library(DiagrammeR)

mermaid('
  graph TB;
  A["Data Extraction <br/> (BGL + PCD vars)"] --> B[WOE Binning <br/> PCD vars];
  B --> C[Data Sampling <br/> Train - 70% <br/> Test - 30%];
')

Which results in the following:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants