Skip to main content

Block Model

Data structure for seat blocks/sections.

Hierarchy

BlockModel is a direct child of the root DataModel:

DataModel
└── blocks[] (array of BlockModel) ← You are here
├── seats[] (array of SeatModel)
└── labels[] (array of LabelModel)

Full hierarchy example:

{
"blocks": [
{ // ← YOU ARE HERE
"id": "orchestra",
"title": "Orchestra",
"color": "#2c3e50",
"background_image": "orchestra.jpg",
"background_opacity": 0.3,
"seats": [ // ← seats array (SeatModel[])
{
"id": "A1",
"x": 0,
"y": 0,
"title": "A1",
"salable": true
},
{
"id": "A2",
"x": 30,
"y": 0,
"title": "A2",
"salable": true
}
],
"labels": [ // ← labels array (LabelModel[])
{
"title": "Row A",
"x": -30,
"y": 0
}
]
}
]
}

Properties

PropertyTypeRequiredDefaultDescription
idstring | number-Unique identifier
titlestring-Display name
colorstring"#2c2828"Block color
seatsSeatModel[]-Array of seats
labelsLabelModel[][]Array of labels
background_imagestring-Background image URL
background_opacitynumber0.3Opacity (0-1)
background_fitstring"cover"Fit mode

Example

{
"id": 1,
"title": "VIP Section",
"color": "#ff6b6b",
"background_image": "vip-section.jpg",
"labels": [
{ "title": "Row A", "x": -30, "y": 0 }
],
"seats": [
{ "id": 1, "x": 0, "y": 0, "title": "A1", "salable": true }
]
}

TypeScript

interface BlockData {
id: string | number;
title: string;
color?: string;
seats: SeatData[];
labels?: LabelData[];
background_image?: string;
background_opacity?: number;
background_fit?: 'cover' | 'contain' | 'fill' | 'none';
}