setCategoryForNodeData method

void setCategoryForNodeData(
  1. Object nodedata,
  2. String cat
)

Change the category of a given node data, a string naming the node template or group template or part template that the Diagram should use to represent the node data.

Changing the node template for a node data will cause the existing Node, Group, or Part to be replaced with a new instance of the same class created by copying the new node template and applying any data-bindings. That means that the templates in the Diagram#nodeTemplateMap or Diagram#groupTemplateMap must be instances of the same class -- one cannot convert a Node into a Group or vice-versa by setting the category.

Binding sources should not be (or depend in a conversion function on) the category of the data if you might be modifying the category, because then some bindings might be evaluated before or after the category has been changed. @param {Object} nodedata a JavaScript object represented by a node, group, or non-link. @param {string} cat Must not be null. @see #nodeCategoryProperty @see #getCategoryForNodeData

Implementation

void setCategoryForNodeData(
  _i2.Object nodedata,
  _i2.String cat,
) {
  _i4.callMethod(
    this,
    'setCategoryForNodeData',
    [
      nodedata,
      cat,
    ],
  );
}