UNPKG

mermaid

Version:

Markdownish syntax for generating flowcharts

19 lines 1.89 kB
[ { "tags": [], "description": { "full": "Created by knut on 14-11-19.", "summary": "Created by knut on 14-11-19.", "body": "" }, "isPrivate": false, "ignore": false, "code": "var actors = {};\nvar actorKeys = [];\nvar messages = [];\nvar notes = [];\nexports.addActor = function(id,name,description){\n //console.log('Adding actor: '+id);\n actors[id] = {name:name, description:description};\n actorKeys.push(id);\n};\n\nexports.addMessage = function(idFrom, idTo, message, answer){\n //console.log('Adding message from='+idFrom+' to='+idTo+' message='+message+' answer='+answer);\n messages.push({from:idFrom, to:idTo, message:message, answer:answer});\n};\n\nexports.addSignal = function(idFrom, idTo, message, messageType){\n //console.log('Adding message from='+idFrom+' to='+idTo+' message='+message+' answer='+answer);\n messages.push({from:idFrom, to:idTo, message:message, type:messageType});\n};\n\nexports.getMessages = function(){\n return messages;\n};\n\nexports.getActors = function(){\n return actors;\n};\nexports.getActor = function(id){\n return actors[id];\n};\nexports.getActorKeys = function(){\n return Object.keys(actors);\n};\n\nexports.clear = function(){\n actors = {};\n messages = [];\n};\n\nexports.LINETYPE = {\n SOLID : 0,\n DOTTED : 1\n};\n\nexports.ARROWTYPE = {\n FILLED : 0,\n OPEN : 1\n};\n\nexports.PLACEMENT = {\n LEFTOF : 0,\n RIGHTOF : 1,\n OVER : 2\n};\n\nexports.addNote = function (actor, placement, message){\n var note = {actor:actor, placement: placement, message:message};\n\n notes.push(note);\n};\n\n\nexports.parseError = function(err, hash) {\n console.log('Syntax error:' + err);\n};", "ctx": { "type": "declaration", "name": "actors", "value": "{}", "string": "actors" } } ]