# nko-grid

> A grid-making utility.

Latest version **0.0.5** (published 2021-07-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install nko-grid
pnpm add nko-grid
yarn add nko-grid
bun add nko-grid
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.5 |
| Published | 2021-07-06 |
| First published | 2021-06-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 2.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Nikolai Kozak |
| Maintainers | nikokozak |
| Keywords | grid, utility, p5, three |

## Links

- npm: https://www.npmjs.com/package/nko-grid
- npm.io page: https://npm.io/package/nko-grid

## Alternatives

- [@lexical/table](https://npm.io/package/@lexical/table.md) — 3.0M weekly downloads
- [mantine-datatable](https://npm.io/package/mantine-datatable.md) — 98.2K weekly downloads
- [react-native-collapsible-tab-view](https://npm.io/package/react-native-collapsible-tab-view.md) — 70.6K weekly downloads
- [@handsontable/vue3](https://npm.io/package/@handsontable/vue3.md) — 16.1K weekly downloads
- [vuewordcloud](https://npm.io/package/vuewordcloud.md) — 7.2K weekly downloads

## Recent versions

- 0.0.5 (latest) — 2021-07-06
- 0.0.4 — 2021-07-06
- 0.0.3 — 2021-07-05
- 0.0.2 — 2021-07-05
- 0.0.1 — 2021-06-30

## README

A small utility library for making and working with grids.

## Installation
1. `npm install nko-grid`
2. `import Grid from 'nko-grid'`
3. See docs below for usage.

## Usage

Declare a new NKOGrid(), which takes the following parameters in the form of an object:

```javascript

{
	width: 250 // Default: 100
	height: 250 // Default: 100
	centerX: 125 // Default: 0
	centerY: 125 // Default: 0
	numX: 20 // Default: 10
	numY: 20 // Default: 10
}

```

This will create an instance of the NKOGrid, with the field `yourGrid.nodes` populated with an Array of objects, each having the following properties:

```javascript

	yourNode.x // x position on the canvas
	yourNode.y // y position on the canvas
	yourNode.iX // column of the node
	yourNode.iY // row of the node
	yourNode.data // empty object, can be replaced by custom data, or instances of objects.

```

The NKOGrid instance has two methods: 

- `yourGrid.getNode(column, row)`: returns a node object.
- `yourGrid.getNodeSafe(column, row)`: will throw a RangeError if selection is out of bounds.


## License
MIT

---
_Source: https://npm.io/package/nko-grid · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
