setProperties method

GraphObject setProperties(
  1. Object props
)

This method sets a collection of properties according to the property/value pairs on the given Object, in the same manner as GraphObject.make does when constructing a GraphObject with an argument that is a simple JavaScript Object.

This method is common in initialization, but typically you should use #set instead, unless you need to attach new properties, or set sub-properties. Calling this method is much less efficient than setting properties directly, and does not do compile-time type checking.

If this is a Panel, you can set properties on named elements within the panel by using a name.property syntax for the property name. For example, if a Node has a Picture that is named "ICON" (because its #name property has been set to "ICON") and a TextBlock whose name is "TB", one could set properties on the Node and on each of those named elements by:

aNode.setProperties({
  background: "red",
  "ICON.source": "https://www.example.com/images/alert.jpg",
  "TB.font": "bold 12pt sans-serif"
});

At the current time only a single dot is permitted in the property "name". Note that the use of all-upper-case object names is simply a convention.

@param {Object} props a plain JavaScript object with various property values to be set on this GraphObject. @since 1.5 @return {GraphObject} this GraphObject @see #attach a synonym of this method @see #set a type-safe method to set a collection of properties

Implementation

_i3.GraphObject setProperties(_i2.Object props) => _i4.callMethod(
      this,
      'setProperties',
      [props],
    );