1.7.0 • Published 30 days ago

react-grid-panzoom v1.7.0

Weekly downloads
-
License
MIT
Repository
github
Last release
30 days ago

react-grid-panzoom

React component for grid layout with pan and zoom.

"Preview"

Demo

https://codesandbox.io/p/sandbox/hardcore-leavitt-mv3wrg https://codesandbox.io/p/sandbox/xenodochial-ride-l2jc5h https://codesandbox.io/p/sandbox/stupefied-euclid-xwkjl8

Installation

npm install react-grid-panzoom

Properties

NameDefaultDescription
boundaryboolfalsepossibility to move grid outside container
disabledMoveboolfalsedisable moving grid
disabledScrollHorizontalboolfalsedisable scrolling grid horizontally
disabledScrollVerticalboolfalsedisable scrolling grid vertically
disabledZoomboolfalsedisable zooming grid
elements[]array[]grid elements
elements[].idstring / numberid of element
elements[].familystringid of elements family
elements[].fullHeightbooltrueExpand element to full height of element container
elements[].xnumberx position of element in grid
elements[].ynumbery position of element in grid
elements[].wnumber1width of element in grid
elements[].hnumber / 'auto'1height of element in grid. 'auto' if it should automatically calculate how many rows element takes space in grid (rounded up)
element[].renderfuncrender function for element
element[].resizablebooltrueis element resizable
element[].disabledboolfalseis element disabled
element[].draggableSelectorstringallow to drag element only if click is inside matching selector
elementResizerWidthnumber15width of resizer element
helpLinesboolfalsedisplay help lines in grid. helpful on grid with multiple columns/rows
ref: React.Refassign lib API to ref
rowHeightnumberheight of each row
colsnumbernumber of columns
rowsnumber'auto'number of rows in grid, 'auto' if it should automatically expand grid
setElementsfuncset elements in grid
gapHorizontalnumbergap between rows in grid
gapVerticalnumbergap between columns in grid
onContainerChangefuncevent on move/zoom grid
onContainerContextMenufuncevent on open context menu
onElementClickfuncevent on element click
onElementContextMenufuncevent on right click of element (context menu)
onElementsMeasureUpdatefuncevent on recalculate elements height (helpful when there are elements with 'auto' height)
organizeGridElementsfuncfunction for organizing elements in grid
paddingLeftnumbergrid padding left
paddingRightnumbergrid padding right
widthnumbergrid width
1.7.0

30 days ago

1.6.0

1 month ago

1.5.0

2 months ago

1.4.2

3 months ago

1.4.1

3 months ago

1.4.0

4 months ago

1.3.0

4 months ago

1.2.0

4 months ago

1.1.0

4 months ago

1.0.5

4 months ago

1.0.4

5 months ago

1.0.3

5 months ago