Skip to content
sharma-subendra-kr edited this page Jul 26, 2020 · 2 revisions

Classes

LimberGridView

Typedefs

options : object

Parameters to constructor function

isMobileCheckboolean
itemMouseDownMoveCheckboolean
itemMouseDownResizeCheckboolean
gridData : object

Warning: Keys here to be set only once during the application development lifecycle. Changes later on are dangerous and will result in unwanted behaviour. Output from function getGridData are scaled as per the dimensions defined here. If custom values are used then they should be passed everytime a new instance is created.

positionData : Array.<object>

Array of Position Data of the items on grid. These are scaled during the runtime. Use getGridData function to get data to store on the database which is scaled accorging to gridData.

callbacks : object

Object containing all the callbacks

renderComplete : function
renderContentstring | Element | object
addComplete : function
removeComplete : function
moveComplete : function
resizeComplete : function
renderPlugin : function
removePlugin : function
publicConstants : object

Constants which you can change or set at any point of time to get the desired behaviour.

LimberGridView

Kind: global class

limberGridView.renderItem(index)

Call this function to forcefully re-render the contents of the item. Internally calls renderContent. Must be called inside resizeComplete

Kind: instance method of LimberGridView

Param Type Description
index number Index of item to force re-render.

limberGridView.getGridData() ⇒ object

Call this function to get positionData scaled according to gridData.

Kind: instance method of LimberGridView
Returns: object - Object containing gridData and positionData.

limberGridView.setDeskInteractMode(flag)

Call this function to change DESK_INTERACTION_MODE during runtime.

Kind: instance method of LimberGridView

Param Type Description
flag string String "ADD" or "CUTSPACE"

limberGridView.setLatchMovedItem(flag)

Call this function to change LATCH_MOVED_ITEM during runtime.

Kind: instance method of LimberGridView

Param Type Description
flag boolean Boolean true or false. To latch or not to latch.

limberGridView.addItem(item)

Call this function to add an item.

Kind: instance method of LimberGridView

Param Type Description
item object Object with optional properties width and height.

limberGridView.removeItem(index)

Call this function to remove an item with the index.

Kind: instance method of LimberGridView

Param Type Description
index number Index of the item to be removed.

limberGridView.setIsMobileCheck(f)

Set isMobileCheck callback function during runtime

Kind: instance method of LimberGridView

Param Type Description
f isMobileCheck isMobileCheck callback to check if the screen is a mobile device screen.

options : object

Parameters to constructor function

Kind: global typedef
Properties

Name Type Description
el string | object id of the container or element object
editable boolean If enabled user can resize, move, cut space, interactivelu add on the desk. Default is true.
enableInteractiveAddAndCut boolean If enabled user can add and cut space on the desk. Default is true.
enableTouchInteraction boolean If enabled user can use touch interaction on items on desk and on the desk. Default is true.
autoArrange boolean If enabled first render is autoarranged. Autoarrange also happens when a faulty data is received during window resize.
reRenderOnResize boolean If enabled rerender on window resize. Passing false is dangerous. Default is true.
callback isMobileCheck A callback that returns a boolean which tells that the screen is or is not a mobile screen
pseudoElementContainer string | object The id of the element or the element where the pseudo elements are rendered that appear during moving.
callback itemMouseDownMoveCheck A callback function to tell whether the mouse down event has occured at a desired location on the item for move event.
callback itemMouseDownResizeCheck A callback function to tell whether the mouse down event has occured at a desired location on the item for resize event.
gridData object Warning: Keys here to be set only once during the application development lifecycle. Changes later on are dangerous and will result in unwanted behaviour. Output from function getGridData are scaled as per the dimensions defined here. If custom values are used then they should be passed everytime a new instance is created.
positionData Array.<object> input position data of items to render.
callbacks object An object containing various callbacks.
publicConstants object Constants which you can change or set at any point of time to get the desired behaviour.

isMobileCheck ⇒ boolean

Kind: global typedef
Returns: boolean - Returns true if the screen matches media queries for a mobile screen.

itemMouseDownMoveCheck ⇒ boolean

Kind: global typedef
Returns: boolean - Returns true if the mouse down happened at a desired location on the item for move event.

Param Type Description
x Number point along the x axis axis where the mouse down happened on the item
y Number point along the y axis axis where the mouse down happened on the item
positionData object object for the item.
index number Index of the item in positionData array.
target object target element where the mouse down happened.

itemMouseDownResizeCheck ⇒ boolean

Kind: global typedef
Returns: boolean - Returns true if the mouse down happened at a desired location on the item for resize event.

Param Type Description
x Number point along the x axis axis where the mouse down happened on the item
y Number point along the y axis axis where the mouse down happened on the item
positionData object object for the item.
index number Index of the item in positionData array.
target object target element where the mouse down happened.

gridData : object

Warning: Keys here to be set only once during the application development lifecycle. Changes later on are dangerous and will result in unwanted behaviour. Output from function getGridData are scaled as per the dimensions defined here. If custom values are used then they should be passed everytime a new instance is created.

