Communication and Protocols
ModelSource
and ActionDispatcher
regardless if the model source is local or remote.
+hidden-mobile" itemprop=breadcrumb>From 8423321bff790db26ed50f9ec2dff3bcdd2fed98 Mon Sep 17 00:00:00 2001
From: gfontorbe Actions are plain JSON serializable objects so that they can easily be passed through all kinds of APIs. They can be distinguished through their Actions are plain JSON serializable objects so that they can easily be passed through all kinds of APIs. They can be distinguished through their Sent from the client to the model source to transmit the result of bounds computation for micro-layout.
+ Sent from the client to the model source to transmit the result of bounds computation for micro-layout.
This is sent as a response to a RequestBoundsAction Sent from the model source to the client to request bounds for the given model. This triggers the micro-layout computation. Sent from client to model source to request a new model. Usually, this is the first action sent to initiate the communication.
+ Sent from the model source to the client to request bounds for the given model. This triggers the micro-layout computation. Sent from client to model source to request a new model. Usually, this is the first action sent to initiate the communication.
Optionally this can contain an Sent from the model source to the client to set the model. It contains the schema for the new graph.
+ Sent from the model source to the client to set the model. It contains the schema for the new graph.
Should a model already exist in the client, it is overwritten. Sent from model source to client to update the current model. Allows animating the transition from the old to the new model and contains properties for the transition. Based on where layouting should be done there are 3 different protocols through which the Sent from model source to client to update the current model. Allows animating the transition from the old to the new model and contains properties for the transition. Based on where layouting should be done there are 3 different protocols through which the On the server-side layout options need to be set in the In this scenario, the server needs to provide a model with complete layout information, so that no further processing by the client is required.
+ In this scenario, the server needs to provide a model with complete layout information, so that no further processing by the client is required.
Communication and Protocols
ModelSource
and ActionDispatcher
regardless if the model source is local or remote.
+hidden-mobile" itemprop=breadcrumb>Communication and Protocols
ModelSource
and ActionDispatcher
regardless if the model source is local or remote.
The core of this communication follows specific protocols. This Chapter will give an overview of these protocols and their used actions.KIND
string property.
+KIND
string property.
In this section, the most important actions for understanding the basic communication protocols are described.
For more info on existing actions see actions.tsoptions
object containing configuration for the DiagramServer
, like properties for needsClientLayout
and needsServerLayout
.DiagramServer
and client can communicate.
+DiagramServer
and client can communicate.
On the client-side, this can be configured through the configureViewerOptions
in the dependency injection container.configureViewerOptions(context, {
needsClientLayout: false,
needServerLayout: true,
@@ -41,7 +40,7 @@
DiagramServer
diagramServer.setNeedsClientLayout(false);
diagramServer.setNeedsServerLayout(true);
sequenceDiagram
participant C as Client
@@ -54,7 +53,7 @@
S->>C: UpdateModelAction
end
First the client requests and receives the model from the server. After that, the server can update the model whenever necessary.
The server sends RequestBoundsAction
(highlighted in yellow) to the client instead of updating the model directly. The client does not forward the resulting ComputedBoundsAction
to the server because that would be an unnecessary round-trip. The updated bounds are applied locally in the client instead.
+The server sends
RequestBoundsAction
(highlighted in yellow) to the client instead of updating the model directly. The client does not forward the resultingComputedBoundsAction
to the server because that would be an unnecessary round-trip. The updated bounds are applied locally in the client instead.sequenceDiagram participant C as Client participant S as Server @@ -70,7 +69,7 @@ end endThis is very similar to scenario 1 (with server-only layout). However, instead ofSetModelAction
andUpdateModelAction
we use theRequestBoundsAction
which contains the full graphThis is similar to the second scenario above, but here the
ComputedBoundsAction
is processed on the server so it can apply its own layout engine to the updated model.+This is similar to the second scenario above, but here the
ComputedBoundsAction
is processed on the server so it can apply its own layout engine to the updated model.sequenceDiagram participant C as Client participant S as Server @@ -85,4 +84,7 @@ C ->> S: ComputedBoundsAction S ->> C: UpdateModelAction end -\ No newline at end of file +