Manage Elements

These operations traverse scenes and groups to locate related elements.

msc.findElements(container, objs, includePrimitives)

Finds elements inside a container that match a set of predicates.

  • container: Scene or Group
  • objs (Array, optional): array of predicates
  • includePrimitives (Boolean, optional): whether vertices and segments should also be searched
  • Return type: Array

msc.getLeafMarks(elem, uniqueClassIDs)

Returns the leaf marks under an element.

  • elem: Group or Mark
  • uniqueClassIDs (Boolean, optional): whether to return only one mark per class ID
  • Return type: Array of Mark

msc.getPeers(elem, container)

Returns elements that share the same class ID as the given element.

  • elem: Mark, Group, vertex, or segment
  • container (Scene or Group, optional): limits the search scope
  • Return type: Array