Kind: global typedef
Properties

Name Type Description
WIDTH number Width of the Grid. It is scaled internally as per the device size for visual consistency. Default value is 1920.
HEIGHT number Height of the Grid. It is scaled internally as per the device size for visual consistency. Default value is 1080.
MARGIN number Margin or the items maintained by Arrange Engine. It is scaled internally as per the device size for visual consistency. Default value is 8.
MIN_HEIGHT_AND_WIDTH number Min height and width of the items. It is scaled internally as per the device size for visual consistency. A lower number affects the performance of the arrange algorithm. Default value is 150.

positionData : Array.<object>

Array of Position Data of the items on grid. These are scaled during the runtime. Use getGridData function to get data to store on the database which is scaled accorging to gridData.

Kind: global typedef
Properties

Name Type Description
x number positon of item along the x axis.
y number positon of item along the y axis.
width number Width of the item.
height number Height of the item.

callbacks : object

Object containing all the callbacks

Kind: global typedef
Properties

Name Type Description
callback renderComplete Callback function called after rendering of all the items or a single item are complete. This is not called after re-rendering of items whose indices are affected due to removal of any item.
callback renderContent Callback function called to get the contents to attach to the item as children.
callback addComplete Callback function called when addition of an item is complete.
callback removeComplete Callback function called when removing of item is complete.
callback moveComplete Callback function called when moving of item is complete.
callback resizeComplete Callback function called when resizing of item is complete.
callback renderPlugin Callback function called after renderContent and before renderComplete and addComplete but after removeComplete for items to be rerender after a removeal of an item.
callback removePlugin Callback function called before the item is removed from the DOM. Also before removeComplete.

renderComplete : function

Kind: global typedef

Param Type Description
index undefined | number Index is the index of the item rendered or undefined if the item was rendered by the constructor or on resize.

renderContent ⇒ string | Element | object

Kind: global typedef
Returns: string | Element | object - String representing DOM elements. Instance of an Element. Any object.

Param Type Description
index number Index of the item.
width number Width of the item.
height number Height of the item.
type undefined | string Type is undefined for all occurances except when item is freshly added.

addComplete : function

Kind: global typedef

Param Type Description
index number Index of the item added.

removeComplete : function

Kind: global typedef

Param Type Description
index number Index of the item removed.

moveComplete : function

Kind: global typedef

Param Type Description
index number Index of the item moved.
toX number Position along the x axis where the item is moved.
toY number Position along the y axis where the item is moved.
arrangedIndices Array.<number> Indices of the arranged items.

resizeComplete : function

Kind: global typedef

Param Type Description
index number Index of the resized item.
width number Width of the item resized.
height number Height of the item resized.
arrangedIndices Array.<number> Indices of the arranged items.

renderPlugin : function

Kind: global typedef

Param Type Description
renderData object Data received from renderContent callback.
element Element Element object of the item that is being rendered.

removePlugin : function

Kind: global typedef

Param Type Description
element Element Element which is going to be removed.

publicConstants : object

Constants which you can change or set at any point of time to get the desired behaviour.

Kind: global typedef
Properties

Name Type Description
mobileAspectRatio number A nummber denoting the aspect ratio of each item for mobile view e.g. 5:4. Default value is 5/4.
moveGuideRadius number Radius of the Move guide radius a pseudo element at the top left corner of the item. You can remove move guide for a customized look and feel. Default value is 10.
resizeSquareGuideLength number Length of the square that is rendered at the bottom right corner of the item as a pseudo element. Default value is 10.
resizeSquareGuideBorderWidth number Width of the border of the square that is rendered at the bottom right corner of the item as a pseudo element. Default value is 3.
autoScrollDistance number A number by which the grid or desk is scrolled automatically on height increments for touch mode. Default value is 50.
autoScrollPoint number A height above the bottom at which scroll happens automatically for touch mode. Default value is 50.
moveOrResizeHeightIncrements number A number by which the height of the grid view is increased while resizing, adding or cuttting space when you reach the bottom for touch mode. Default value is 50.
mouseDownTime number Time to wait before initiating move, add or resize routines for mouse interaction. Default value is 500ms.
touchHoldTime number Time to wait before initiating move, add or resize routines for touch mode. Default value is 300ms.
demoWaitTime number TIme to wait before a demo of resize or move is initiated. Waring a very low demo wait time will cause unwanted behaviour as the algorithm needs some time to calculate next positions. Default is 500ms.
windowResizeTimeTime number Time to wait before initiating resize routines. Default value is 1000ms.
deskInteraction string Flag which tells whether the user wants to add an item or cut space by mouse or touch interaction. Default value is ADD.
latchMovedItem boolean To latch or not to latch on to other items when overlapped while dragging to move an item. Default value is true.
animateMovedItem boolean Wether to animate or not to animate the moved item. Default value is false.
animateTime numer Time to wait before re-activating animate to the moved item. Re-activating means the moved item should animate if other items are moved resized later. This flag might have some more features later on. Default value is 250ms.