new Deck(options)
Creates the Deck object, which is the top-level API for managing the decks system.
Contains all of the coordinating objects for managing items, collections of items,
viewports, layouts, etc.
Parameters:
| Name | Type | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object | Deck options
Properties
|
Mixes In
Members
Methods
-
addItem(item, options) → {undefined}
-
Adds an Item to the ItemCollection
Parameters:
Name Type Description itemoptionsReturns:
- Type
- undefined
-
addItems(items, options) → {undefined}
-
Adds Items to the ItemCollection
Parameters:
Name Type Description itemsoptionsReturns:
- Type
- undefined
-
bind() → {undefined}
-
Binds the Emitter and ItemCollection event handlers.
Returns:
- Type
- undefined
-
bindGestures() → {undefined}
-
Binds all GestureHandlers and GestureHandlerGroups.
Returns:
- Type
- undefined
-
bindLayout() → {undefined}
-
Returns:
- Type
- undefined
-
clear(options) → {undefined}
-
Clears all Items from the ItemCollection
Parameters:
Name Type Description optionsReturns:
- Type
- undefined
-
destroy() → {undefined}
-
Returns:
- Type
- undefined
-
disableDrawing() → {undefined}
-
Disables drawing (re-enable by calling Viewport#enableDrawing
Returns:
- Type
- undefined
-
draw() → {undefined}
-
Requests a manual redraw and reload cycle on all the items. This is normally not needed, as decks will attempt to always redraw and reload whenever necessary, but can be used to force a redraw/reload to happen.
Returns:
- Type
- undefined
-
enableDrawing() → {undefined}
-
Enables drawing (if it had previously been disabled with Viewport#disableDrawing
Returns:
- Type
- undefined
-
getEmitterEvents()
-
Events to bind to on the shared Emitter.
-
getItem(id) → {undefined}
-
Parameters:
Name Type Description idReturns:
- Type
- undefined
-
getItemCollectionEvents()
-
Events to bind to on the ItemCollection
-
getItems(filter) → {undefined}
-
Gets Items from the ItemCollection
Parameters:
Name Type Argument Default Description filterfunction <optional>
<nullable>
undefined optional filter function which takes an Item Returns:
- Type
- undefined
-
onAnyEmitterEvent(e) → {undefined}
-
Called on any Emitter event.
Parameters:
Name Type Description eReturns:
- Type
- undefined
-
onAnyItemCollectionEvent(e) → {undefined}
-
Called on any ItemCollection event.
Parameters:
Name Type Description eReturns:
- Type
- undefined
-
panToItem(itemOrItemId, renderIdOrIndex) → {undefined}
-
Pans the Canvas to the given Item, with an optional render id (defaults to the first render element).
Parameters:
Name Type Argument Default Description itemOrItemIdItem | string the item or item id to pan to renderIdOrIndexstring | number <optional>
<nullable>
0 the render id or index of the element to pan to * (defaults to the first render element for the item) Returns:
- Type
- undefined
-
removeItem(item, options) → {undefined}
-
Removes an Item from the ItemCollection.
Parameters:
Name Type Description itemoptionsReturns:
- Type
- undefined
-
resize() → {undefined}
-
Requests that the Frame re-calculate it's bounds. If the bounds have changed, it will trigger a redraw, which allows the Viewport to request new renders from the Layout which might result in renders moving to fit in the new Frame size.
Returns:
- Type
- undefined
-
setAnimator(animator) → {undefined}
-
Sets the animator object.
Parameters:
Name Type Description animatorReturns:
- Type
- undefined
-
setCanvas(canvas) → {undefined}
-
Sets the Canvas
Parameters:
Name Type Description canvasReturns:
- Type
- undefined
-
setConfig(config) → {undefined}
-
Sets the config object.
Parameters:
Name Type Description configReturns:
- Type
- undefined
-
setFilter(filter) → {undefined}
-
Sets a filter function on the ItemCollection. Items that do not pass the filter function will have their Item index set to -1, which may cause the renders for the Item to be hidden on the next draw cycle.
Parameters:
Name Type Description filterReturns:
- Type
- undefined
-
setFrame(frame) → {undefined}
-
Sets the Frame
Parameters:
Name Type Description frameReturns:
- Type
- undefined
-
setItemCollection(itemCollection) → {undefined}
-
Sets the ItemCollection.
Parameters:
Name Type Description itemCollectionReturns:
- Type
- undefined
-
setLayout(layout) → {undefined}
-
Sets the Layout
Parameters:
Name Type Description layoutReturns:
- Type
- undefined
-
setLayoutAndPanToItem(layout, itemOrItemId, renderIdOrIndex) → {undefined}
-
Parameters:
Name Type Argument Default Description layoutLayout new layout to set itemOrItemIdItem | string item or item id renderIdOrIndexstring | number <optional>
<nullable>
0 render id or index (defaults to the first render for the Item) Returns:
- Type
- undefined
-
setReversed(isReversed) → {undefined}
-
Sets a reversed flag on the ItemCollection which reverses all the indices of the Items. This triggers a redraw if any Item indices change.
Parameters:
Name Type Description isReversedReturns:
- Type
- undefined
-
setSortBy(sortBy) → {undefined}
-
Sets a sort by function on the ItemCollection. The sort by function will be run over the ItemCollection and may cause the indices to change on zero or more Items. This triggers a redraw for any Item whose index changes.
Parameters:
Name Type Description sortByReturns:
- Type
- undefined
-
setViewport(viewport) → {undefined}
-
Sets the Viewport
Parameters:
Name Type Description viewportReturns:
- Type
- undefined
-
unbind() → {undefined}
-
Unbinds the Emitter and ItemCollection event handlers.
Returns:
- Type
- undefined
-
unbindGestures() → {undefined}
-
Binds all GestureHandlers and GestureHandlerGroups.
Returns:
- Type
- undefined
-
unbindLayout() → {undefined}
-
Returns:
- Type
- undefined