# at.atmosynth.patchPresentation

> A patch's presentation, in the repository that holds the patch and under the patch's own record key: the key is the link, and nothing in it names the patch. A patch and its presentation are written together. A patch with none, or whose presentation cannot be read, is still drawn: from its instances' deprecated `position` fields where they say anything, and otherwise by the reader's own layout.

- Kind: record
- Record key: tid
- Authority: atmosynth.at
- Lexicon: 1
- Published by [atmosynth.at](https://lexicon.garden/identity/did:plc:fzjkahpwapmoqxybwdjb6ysf), the NSID's authority

## Links

- [Documentation](https://lexicon.garden/lexicon/did:plc:fzjkahpwapmoqxybwdjb6ysf/at.atmosynth.patchPresentation)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:fzjkahpwapmoqxybwdjb6ysf/at.atmosynth.patchPresentation/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:fzjkahpwapmoqxybwdjb6ysf/at.atmosynth.patchPresentation/analytics)

## Record (`at.atmosynth.patchPresentation`)

Type: record · key tid

### Properties

- `createdAt` (string · datetime, required)
- `frames` (array): The patch's frames, each a named, coloured rectangle on the canvas the positions are on. Nothing lists which blocks a frame holds: what stands inside it is in it, and moves with it. Where neither of two frames is inside the other, the later one here is drawn above. Optional: absent is no frames.
  - Constraints: maxLength: 256
  - `items` (ref)
    - Reference: `#frame`
- `positions` (array): Where each block stands, one entry to an instance at most. An entry naming an instance the patch does not have is ignored, and an instance named by none is placed by the reader's own layout. Optional: absent is every block placed that way.
  - `items` (ref)
    - Reference: `#position`

## #frame (`at.atmosynth.patchPresentation#frame`)

Type: object

A named, coloured rectangle round blocks. A block is inside a frame when its position, its top-left corner, is inside the rectangle; a frame is inside another when its whole rectangle is. Moving a frame moves every block and every frame inside it when the move begins.

### Properties

- `colour` (string, required): The hue it is drawn in, by name rather than as a colour value, so that every reader draws it right for its own theme and contrast. A reader meeting a name it does not know draws the frame in its neutral colour.
  - Constraints: maxLength: 32, knownValues: red | orange | yellow | green | teal | blue | purple | pink
- `height` (integer, required): How far it reaches down from `y`: its bottom edge is at `y + height`, which is outside it.
  - Constraints: minimum: 1
- `id` (string, required): This frame's name within the presentation, never shown. Unique in it, and kept for as long as the frame is, so that two people editing one frame at once are editing the same one.
  - Constraints: minLength: 1, maxLength: 64
- `name` (string): What the creator called it, written on its top border. Optional: absent is a frame with no label.
  - Constraints: minLength: 1, maxLength: 320, maxGraphemes: 64
- `width` (integer, required): How far it reaches right of `x`: its right edge is at `x + width`, which is outside it.
  - Constraints: minimum: 1
- `x` (integer, required): The left edge, on the canvas the positions are on.
- `y` (integer, required): The top edge.

## #position (`at.atmosynth.patchPresentation#position`)

Type: object

Where one block stands: the top-left corner of the block, on the patch's canvas, in the units the canvas is drawn in.

### Properties

- `instanceId` (string, required): The instance this is the position of: an `instanceId` of the patch.
  - Constraints: minLength: 1, maxLength: 64
- `x` (integer, required)
- `y` (integer, required)

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "frame": {
      "description": "A named, coloured rectangle round blocks. A block is inside a frame when its position, its top-left corner, is inside the rectangle; a frame is inside another when its whole rectangle is. Moving a frame moves every block and every frame inside it when the move begins.",
      "properties": {
        "colour": {
          "description": "The hue it is drawn in, by name rather than as a colour value, so that every reader draws it right for its own theme and contrast. A reader meeting a name it does not know draws the frame in its neutral colour.",
          "knownValues": [
            "red",
            "orange",
            "yellow",
            "green",
            "teal",
            "blue",
            "purple",
            "pink"
          ],
          "maxLength": 32,
          "type": "string"
        },
        "height": {
          "description": "How far it reaches down from `y`: its bottom edge is at `y + height`, which is outside it.",
          "minimum": 1,
          "type": "integer"
        },
        "id": {
          "description": "This frame's name within the presentation, never shown. Unique in it, and kept for as long as the frame is, so that two people editing one frame at once are editing the same one.",
          "maxLength": 64,
          "minLength": 1,
          "type": "string"
        },
        "name": {
          "description": "What the creator called it, written on its top border. Optional: absent is a frame with no label.",
          "maxGraphemes": 64,
          "maxLength": 320,
          "minLength": 1,
          "type": "string"
        },
        "width": {
          "description": "How far it reaches right of `x`: its right edge is at `x + width`, which is outside it.",
          "minimum": 1,
          "type": "integer"
        },
        "x": {
          "description": "The left edge, on the canvas the positions are on.",
          "type": "integer"
        },
        "y": {
          "description": "The top edge.",
          "type": "integer"
        }
      },
      "required": [
        "id",
        "colour",
        "x",
        "y",
        "width",
        "height"
      ],
      "type": "object"
    },
    "main": {
      "description": "A patch's presentation, in the repository that holds the patch and under the patch's own record key: the key is the link, and nothing in it names the patch. A patch and its presentation are written together. A patch with none, or whose presentation cannot be read, is still drawn: from its instances' deprecated `position` fields where they say anything, and otherwise by the reader's own layout.",
      "key": "tid",
      "record": {
        "properties": {
          "createdAt": {
            "format": "datetime",
            "type": "string"
          },
          "frames": {
            "description": "The patch's frames, each a named, coloured rectangle on the canvas the positions are on. Nothing lists which blocks a frame holds: what stands inside it is in it, and moves with it. Where neither of two frames is inside the other, the later one here is drawn above. Optional: absent is no frames.",
            "items": {
              "ref": "#frame",
              "type": "ref"
            },
            "maxLength": 256,
            "type": "array"
          },
          "positions": {
            "description": "Where each block stands, one entry to an instance at most. An entry naming an instance the patch does not have is ignored, and an instance named by none is placed by the reader's own layout. Optional: absent is every block placed that way.",
            "items": {
              "ref": "#position",
              "type": "ref"
            },
            "type": "array"
          }
        },
        "required": [
          "createdAt"
        ],
        "type": "object"
      },
      "type": "record"
    },
    "position": {
      "description": "Where one block stands: the top-left corner of the block, on the patch's canvas, in the units the canvas is drawn in.",
      "properties": {
        "instanceId": {
          "description": "The instance this is the position of: an `instanceId` of the patch.",
          "maxLength": 64,
          "minLength": 1,
          "type": "string"
        },
        "x": {
          "type": "integer"
        },
        "y": {
          "type": "integer"
        }
      },
      "required": [
        "instanceId",
        "x",
        "y"
      ],
      "type": "object"
    }
  },
  "description": "How a patch is drawn: where its blocks stand, and its frames. It is kept beside the patch rather than in it, and nothing in it changes what is heard, so whatever only plays a patch never reads it. A field that only says how a patch is drawn belongs here, never in the patch.",
  "id": "at.atmosynth.patchPresentation",
  "lexicon": 1
}
```
