API Docs for: 2.0.0

Class SAGE2ItemList

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

SAGE2ItemList object

SAGE2ItemList( )
src/node-sage2itemlist.js:25
addButtonToItem( id, buttonId, type, geometry )
src/node-sage2itemlist.js:78

Add an interactable button to an item in the list

Parameters:
  • id <String>

    id of item

  • buttonId <String>

    id of button

  • type <String>

    "rectangle" or "circle"

  • geometry <Object>

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

addItem( item )
src/node-sage2itemlist.js:38

Add new item to list

Parameters:
  • item <Object>

    item to be added into list (must have property id)

editButtonOnItem( id, buttonId, type, geometry )
src/node-sage2itemlist.js:91

Edit an interactable button for an item in the list

Parameters:
  • id <String>

    id of item

  • buttonId <String>

    id of button

  • type <String>

    "rectangle" or "circle"

  • geometry <Object>

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

editButtonVisibilityOnItem( id, buttonId, visible )
src/node-sage2itemlist.js:104

Edit visibility for an interactable button for an item in the list

Parameters:
  • id <String>

    id of item

  • buttonId <String>

    id of button

  • visible <Boolean>

    whether or not the button is visible

editItem( id, newProperties )
src/node-sage2itemlist.js:64

Edit item in list

Parameters:
  • id <String>

    id of item to be edited

  • newProperties <Object>

    properties to add / change in item

Object findButtonByPoint( id, point )
src/node-sage2itemlist.js:116

Test to see which button is under a given point

Parameters:
Returns: <Object>

button button under the point

Object getItemById( id )
src/node-sage2itemlist.js:143

Get an item from the list with a given id

Parameters:
  • id <String>

    id of item to retrieve


Returns: <Object>

item item with given id

removeItem( id )
src/node-sage2itemlist.js:50

Remove item from list

Parameters:
  • id <String>

    id of item to be removed from list

Array sortList( property )
src/node-sage2itemlist.js:128

Sort the list by a given property

Parameters:
  • property <String>

    property to sort items by


Returns: <Array>

order list of keys sorted by propery