- Notifications
You must be signed in to change notification settings - Fork25
sverweij/mscgen_js
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Turns text into sequence charts.
- Implementation of the super easyMscGen in JavaScript.
- Embeddable in your HTML.
- Try it in theon line interactive interpreter.
- Or inAtom with theatom mscgen-preview package.
- Also:
- talks asimplified subset of MscGen for lazy bastards.
- speaks asuperset of MscGen for the feature hungry.
- runs in all modern browsers (and innode.js).
- animates your chart.
This sequence chart ...
was made with thisMscGen source:
msc { a [ label="Entity A", textbgcolor="red", textcolor="white" ], b [ label="Entity B", textbgcolor="yellow" ], c [ label="Entity C", textbgcolor="blue", textcolor="yellow" ]; a->b [ label = "ab()" ] ; b->c [ label = "bc(TRUE)"]; c=>>c [ label = "process(1)" ]; b<<=c [ label = "callback()", arcskip="1"]; |||; --- [ label = "If more to run", ]; a->a [ label = "next()"]; a=>c [ label = "ac1()"]; b<<c [ label = "cb(true)", textbgcolor="lime"]; b->b [ label = "stalled(...)"]; a<<b [ label = "ab() = FALSE", textcolor="red", linecolor="red"], c note c [ label="Just a note ...", linecolor="green", textcolor="green", textbgcolor="lime" ]; }(Open this chart in the online interpreter)
mscgen_js was made to go both ways:
- Accept all validMscGen programs and render them correctly.
- Have all valid MscGen programs accepted by mscgen_js accepted and renderedcorrectly by MscGen.
MoreoverMsGenny, the simplified subset, translatesto MscGen with the flip of a switch.
If you find proof to the contrary on any of thistell us.
Seebuild.md. If you want to understand how mscgen_js'innards work: we try to explain thatin the script folder.
Embedding MscGen in HTML:mscgenjs-inpage
- Tight, standalone front end library that renders MscGen (and the twoderivative languages) within any HTML. As used in the tutorial and theembedding guide.
npm install mscgenjs-inpage- (This replaces the provisional bower package with the samepurpose).
Command line interface:mscgenjs-cli
- Option syntax is similar to the original
mscgen, soin theory you could use it as a drop-in replacement for that. npm install mscgenjs-cli
- Option syntax is similar to the original
MscGen package for the atom editor
- Library package. Contains the parsing and rendering logic for all mscgenjs.
npm install mscgenjs
This software is free softwarelicensed under GPLv3.This means (a.o.) youcan use it as part of other free software, butnot as part of non free software. We have a slight relaxation for whenyou'd want to usemscgen-inpage.js.
In addition to the GNU public license, for the use of the minified versionof the embedding code (mscgen-inpage.js) as described onembedding a special exception to the GPL is made:
As a special exception to the GPL, any HTML file which merely makesfunction calls to mscgen-inpage.js, and for that purpose includesit by reference shall be deemed a separate work for copyright lawpurposes. In addition, the copyright holders of this code give youpermission to combine this code with free software libraries thatare released under the GNU LGPL. You may copy and distribute sucha system following the terms of the GNU GPL for this code and theLGPL for the libraries. If you modify this code, you may extendthis exception to your version of the code, but you are not obligatedto do so. If you do not wish to do so, delete this exception statementfrom your version.
mscgen_js is built on various libraries, each of which have their ownlicense (incidentally all MIT style):
- requirejs is used for modularization.
- The bare (embedding only) mscgen_js is packaged using requirejs andalmond to be able to run as a stand alone, dependency-lesspackage.
- Parsers are generated withpegjs.
- The on line interpreter additionally usescodemirror.
- The command line interface usesphantomjs,amdefine andcommander
- To run automated tests in node mscgen_js usesjsdom,amdefine,node-localstorage andcommander.
Icons are courtesy of Dmitry Baranovskiylicense.
- Icons in the animation, were created with theIcoMoon App.At the time the font was created it was licensedGPLv3 orCC BY 4.0
It usesmocha,chai,istanbul,eslint and [dependency-cruiser][41] tomaintain some modicum of verifiable code quality.You can see the build history inGitHub actions.
- Mike McTernan for creating the wonderful MscGen language,the accompanying c implementation and for releasing both to the publicdomain (the last one under aGPLv2 license to be precise).
- David Majda for cooking and maintaining the fantasticand lightning fastPEG.js parser generator.
- Marijn Haverbeke for the snazzyCodeMirror editor component.
- Elijah Insua forjsdom, which makes it possibleto render vector graphics in node.js.
- Audrey M. Roy for the excellent"painfully obsessive cheat sheet to favicon sizes/types.".
- Joshua Chaitin-Pollak, for suggestingto publish mscgen_js as a package.
About
text => sequence charts
Topics
Resources
License
Code of conduct
Contributing
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Uh oh!
There was an error while loading.Please reload this page.
Contributors3
Uh oh!
There was an error while loading.Please reload this page.
