{
  "definitions": [
    {
      "callable": true,
      "callees": [],
      "callers": [
        {
          "file": "core/aggregators/representation.grid.aggregator.ts",
          "name": "observe",
          "source": {
            "href": "https://banes-lab.com/anatomy/patterns#file-patterns-core-aggregators-representation-grid-aggregator-ts",
            "json": "https://banes-lab.com/json/source/patterns/core/aggregators/representation.grid.aggregator.ts",
            "label": "core/aggregators/representation.grid.aggregator.ts",
            "markdown": "https://banes-lab.com/source/patterns/core/aggregators/representation.grid.aggregator.ts.md",
            "ref": "anatomy:file-patterns-core-aggregators-representation-grid-aggregator-ts"
          }
        }
      ],
      "exported": false,
      "flow": "leaf",
      "kind": "lexical_declaration",
      "line": 11,
      "name": "isNumberPair",
      "signature": "const isNumberPair = function isNumberPair(value: unknown): value is [number, number] {"
    },
    {
      "callable": true,
      "callees": [
        {
          "file": "core/aggregators/representation.grid.aggregator.ts",
          "name": "isNumberPair",
          "source": {
            "href": "https://banes-lab.com/anatomy/patterns#file-patterns-core-aggregators-representation-grid-aggregator-ts",
            "json": "https://banes-lab.com/json/source/patterns/core/aggregators/representation.grid.aggregator.ts",
            "label": "core/aggregators/representation.grid.aggregator.ts",
            "markdown": "https://banes-lab.com/source/patterns/core/aggregators/representation.grid.aggregator.ts.md",
            "ref": "anatomy:file-patterns-core-aggregators-representation-grid-aggregator-ts"
          }
        },
        {
          "file": "core/counters/base.counter.ts",
          "name": "increment",
          "source": {
            "href": "https://banes-lab.com/anatomy/patterns#file-patterns-core-counters-base-counter-ts",
            "json": "https://banes-lab.com/json/source/patterns/core/counters/base.counter.ts",
            "label": "core/counters/base.counter.ts",
            "markdown": "https://banes-lab.com/source/patterns/core/counters/base.counter.ts.md",
            "ref": "anatomy:file-patterns-core-counters-base-counter-ts"
          }
        }
      ],
      "callers": [],
      "exported": true,
      "flow": "entry",
      "kind": "method_definition",
      "line": 55,
      "name": "observe",
      "signature": "private observe(value: unknown): void {"
    },
    {
      "callable": true,
      "callees": [
        {
          "file": "core/selectors/record.selector.ts",
          "name": "foldRecords",
          "source": {
            "href": "https://banes-lab.com/anatomy/patterns#file-patterns-core-selectors-record-selector-ts",
            "json": "https://banes-lab.com/json/source/patterns/core/selectors/record.selector.ts",
            "label": "core/selectors/record.selector.ts",
            "markdown": "https://banes-lab.com/source/patterns/core/selectors/record.selector.ts.md",
            "ref": "anatomy:file-patterns-core-selectors-record-selector-ts"
          }
        }
      ],
      "callers": [],
      "exported": true,
      "flow": "entry",
      "kind": "method_definition",
      "line": 28,
      "name": "update",
      "signature": "public update(chunk: readonly unknown[]): void {"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 7,
      "name": "PAIR",
      "signature": "const PAIR = 2;"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 8,
      "name": "DEFAULT_CELL",
      "signature": "const DEFAULT_CELL = 1;"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 9,
      "name": "CELL_SEP",
      "signature": "const CELL_SEP = \",\";"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": true,
      "flow": "isolated",
      "kind": "class_declaration",
      "line": 17,
      "name": "GridAccumulator",
      "signature": "export class GridAccumulator {"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": true,
      "flow": "isolated",
      "kind": "public_field_definition",
      "line": 18,
      "name": "field",
      "signature": "private readonly field: string;"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": true,
      "flow": "isolated",
      "kind": "public_field_definition",
      "line": 19,
      "name": "cellSize",
      "signature": "private readonly cellSize: number;"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": true,
      "flow": "isolated",
      "kind": "public_field_definition",
      "line": 20,
      "name": "cells",
      "signature": "private readonly cells = new Map<string, number>();"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": true,
      "flow": "isolated",
      "kind": "public_field_definition",
      "line": 21,
      "name": "points",
      "signature": "private points = 0;"
    },
    {
      "callable": true,
      "callees": [],
      "callers": [],
      "exported": true,
      "flow": "isolated",
      "kind": "method_definition",
      "line": 23,
      "name": "constructor",
      "signature": "public constructor(field: string, cellSize = DEFAULT_CELL) {"
    },
    {
      "callable": true,
      "callees": [],
      "callers": [],
      "exported": true,
      "flow": "isolated",
      "kind": "method_definition",
      "line": 34,
      "name": "sample",
      "signature": "public sample(rng: Rng): [number, number] | null {"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": true,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 35,
      "name": "key",
      "signature": "const key = weightedChoice(rng, this.cells);"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": true,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 39,
      "name": "[cellX = 0, cellY = 0]",
      "signature": "const [cellX = 0, cellY = 0] = key.split(CELL_SEP).map(Number);"
    },
    {
      "callable": true,
      "callees": [],
      "callers": [],
      "exported": true,
      "flow": "isolated",
      "kind": "method_definition",
      "line": 43,
      "name": "result",
      "signature": "public result(): GridSummary {"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": true,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 44,
      "name": "densestCell",
      "signature": "let densestCell = \"\";"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": true,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 45,
      "name": "densestCount",
      "signature": "let densestCount = this.cells.size === 0 ? 0 : -1;"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": true,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 60,
      "name": "[x, y]",
      "signature": "const [x, y] = value;"
    }
  ],
  "document": null,
  "findings": [],
  "generated": false,
  "href": "https://banes-lab.com/anatomy/patterns#file-patterns-core-aggregators-representation-grid-aggregator-ts",
  "language": "typescript",
  "layer": "processing",
  "name": "representation.grid.aggregator.ts",
  "path": "core/aggregators/representation.grid.aggregator.ts",
  "ref": "anatomy:file-patterns-core-aggregators-representation-grid-aggregator-ts",
  "relations": [
    {
      "links": [
        {
          "href": "https://banes-lab.com/anatomy/patterns#folder-patterns-core-aggregators",
          "json": "https://banes-lab.com/json/anatomy/patterns/folder-patterns-core-aggregators",
          "label": "core/aggregators",
          "markdown": "https://banes-lab.com/anatomy/patterns/folder-patterns-core-aggregators.md",
          "ref": "chapter:/anatomy/patterns#folder-patterns-core-aggregators"
        }
      ],
      "relation": "contained-in"
    },
    {
      "links": [
        {
          "href": "https://banes-lab.com/anatomy/patterns#file-patterns-core-counters-base-counter-ts",
          "json": "https://banes-lab.com/json/source/patterns/core/counters/base.counter.ts",
          "label": "core/counters/base.counter.ts",
          "markdown": "https://banes-lab.com/source/patterns/core/counters/base.counter.ts.md",
          "ref": "anatomy:file-patterns-core-counters-base-counter-ts"
        },
        {
          "href": "https://banes-lab.com/anatomy/patterns#file-patterns-core-selectors-record-selector-ts",
          "json": "https://banes-lab.com/json/source/patterns/core/selectors/record.selector.ts",
          "label": "core/selectors/record.selector.ts",
          "markdown": "https://banes-lab.com/source/patterns/core/selectors/record.selector.ts.md",
          "ref": "anatomy:file-patterns-core-selectors-record-selector-ts"
        }
      ],
      "relation": "uses"
    },
    {
      "links": [
        {
          "href": "https://banes-lab.com/anatomy/patterns#folder-patterns-core-aggregators",
          "json": "https://banes-lab.com/json/anatomy/patterns/folder-patterns-core-aggregators",
          "label": "core/aggregators",
          "markdown": "https://banes-lab.com/anatomy/patterns/folder-patterns-core-aggregators.md",
          "ref": "chapter:/anatomy/patterns#folder-patterns-core-aggregators"
        },
        {
          "href": "https://banes-lab.com/anatomy/patterns#folder-patterns-core-counters",
          "json": "https://banes-lab.com/json/anatomy/patterns/folder-patterns-core-counters",
          "label": "core/counters",
          "markdown": "https://banes-lab.com/anatomy/patterns/folder-patterns-core-counters.md",
          "ref": "chapter:/anatomy/patterns#folder-patterns-core-counters"
        },
        {
          "href": "https://banes-lab.com/anatomy/patterns#folder-patterns-core-selectors",
          "json": "https://banes-lab.com/json/anatomy/patterns/folder-patterns-core-selectors",
          "label": "core/selectors",
          "markdown": "https://banes-lab.com/anatomy/patterns/folder-patterns-core-selectors.md",
          "ref": "chapter:/anatomy/patterns#folder-patterns-core-selectors"
        }
      ],
      "relation": "linked-from"
    }
  ],
  "slots": {
    "concern": "aggregator",
    "subject": "representation",
    "variant": "grid"
  },
  "stats": {
    "bytes": 2133,
    "callable": 6,
    "definitions": 19,
    "edges": 3,
    "exported": 15,
    "files": 1,
    "findings": {},
    "flows": {
      "leaf": 1,
      "entry": 2,
      "isolated": 16
    },
    "lines": {
      "blank": 8,
      "code": 55,
      "total": 63
    }
  },
  "summary": "55 lines of code and 19 definitions.",
  "text": "https://banes-lab.com/source/patterns/core/aggregators/representation.grid.aggregator.ts.txt",
  "tree": "patterns",
  "siblings": {
    "next": {
      "href": "https://banes-lab.com/anatomy/patterns#file-patterns-core-aggregators-representation-sequence-aggregator-ts",
      "json": "https://banes-lab.com/json/source/patterns/core/aggregators/representation.sequence.aggregator.ts",
      "label": "core/aggregators/representation.sequence.aggregator.ts",
      "markdown": "https://banes-lab.com/source/patterns/core/aggregators/representation.sequence.aggregator.ts.md",
      "ref": "anatomy:file-patterns-core-aggregators-representation-sequence-aggregator-ts"
    },
    "previous": {
      "href": "https://banes-lab.com/anatomy/patterns#file-patterns-core-aggregators-representation-graph-aggregator-ts",
      "json": "https://banes-lab.com/json/source/patterns/core/aggregators/representation.graph.aggregator.ts",
      "label": "core/aggregators/representation.graph.aggregator.ts",
      "markdown": "https://banes-lab.com/source/patterns/core/aggregators/representation.graph.aggregator.ts.md",
      "ref": "anatomy:file-patterns-core-aggregators-representation-graph-aggregator-ts"
    }
  },
  "up": {
    "href": null,
    "json": "https://banes-lab.com/json/api/source/patterns/core/aggregators",
    "label": "core/aggregators",
    "markdown": "https://banes-lab.com/api/source/patterns/core/aggregators.md",
    "ref": "api:source/patterns/core/aggregators"
  }
}
