Skip to main content

move()

moves an item to the defined position

move(id: Id | Id[], index: number, target?: DataCollection): Id | Id[];

Parameters:

  • id: string | number | string[] - the id(s) of an item(s) to move
  • index: number - the index to move an item(s) to
  • target: object - optional, the target data collection object

Returns:

Either a string with the item's id or an array of string values with ids of items.

Example

diagram.data.move("4",5); // moves the shape with id=4 to the position with index 5