Protected
constructorAdd a service to the model
Service to add
Optional
proxy: ProxyHandler<any>Proxy handler
Model builder instance
Add multiple services to the model
Rest
...services: Service[]Services to add
Model builder instance
Add graph shape to graph
Graph builder or abstract graph
Current graph builder instance
Rest
...nodes: (string | GraphNode<any, any>)[]Event when graph is ready
ready
Event callback
Event before building the graph
prebuild
Event callback
Event after building the graph
postbuild
Event callback
Static
create
Model builder to construct and build a Model consisting of graph shapes and services.
Usage
Models can be created using the ModelBuilder. Once you have added all services and constructed the graph, you can build the model using the
build()
function. A promise will be returned with the created model.The graph shape of a model is immutable and can not be altered after building.
Shape Builder
Shapes can be created by starting with the
from()
function. This function takes an optional parameter of one or multiple source nodes.In order to end a shape, the
to()
function needs to be called with one or more optional sink nodes.Alternatively for readability with multiple shapes, the shapes can individually be created using the
addShape()
function as shown below.Building Source Processors
It is possible to have multiple processing nodes between the source and sink. These processing nodes can manipulate the data frame when it traverses from node to node.
Helper Functions
Helper functions can replace the
via()
function. Commonly used nodes such as frame filters, merging of data frames from multiple sources, ... can be replaced with simple functions asfilter()
ormerge()
respectively.Debug Logging
When building the model, you can provide a logger callback that has two arguments. An error level complying with normal log levels and a log object that represents an object.
Adding Services
Adding services can be done using the
addService()
function in the model builder.