defineBuilder static method

void defineBuilder(
  1. String name,
  2. Object func(
    1. Array
    )
)

This static function defines a named function that GraphObject.make or GraphObject.build can use to build objects. Once this is called one can use the name as the first argument for GraphObject.make or GraphObject.build. Names are case sensitive.

The second argument must be a function that returns a newly created object, typically a GraphObject. It is commonplace for that object to be a Panel holding a newly created visual tree of GraphObjects. The function receives as its only argument an Array that is holds all of the arguments that are being passed to GraphObject.make, which it may modify in order to change the arguments that GraphObject.make receives.

Predefined builder names include: "Button", "TreeExpanderButton", "SubGraphExpanderButton", "PanelExpanderButton", and "ContextMenuButton". The implementation of these builders is provided by Buttons.js in the Extensions directory.

Implementation

static void defineBuilder(
  _i2.String name,
  _i2.Object Function(_i7.Array<_i2.dynamic>) func,
) {
  _i4.callMethod(
    _declaredGraphObject,
    'defineBuilder',
    [
      name,
      _i4.allowInterop(func),
    ],
  );
}