Closed l1x closed 8 years ago
I might not understand your question, but you can do the following:
var text = "Title: Here is a title\nA->B: Normal line";
//or
var text = "Title: Here is a title\n" +
"A->B: Normal line\n";
// or (with ECMAScript 6 - ES6):
var text = `
Title: Here is a title
A->B: Normal line
`
// and then use text
var diagram = Diagram.parse(text);
or if using
Thanks!
@bramp In the website version the "china" example seems to manage to get a line break into the "note". I find if I try to do that while dividing lines with line breaks like above it breaks...
Works
var d = Diagram.parse(
"Andrew->China: Says Hello\n" +
"Note right of China: China thinks about it\n" +
"China-->Andrew: How are you?\n" +
"Andrew->>China: I am good thanks!"
);
Doesn't
var d = Diagram.parse(
"Andrew->China: Says Hello\n" +
"Note right of China: China thinks\n about it\n" +
"China-->Andrew: How are you?\n" +
"Andrew->>China: I am good thanks!"
);
Any thoughts? Thanks!
It works on the site, because the string javascript receives contains a "\n". You should be able to change your example to work:
var d = Diagram.parse(
"Andrew->China: Says Hello\n" +
"Note right of China: China thinks\\n about it\n" +
"China-->Andrew: How are you?\n" +
"Andrew->>China: I am good thanks!"
);
Ahhh right makes sense! Thanks!
Check out this working proof of concept... https://howardroark.github.io/get-sequence-diagrams/ :)
I modified the syntax slightly and now new line translate quite well... https://howardroark.github.io/get-diagram/
![](https://get-diagram.herokuapp.com/sequence?
Andrew->China: Says Hello;
Note right of China: China thinks\n about it;
China-->Andrew: How are you?;
Andrew->>China: I am good thanks!;
)
How can I use multiple lines here? I was trying few different ways, nothing worked so far.
I would like to create a diagram with the following:
Is there a way to do that in manual mode?