bramp / js-sequence-diagrams

Draws simple SVG sequence diagrams from textual representation of the diagram
https://bramp.github.io/js-sequence-diagrams/
BSD 2-Clause "Simplified" License
7.8k stars 1.08k forks source link

Examples only use line, can you extend #191

Open Mashiane opened 6 years ago

Mashiane commented 6 years ago

Hi there

The examples provided only show one line to add. e.g. JQuery and no other example shows how to add content via a script that does not read an .innerHTML. Can you please expand on the example that uses JQuery to add more content to the diagram.

Thanks

bramp commented 6 years ago

There is no jQuery option that doesn't read the innerHTML. The non-jQuery approach is simple to use in that case.

Really the jQuery was there so you could do something like

<div class="diagram">A->B: Diagram one</div>
<div class="diagram">C->D: Diagram two</div>

// Turn all the divs with the diagram class into diagrams.
$(".diagram").sequenceDiagram(options);

To add multiple lines it should be as simple as:

<div class="diagram">
A->B: Message
B->C: blah
</div>

I would be happy to review a pull request updating the docs, if you think they can be clearer. Thanks.