Procedures

Procedures are a feature of HyperObjects Models.

They allow you to add dynamic output from a model calculated from various inputs.

See bellow for an example of a procedure, drag any of the four points in the corner to see what happens!


This shows a basic example of how to set up a procedure. The above procedure takes the average x and y values of the source point group and creates a new circle at that location.

The core lines of code to set up a procedure come down to this:

model.addProcedure(
    'procedure-example', // give it a name
    (self) => {
        // do something
        // and return some new geometries
        return []
    }
)

You can add as many procedures as you want to an object. A procedure call can return a single Geometry object or an array of Geometry objects.

Continue reading about:


Continue learning hyperobjects concepts