Finally...
Struggling with this for a couple of hours..., This is a wrap of this js snippet here, https://bramp.github.io/js-sequence-diagrams/
The UML diagrams can either be 'simple' or by 'hand'
Example 1
Example 2
Example 3
Example 4
Example 5 - A simple themed diagram
In BuildPage..
Struggling with this for a couple of hours..., This is a wrap of this js snippet here, https://bramp.github.io/js-sequence-diagrams/
The UML diagrams can either be 'simple' or by 'hand'
Example 1
B4X:
Dim ex1 As MashText2UML
ex1.Initialize(page,"ex1")
ex1.AddConnection("Andrew","China","Says Hello")
ex1.AddNote("China",ex1.EnumNotePos.right,"China thinks\nabout it")
ex1.AddDottedConnection("China","Andrew","How are you?")
ex1.AddConnectionOpen("Andrew","China","I am good thanks!")
page.Cell(2,1).addcomponent(ex1.ABMComp)
Example 2
B4X:
Dim ex2 As MashText2UML
ex2.Initialize(page,"ex2")
ex2.Title = "Here is a title"
ex2.AddNormalLine("A","B","Normal line")
ex2.AddDashedLine("B","C","Dashed line")
ex2.AddOpenArrow("C","D","Open arrow")
ex2.AddDashedOpenArrow("D","A","Dashed open arrow")
page.Cell(2,1).addcomponent(ex2.ABMComp)
Example 3
B4X:
Dim ex3 As MashText2UML
ex3.Initialize(page,"ex3")
ex3.AddNote("A",ex3.EnumNotePos.left,"Note to the\n left of A")
ex3.AddNote("A",ex3.EnumNotePos.right,"Note to the\n right of A")
ex3.AddNote("A",ex3.EnumNotePos.over,"Note over A")
ex3.AddNoteOver("A","B","Note over both A and B")
page.Cell(2,1).addcomponent(ex3.ABMComp)
Example 4
B4X:
Dim ex4 As MashText2UML
ex4.Initialize(page,"ex4")
ex4.AddParticipant("C").AddParticipant("B").AddParticipant("A")
ex4.AddNote("A",ex4.EnumNotePos.right,"You can change the order of the\n participants")
page.Cell(2,1).addcomponent(ex4.ABMComp)
Example 5 - A simple themed diagram
B4X:
Dim ex5 As MashText2UML
ex5.Initialize(page,"ex5")
ex5.Theme = ex5.EnumTheme.simple
ex5.AddNote("A",ex5.EnumNotePos.left,"Note to the\n left of A")
ex5.AddNote("A",ex5.EnumNotePos.right,"Note to the\n right of A")
ex5.AddNote("A",ex5.EnumNotePos.over,"Note over A")
ex5.AddNoteOver("A","B","Note over both A and B")
page.Cell(2,1).addcomponent(ex5.ABMComp)
In BuildPage..
B4X:
pg.AddExtraCSSFile("custom/sequence-diagram-min.css")
pg.AddExtraJavaScriptFile("custom/webfont.js")
pg.AddExtraJavaScriptFile("custom/snap.svg-min.js")
pg.AddExtraJavaScriptFile("custom/underscore-min.js")
pg.AddExtraJavaScriptFile("custom/sequence-diagram-min.js")