cloneDeep<T> method

T cloneDeep<T>(
  1. T obj
)

Deeply copy an object or array and return the new object. This is typically called on a #nodeDataArray or GraphLinksModel#linkDataArray or data objects within them.

By default, this method will make deep clones of arrays and JavaScript objects and maintain any shared or cyclic references. It will properly copy any Date or RegExp object, and will call a copy function on any object where one exists. It also handles certain GoJS classes: Point, Size, Rect, Margin, Spot, List, Set, and Map. It will not handle instances of Diagram, Layer, GraphObject, Tool, CommandHandler, AnimationManager or subclasses or related classes.

This method may be overridden. Please read the Introduction page on Extensions for how to override methods and how to call this base method. Only override this method when the default behavior doesn't suit the data. When cloning objects, we recommend skipping the __gohashid property, which is used internally. @expose @param {T} obj @return {T} @since 2.1

Implementation

T cloneDeep<T>(T obj) => _i4.callMethod(
      this,
      'cloneDeep',
      [obj],
    );