From 9b3819233453ec5d949073bde43fecbd20faf4c6 Mon Sep 17 00:00:00 2001 From: Azgaar Date: Sat, 4 Jun 2022 13:19:54 -0700 Subject: [PATCH] Updated Data model (markdown) --- Data-model.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Data-model.md b/Data-model.md index 6c0a977..6986e12 100644 --- a/Data-model.md +++ b/Data-model.md @@ -13,10 +13,11 @@ Repacking is a process of amending an initial [voronoi diagram](https://en.wikip Both `grid` and `pack` objects include data representing voronoi diagrams and their inner connections. Both initial and repacked voronoi can be build from the initial set of points, so this data is stored in memory only. It does not included into the .map file and getting calculated on map load. ### Grid object +* `grid.cellsDesired`: `number` - initial count of cells/points requested for map creation. Used to define `spacing` and place points on a jittered square grid, hence the object name. Actual number of cells is defined by the number points able to place on a square grid. Default `cellsDesired` is 10 000, maximum - 100 000, minimal - 1 000 * `grid.spacing`: `number` - spacing between points before jittering * `grid.cellsY`: `number` - number of cells in column * `grid.cellsX`: `number` - number of cells in row -* `grid.points`: `number[][]` - initial coordinates `[x, y]` based on jittered square grid. Numbers rounded to 2 decimals +* `grid.points`: `number[][]` - coordinates `[x, y]` based on jittered square grid. Numbers rounded to 2 decimals * `grid.boundary`: `number[][]` - off-canvas points coordinates used to cut the diagram approximately by canvas edges. Integers * `grid.cells`: `{}` - cells data object, including voronoi data: * * `grid.cells.i`: `number[]` - cell indexes `Uint16Array` or `Uint32Array` (depending on cells number)