VanillaRenderer
class VanillaRenderer extends Renderer
Properties
panels
Array of panels
Type: Array<Panel>
See:
rendering
A boolean value indicating whether rendering is in progress
Type: boolean
panelCount
Count of panels
Type: number
strategy
align
A Panel's align value that applied to all panels
Type: Constants.ALIGN | string | number
Methods
render
Render panel elements inside the camera element
Returns: this
init
Initialize Renderer
Returns: this
PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
---|---|---|---|---|
flicking | Flicking | An instance of Flicking |
destroy
Destroy Renderer and return to initial state
Returns: void
getPanel
Return the Panel at the given index. null
if it doesn't exists.
Returns: Panel | null
- Panel at the given index
PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
---|---|---|---|---|
index | number |
See:
updatePanelSize
Update all panel sizes
Returns: this
batchInsert
Insert new panels at given index
This will increase index of panels after by the number of panels added
Returns: Array<Panel>
- An array of prepended panels
PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
---|---|---|---|---|
items | Array<object> | An array of items to insert | ||
items.index | number | ✔️ | Index to insert new panels at | |
items.elements | Array<any> | ✔️ | An array of element or framework component with element in it | |
items.hasDOMInElements | boolean | ✔️ | Whether it contains actual DOM elements. If set to true, renderer will add them to the camera element |
batchInsertDefer
Defers update
camera position & others will be updated after calling updateAfterPanelChange
PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
---|---|---|---|---|
...items | Array<{index: number, elements: any[], hasDOMInElements: boolean}> |
batchRemove
Remove the panel at the given index
This will decrease index of panels after by the number of panels removed
Returns: Panel[]
- An array of removed panels
PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
---|---|---|---|---|
items | Array<object> | An array of items to remove | ||
items.index | number | ✔️ | Index of panel to remove | |
items.deleteCount | number | ✔️ | 1 | Number of panels to remove from index |
items.hasDOMInElements | boolean | ✔️ | 1 | Whether it contains actual DOM elements. If set to true, renderer will remove them from the camera element |
batchRemoveDefer
Defers update
camera position & others will be updated after calling updateAfterPanelChange
PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
---|---|---|---|---|
...items | Array<{index: number, deleteCount: number, hasDOMInElements: boolean}> |
updateAfterPanelChange
PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
---|---|---|---|---|
panelsAdded | Panel[] | |||
panelsRemoved | Panel[] |
checkPanelContentsReady
PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
---|---|---|---|---|
checkingPanels | Panel[] |