sprotty GRAPHICAL VIEWS FOR WEB APPLICATIONS Jan Köhnlein Miro Spönemann @jankoehnlein @sponemann
visualize complex relationships… subsystems models dependencies actors modules states networks data
���� ����� ����� ���� ���� ���� ����� ������� ���� ���� ���� ����� ���� ���� ���� ���� ���� ���� ���� ���� ���� ���� ����
L0,2 L7,2 Request L8,2 L10,2: pend = false L11,2: req true Dispatch L12,2: pend = true L20,1 L13,2: checkReq=req L22,1: grant = false wr wr 1 1 L14,0: pend L23,1: checkReq && grant && free true true 1wr L15,0: pend = false L24,1: grant = true L16s,0 L25s,0 L16d,2 L25d,1 L17,2 L18,0 L27,0 L26,1 L28,0 L29,0
Activity startup startup reset buffer got command got command no command no command process command monitor status command done command done status done status done rerun rerun is complete is complete ILayoutConfig getAffectedOptions (LayoutContext) : Collection<IProperty<?>> shutdown shutdown getContextValue (IProperty<?>, LayoutContext) : Object 0..* getOptionValue (LayoutOptionData, LayoutContext) : Object getPriority () : int IMutableLayoutConfig DefaultLayoutConfig EclipseLayoutConfig setOptionValue (LayoutOptionData, LayoutContext, Object) : void AbstractMutableLayoutConfig CompoundLayoutConfig add (ILayoutConfig) : void remove (ILayoutConfig) : void SemanticLayoutConfig getAffectedOptions (Object) : IProperty<?>[] getSemanticValue (Object, LayoutOptionData) : Object setSemanticValue (Object, LayoutOptionData, Object) : void
GEF
sprotty CSS
DEMO: NPM npm-dependencies.com
CLIENT ARCHITECTURE: Flow Of Information M odel V iew C ontroller
CLIENT ARCHITECTURE: Flow Of Information Command CommandStack SModel ActionDispatcher Action Viewer
CLIENT ARCHITECTURE: Viewer and Virtual DOM Command CommandStack SModel ActionDispatcher Action Viewer ViewRegistry View View View Action render patch DOM Virtual DOM
CLIENT ARCHITECTURE: Model Source Command CommandStack SModel ModelSource ActionDispatcher Action Action Viewer
CLIENT ARCHITECTURE: Server Connection Command Web CommandStack Socket Action SModel ModelSource ActionDispatcher DiagramServer Action Action Viewer
SERVER ARCHITECTURE Web Domain Diagram Action IDiagramServer Socket Model generate Model ILayoutEngine Eclipse Layout Kernel
DEMO: MULTICORE sprotty-demo.typefox.io
GETTING STARTED: The Diagram Model sprotty model SModelElement SShapeElement SEdge SNode SPort SLabel Flow domain-specific model TaskNode BarrierNode
GETTING STARTED: The Diagram Model model instance TaskNode TaskNode source source Flow Flow target target BarrierNode source source source Flow Flow Flow target target target TaskNode TaskNode TaskNode
GETTING STARTED: The View
GETTING STARTED: The View class TaskNodeView implements IView { render(node: TaskNode, context: RenderingContext): VNode { const radius = node.size.width / 2 return <g> <circle r={radius} cx={radius} cy={radius} class-sprotty-node={true} class-task={true} class-selected={node.selected}> </circle> <text x={radius} y={radius} class-task-name={true}> {node.name} </text> </g> } }
GETTING STARTED: Configuration const flowModule = new ContainerModule((…) => { configureModelElement(context, 'flow', SGraph, SGraphView); configureModelElement(context, 'task', TaskNode, TaskNodeView); configureModelElement(context, 'barrier', BarrierNode, BarrierNodeView); configureModelElement(context, 'edge', SEdge, FlowEdgeView); configureModelElement(context, 'html', HtmlRoot, HtmlRootView); configureModelElement(context, 'pre-rendered', PreRenderedElement, PreRenderedView); }) const container = new Container() container.load(defaultModule, selectModule, ..., flowModule)
GETTING STARTED: The Server Implement a diagram generator TaskNode Task application diagram model model
GETTING STARTED: The Server Implement a diagram generator private def createTask(Task declaration) { val tnode = new TaskNode tnode.type = 'task' tnode.id = 'task_' + declaration.name tnode.name = declaration.name return tnode }
DEMO YANG
SERVER ARCHITECTURE: Xtext and LSP TextDocument Service generate Xtext Language Grammar Server JSON Workspace RPC Service DiagramLanguage Diagram ServerExtension Service
YANG FOR ECLIPSE
ECLIPSE PROPOSAL
ROADMAP ➤ Set up Eclipse project and resources ➤ More editing features ➤ More navigation and exploration features ➤ Specify client-server protocol ➤ Additional layers for faster implementation of common use cases
Evaluate the Sessions Sign in and vote at eclipsecon.org -1 0 +1
Recommend
More recommend