module salix::jsplumb::JSPlumb
rascal-0.40.17
salix-contrib-0.2.7
Usage
import salix::jsplumb::JSPlumb;
Source code
http://github.com/usethesource/salix-contrib/src/main/rascal/salix/jsplumb/JSPlumb.rsc
Dependencies
import salix::HTML;
import salix::Node;
import salix::Core;
import Node;
import lang::json::IO;
import String;
alias N
void(str id, void() block)
alias E
void(str from, str to)
alias B
void(N, E)
function node2attr
Attr node2attr(node n)
data Connector
data Connector
= straight(int stub = 0, int gap = 0)
| bezier(int curviness = 150)
| flowchart(int stub = 30, bool alwaysRespectStub = false, int gap = 0, real midpoint = 0.5, int cornerRadius = 0)
| stateMachine(int margin = 5, int curviness = 10, int proximityLimit = 80)
;
data Face
data Face
= top()
| left()
| right()
| bottom()
;
data Anchor
data Anchor
= top()
| topRight()
| right()
| bottomRight()
| bottom()
| bottomLeft()
| left()
| topLeft()
| center()
| autoDefault()
| perimeter(Shape shape, int anchorCount = 60, int rotation = 0)
| continuous(list[Face] faces = [Face::top(),
Face::left(),
Face::right(),
Face::bottom()])
;
data Shape
data Shape
= circle()
| ellipse()
| triangle()
| diamond()
| rectangle()
| square()
;
data Endpoint
data Endpoint
= dot(int radius = 5, str cssClass = "", str hoverClass = "")
| rectangle(int width = 20, int height = 20, str cssClass = "", str hoverClass = "")
| blank()
;
function initCode
str initCode(str name)
function jsplumb
void jsplumb(str name, B block, str width="600px", str height="400xpx")