nodeCategoryProperty property

Object nodeCategoryProperty

Gets or sets the name of the node data property that returns a string naming that data's category. The value may also be a function taking two arguments, where the first argument will be a node data object. If the second argument is not supplied, the function should return the category name; if the second argument is supplied, the function should modify the node data object so that it has that new category name. The default value is the string 'category', meaning that it expects the data to have a property named 'category' if it cares to name a category. This is used by the diagram to distinguish between different kinds of nodes. The name must not be null. If the value is an empty string, #getCategoryForNodeData will return an empty string for all node data objects.

If you want to set this property you must do so before using the model, and especially before you assign Diagram#model. Note that functions cannot be serialized into JSON-formatted text, so if you are using #toJson and Model.fromJson, and if you want this property to be a function, you will need to assign this property to your desired function immediately after creating the model, including when it is created by Model.fromJson.

Implementation

_i2.Object get nodeCategoryProperty => _i4.getProperty(
      this,
      'nodeCategoryProperty',
    );
void nodeCategoryProperty=(Object value)

Implementation

set nodeCategoryProperty(_i2.Object value) {
  _i4.setProperty(
    this,
    'nodeCategoryProperty',
    value,
  );
}