3 ms·
Reminds me of https://bramp.github.io/js-sequence-diagrams/ https://bramp.github.io/js-sequence-diagrams/ The nice thing about that library is that you actuall
by xtracto 6y ago
Reminds me of https://bramp.github.io/js-sequence-diagrams/ https://bramp.github.io/js-sequence-diagrams/ The nice thing about that library is that you actually can have a self-contained HTML page with a diagram, like:
<html>
<script src="https://cdnjs.cloudflare.com/ajax/libs/webfont/1.6.28/webfontloader.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/raphael/2.3.0/raphael.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.5.2/underscore-min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-sequence-diagrams/1.0.6/sequence-diagram-min.js"></script>
<body>
<div id="diagram"></div>
<script>
var diagram = Diagram.parse("A->B: Message");
diagram.drawSVG("diagram", {theme: 'hand'});
</script>
</body>
</html>
And this will draw render a sequence diagram in any browser. I've used this to have as documentation in the /docs folder of project Git repository for some of my teams. It is great because it is pretty easy to update and maintain changes via VCS.
- hakcermani 6y agoAnother similar site that i have used a lot is ... https://www.websequencediagrams.com/ https://www.websequencediagrams.com/ .. i particularly like the svg export of websequencediagrams.
- avodonosov 6y agoalso https://sequencediagram.org https://sequencediagram.org
- jorisd 6y agoYou actually don't even need the HTML scaffolding for that, and can author a js-sequence-diagrams diagram straight into a text file, append a simple script to render the document, and save as .html! Example: https://unpkg.com/browse/js-sequence-diagrams-autorenderer@1.0.1/test.html https://unpkg.com/browse/js-sequence-diagrams-autorenderer@1... - click on "view raw" to see it in action. Looks a lot cleaner, and the .html itself is a valid diagram as the script tag that bootstraps the renderer is prefixed with a comment hash. EDIT: I used to have this in a gist that I'd load via rawgit.com, but since that's no longer active, I figured I'd update my script and make it publicly available through unpkg :)
- xtracto 6y agoHowdy, that's some black magic! Thanks a lot, that's a really neat idea.