react-konva-grid
Advanced tools
Comparing version
{ | ||
"name": "react-konva-grid", | ||
"description": "Canvas grid to render large set of tabular data with virtualization.", | ||
"version": "2.0.5", | ||
"version": "2.0.6", | ||
"main": "dist/index.js", | ||
@@ -15,3 +15,4 @@ "license": "MIT", | ||
"postpublish": "storybook-to-ghpages", | ||
"prettier": "prettier src/**/*.tsx --write" | ||
"prettier": "prettier src/**/*.tsx --write", | ||
"test": "jest" | ||
}, | ||
@@ -27,2 +28,3 @@ "author": "Vinay M <rmdort@gmail.com>", | ||
"dependencies": { | ||
"@types/jest": "^25.2.3", | ||
"konva": "^6.0.0", | ||
@@ -60,2 +62,3 @@ "react-konva": "^16.13.0-3" | ||
"husky": "^4.2.5", | ||
"jest": "^26.0.1", | ||
"lint-staged": "^10.2.4", | ||
@@ -62,0 +65,0 @@ "prettier": "^2.0.5", |
@@ -17,2 +17,3 @@ ## Declarative Canvas Grid with React Konva | ||
- :fire: Freeze rows and columns | ||
- :white_square_button: Merge rows and columns | ||
- :hand: Resizable headers | ||
@@ -40,3 +41,3 @@ - :hammer_and_wrench: Fully typed API written in TypeScript | ||
Konva grid will work with any browser that supports [react](https://github.com/facebook/react/), [konva](https://konvajs.org/) and canvas element. | ||
Konva grid will work in any browser that supports [react](https://github.com/facebook/react/), [konva](https://konvajs.org/) and canvas element. | ||
@@ -105,2 +106,3 @@ ## Usage | ||
| selections | false | Array | Array of selected cell areas | []| | ||
| mergedCells | false | Array | Array of merged cell areas | []| | ||
| frozenRows | false | number | No of frozen rows | 0 | | ||
@@ -138,2 +140,2 @@ | frozenColumns | false | number | No of frozen columns | 0 | | ||
yarn storybook | ||
```` | ||
```` |
@@ -137,8 +137,9 @@ // Utilities extracted from https://github.com/bvaughn/react-window | ||
export const getBoundedCells = (area: IArea) => { | ||
export const getBoundedCells = (area: IArea | null | undefined) => { | ||
const cells = new Set(); | ||
if (!area) return cells; | ||
const { top, bottom, left, right } = area; | ||
const cells = new Set(); | ||
for (let i = top; i <= bottom; i++) { | ||
for (let j = left; j <= right; j++) { | ||
cells.add(JSON.stringify([i, j])); | ||
cells.add(cellIndentifier(i, j)); | ||
} | ||
@@ -418,1 +419,7 @@ } | ||
}; | ||
/* Create a stringified cell identifier */ | ||
export const cellIndentifier = ( | ||
rowIndex: number, | ||
columnIndex: number | ||
): string => [rowIndex, columnIndex].toString(); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
8046415
0.15%16
23.08%2193
18.22%138
2.22%5
25%19
5.56%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added