Renderer
class Renderer
A component that manages Panel and its elements
Properties
Methods
Constructor
new Renderer(options, options.align, options.strategy)
PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
---|---|---|---|---|
options | object | An options object | ||
options.align | Constants.ALIGN | string | number | ✔️ | "center" | An align value that will be applied to all panels |
options.strategy | object | ✔️ | An instance of RenderingStrategy(internal module) |
Properties
panels
Array of panels
Type: Array<Panel>
See:
panelCount
Count of panels
Type: number
strategy
⚠️ This member is for internal use only.
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 |
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 |
checkPanelContentsReady
PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
---|---|---|---|---|
checkingPanels | Panel[] |
⚠️ This function is for internal use only.