API Docs for: 2.0.0

Class InteractableManager

Class defined in: src/node-interactable.js:25

Interactable container object

InteractableManager( )
src/node-interactable.js:25
addComplexGeometry( id, layerId, shapeData, zIndex, data )
src/node-interactable.js:112

Add new object (with complex geomtry - comprising of rectangles and circles) to a layer

Parameters:
  • id <String>

    unique identifier for the geometric object

  • layerId <String>

    unique identifier for the layer

  • shapeData <Object>

    containing type, geometry, and visibiility of each of the comprising elements

  • zIndex <Integer>

    determines ordering of the geometries within a given layers

  • data <Object>

    data to store along with given geometry

addGeometry( id, layerId, type, geometry, visible, zIndex, data )
src/node-interactable.js:74

Add new object (with geomtry - rectangle or circle) to a layer

Parameters:
  • id <String>

    unique identifier for the geometric object

  • layerId <String>

    unique identifier for the layer

  • type <String>

    "rectangle" or "circle"

  • geometry <Obejct>

    defines object (rectangle = {x: , y: , w: , h: }, circle = {x: , y: , r: })

  • visible <Boolean>

    whether or not the geometric object is currently visible

  • zIndex <Integer>

    determines ordering of the geometries within a given layers

  • data <Object>

    data to store along with given geometry

addLayer( id, zIndex )
src/node-interactable.js:38

Add new layer of interactable objects

Parameters:
  • id <String>

    unique identifier for the layer

  • zIndex <Integer>

    determines ordering of the layers

editComplexGeometry( id, layerId, shapeData )
src/node-interactable.js:209

Edit geometric object position / size / type

Parameters:
  • id <String>

    unique identifier for the geometric object

  • layerId <String>

    unique identifier for the layer

  • shapeData <Object>

    containing type, geometry, and visibiility of each of the comprising elements

editGeometry( id, layerId, type, geometry )
src/node-interactable.js:175

Edit geometric object position / size / type

Parameters:
  • id <String>

    unique identifier for the geometric object

  • layerId <String>

    unique identifier for the layer

  • type <String>

    "rectangle" or "circle"

  • geometry <Obejct>

    defines object (rectangle = {x: , y: , w: , h: }, circle = {x: , y: , r: })

editVisibility( id, layerId, visible, partId )
src/node-interactable.js:277

Edit visibility of geometric object

Parameters:
  • id <String>

    unique identifier for the geometric object

  • layerId <String>

    unique identifier for the layer

  • visible <Boolean>

    whether or not the geometric object is currently visible

  • partId <String>

    id of the part of the complex geometry for which visiblity is being edited

editZIndex( id, layerId, zIndex )
src/node-interactable.js:307

Edit zIndex of geometric object

Parameters:
  • id <String>

    unique identifier for the geometric object

  • layerId <String>

    unique identifier for the layer

  • zIndex <Integer>

    determines ordering of the geometries within a given layers

Object findGeometryBelowZIndex( zIndex, geometryList, ignoreList )
src/node-interactable.js:544

Finds the geometry just below the zIndex (highest zIndex)

Parameters:
  • zIndex <Number>

    zIndex value of the app

  • geometryList <Array>

    list of geometric objects

  • ignoreList <Array>

    list of ids to ignore during the search


Returns: <Object>

geometric object

Object findTopmostGeometry( point, geometryList, ignoreList )
src/node-interactable.js:459

Finds for topmost geometric object (highest zIndex)

Parameters:
  • point <Object>

    {x: , y: }

  • geometryList <Array>

    list of geometric objects

  • ignoreList <Array>

    list of ids to ignore during the search


Returns: <Object>

geometric object

String getLayerId( id )
src/node-interactable.js:259

Get the ID of the layer for this geometry

Parameters:
  • id <String>

    unique identifier for the geometric object


Returns: <String>

layerId unique identifier for the layer

Object getObject( id, layerId )
src/node-interactable.js:410

Get geometric object with given id

Parameters:
  • id <String>

    unique identifier for the geometric object

  • layerId <String>

    unique identifier for the layer


Returns: <Object>

object geometric object with given id

Obejct getObjectZIndexList( layerId, otherLayerIds )
src/node-interactable.js:384

Move geometric object to front (edit zIndex)

Parameters:
  • layerId <String>

    unique identifier for the layer

  • otherLayerIds <Array>

    unique identifiers for other layers to include in list


Returns: <Obejct>

zIndexList list of geometric object ids and there zIndex values

getZIndexOfObj( obj )
src/node-interactable.js:585

Get method for the zIndex of an Object

Parameters:
  • obj <Object>

    pkg information of the geometric object

Boolean hasObjectWithId( id )
src/node-interactable.js:242

Check if an object with given id exists or not

Parameters:
  • id <String>

    unique identifier for the geometric object


Returns: <Boolean>

hasObject whether or not an object with the given id exists

moveObjectToBack( id, layerId, otherLayerIds )
src/node-interactable.js:352

Move geometric object to back (edit zIndex)

Parameters:
  • id <String>

    unique identifier for the geometric object

  • layerId <String>

    unique identifier for the layer

  • otherLayerIds <Array>

    unique identifiers for other layers to include in sort

moveObjectToFront( id, layerId, otherLayerIds )
src/node-interactable.js:320

Move geometric object to front (edit zIndex)

Parameters:
  • id <String>

    unique identifier for the geometric object

  • layerId <String>

    unique identifier for the layer

  • otherLayerIds <Array>

    unique identifiers for other layers to include in sort

removeGeometry( id, layerId )
src/node-interactable.js:155

Remove geometric object from a layer

Parameters:
  • id <String>

    unique identifier for the geometric object

  • layerId <String>

    unique identifier for the layer

removeLayer( id )
src/node-interactable.js:56

Remove layer of interactable objects

Parameters:
  • id <String>

    unique identifier for the layer

Object searchGeometry( point, layerId, ignoreList )
src/node-interactable.js:425

Search for topmost geometric object (optionally within a given layer)

Parameters:
  • point <Object>

    {x: , y: }

  • layerId <String>

    unique identifier for the layer

  • ignoreList <Array>

    list of ids to ignore during the search


Returns: <Object>

geometric object

Object searchGeometryInBox( box, layerId, ignoreList )
src/node-interactable.js:500

Search for topmost geometric object (optionally within a given layer)

Parameters:
  • box <Object>

    {x1: , y1: , x2: , y2: }

  • layerId <String>

    unique identifier for the layer

  • ignoreList <Array>

    list of ids to ignore during the search


Returns: <Object>

geometric object

setZIndexOfObj( obj, zIndex )
src/node-interactable.js:602

Set method for the zIndex of an Object

Parameters:
  • obj <Object>

    pkg information of the geometric object

  • zIndex <Integer>

    determines ordering of the geometries within a given layers