HI all,
Wouldn’t it be cool if we can demo our code using a sequence diagram? Problem is I can;t get it to work. I suspect an issue that I have to use underscore, but my code still links to _ lodash I think…
https://bramp.github.io/js-sequence-diagrams/
it should work like this according to their manual
include the following HTML:
<script src="raphael-min.js"></script>
<script src="underscore-min.js"></script>
<script src="sequence-diagram-min.js"></script>
and now you have two options. You can manually parse the text:
<div id="diagram"></div>
<script>
var diagram = Diagram.parse("A->B: Message");
diagram.drawSVG("diagram", {theme: 'hand'});
</script>
Cannot read property ‘_actors_height’ of undefined
my code
import { Template } from 'meteor/templating';
import { Session } from 'meteor/session';
import { _ } from 'meteor/underscore';
import '/imports/ui/UIHelpers';
import { APILogs } from '/imports/api/APILogs';
import '/imports/ui/external/raphael-min';
import '/imports/ui/external/sequence-diagram-min';
// import '/imports/ui/external/underscore-min';
Template.APILogs.onRendered(function() {
$(".diagram").sequenceDiagram({theme: 'hand'});
});
The HTML
<div class="row">
<h3 class="ui header">
Sequence diagram</h3>
<p>In this schema you will see the flow from the user requesting the demo page, though the source code of this demo platform to Qlik Sense and back</p>
<div class="diagram">Andrew->China: Says Hello Note right of China: China thinks\nabout it China-->Andrew: How are you? Andrew->>China: I am good thanks!</div>
</div>
from