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 item
options
Returns:
- Type
- undefined
-
addItems(items, options) → {undefined}
-
Adds Items to the ItemCollection
Parameters:
Name Type Description items
options
Returns:
- 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 options
Returns:
- 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 id
Returns:
- Type
- undefined
-
getItemCollectionEvents()
-
Events to bind to on the ItemCollection
-
getItems(filter) → {undefined}
-
Gets Items from the ItemCollection
Parameters:
Name Type Argument Default Description filter
function <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 e
Returns:
- Type
- undefined
-
onAnyItemCollectionEvent(e) → {undefined}
-
Called on any ItemCollection event.
Parameters:
Name Type Description e
Returns:
- 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 itemOrItemId
Item | string the item or item id to pan to renderIdOrIndex
string | 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 item
options
Returns:
- 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 animator
Returns:
- Type
- undefined
-
setCanvas(canvas) → {undefined}
-
Sets the Canvas
Parameters:
Name Type Description canvas
Returns:
- Type
- undefined
-
setConfig(config) → {undefined}
-
Sets the config object.
Parameters:
Name Type Description config
Returns:
- 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 filter
Returns:
- Type
- undefined
-
setFrame(frame) → {undefined}
-
Sets the Frame
Parameters:
Name Type Description frame
Returns:
- Type
- undefined
-
setItemCollection(itemCollection) → {undefined}
-
Sets the ItemCollection.
Parameters:
Name Type Description itemCollection
Returns:
- Type
- undefined
-
setLayout(layout) → {undefined}
-
Sets the Layout
Parameters:
Name Type Description layout
Returns:
- Type
- undefined
-
setLayoutAndPanToItem(layout, itemOrItemId, renderIdOrIndex) → {undefined}
-
Parameters:
Name Type Argument Default Description layout
Layout new layout to set itemOrItemId
Item | string item or item id renderIdOrIndex
string | 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 isReversed
Returns:
- 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 sortBy
Returns:
- Type
- undefined
-
setViewport(viewport) → {undefined}
-
Sets the Viewport
Parameters:
Name Type Description viewport
Returns:
- 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