Skip to content

Canvas renderer, layoutToSvg · Browser (SVG: Node too)

@openseat/renderer-konva

Konva canvas renderer for OpenSeat layouts: drawing, hit testing, pan/zoom, selection and transforms.

Draws OpenSeat layouts on a Konva canvas, with pan and zoom, hit testing, selection outlines, drag-to-move, rotate/resize handles, box selection, touch and pinch, and viewport culling. Framework-independent; @openseat/react wraps it.

  • 79 functions
  • 4 classes
  • 38 interfaces
  • 15 types
  • 28 constants
  • MIT
npm i @openseat/renderer-konva konva
first npm release pending

Install commands show the public npm names. The first npm release is pending; the packages are free and MIT licensed.

depends on @openseat/core, @openseat/theme-default · peers konva

Import
import {
  layoutToSvg,
  SeatMapRenderer,
  SeatMapViewRenderer,
  fitBounds,
  GestureTracker,
} from "@openseat/renderer-konva";

Functions79

function

accessibleGlyphKind

The pictogram a seat carries: wheelchair wins over companion. Null for other seats.

function accessibleGlyphKind(
  seat: Pick<Seat, "accessibility">,
): AccessibleGlyphKind | null;

Parameters

ParameterTypeDescription
seatPick<Seat, "accessibility">

Returns

@openseat/renderer-konva/src/glyphs.ts

function

arcEndpoints

Start and end points of an arc marking, for drawing it as an SVG path.

function arcEndpoints(shape: {
  readonly centre: Point;
  readonly radius: number;
  readonly startAngle: number;
  readonly endAngle: number;
}): { readonly start: Point; readonly end: Point };

Parameters

ParameterTypeDescription
shape{ readonly centre: Point; readonly radius: number; readonly startAngle: number; readonly endAngle: number; }

Returns

{ readonly start: Point; readonly end: Point; }

@openseat/renderer-konva/src/markings.ts

function

areaFill

The colour a section's or GA area's fill is drawn in, as a colour and an opacity: the tint (style or category colour) at AREA_TINT_ALPHA, or at full strength in "solid" mode; the theme fill when there is no tint.

function areaFill(
  tint: string | undefined,
  themeFill: string,
  mode?: AreaFillMode,
): { readonly colour: string; readonly opacity: number };

Parameters

ParameterTypeDescription
tintstring | undefined
themeFillstring
modeoptionalAreaFillMode

Default "tint"

Returns

{ readonly colour: string; readonly opacity: number; }

@openseat/renderer-konva/src/nodes.ts

function

areaLabelPoint

Where an area's label sits, in its local space: the pole of inaccessibility of the boundary (the interior point furthest from the edges, so labels stay inside concave shapes), plus a section's labelOffset.

function areaLabelPoint(area: Section | GaArea): Point;

Parameters

ParameterTypeDescription
areaSection | GaArea

Returns

@openseat/renderer-konva/src/nodes.ts

function

areaStatePaint

Paint of a GA area, booth or table in a visual state. Available keeps base; selected and held keep the fill and take the state's colour as a thicker outline; booked is greyed ("Sold out"); blocked is greyed and hatched ("Not for sale"). Greyed labels keep AA contrast.

function areaStatePaint(
  base: AreaStyle,
  state: SeatVisualState | undefined,
  theme: Theme,
): AreaStatePaint;

Parameters

ParameterTypeDescription
baseAreaStyle
stateSeatVisualState | undefined
themeTheme

Returns

@openseat/renderer-konva/src/glyphs.ts

function

boundsFor

Bounds used for indexing. Rows have no shape of their own, but their labels still need culling: with seatsOf the bounds cover the labels at both ends (null when the row shows none); without it, a label left of row.position.

function boundsFor(
  obj: LayoutObject,
  seatsOf?: (row: Row) => readonly Seat[],
  layout?: LayoutDocument | null,
): Bounds | null;

Parameters

ParameterTypeDescription
objLayoutObject
seatsOfoptional(row: Row) => readonly Seat[]
layoutoptionalLayoutDocument | null

Returns

Bounds | null

@openseat/renderer-konva/src/scene.ts

function

categoryPaint

Light tint and stronger stroke of a category (or style) colour, for GA areas and booths. The label is a dark shade of the colour when that keeps AA contrast (4.5:1) on the tint, else the theme's label colour.

function categoryPaint(colour: string, theme: Theme): CategoryPaint;

Parameters

ParameterTypeDescription
colourstring
themeTheme

Returns

@openseat/renderer-konva/src/glyphs.ts

function

clampScale

function clampScale(scale: number, limits?: ZoomLimits): number;

Parameters

ParameterTypeDescription
scalenumber
limitsoptionalZoomLimits

Default DEFAULT_ZOOM_LIMITS

Returns

number

@openseat/renderer-konva/src/viewport.ts

function

computeGroupTransform

The selection transform that takes the proxy from initialRect to finalAttrs (Konva's attributes after the user dragged the transformer): pivot = initial centre, translate = new centre - pivot, rotation and scale relative to the initial rect.

function computeGroupTransform(
  initialRect: ProxyRect,
  finalAttrs: ProxyRect,
): SelectionTransform;

Parameters

ParameterTypeDescription
initialRectProxyRect
finalAttrsProxyRect

Returns

@openseat/renderer-konva/src/group-transform.ts

function

defaultFitPadding

Margin around a fitted layout: 32 px, or 4% of a small container's shorter side (at least 10 px).

function defaultFitPadding(size: {
  readonly width: number;
  readonly height: number;
}): number;

Parameters

ParameterTypeDescription
size{ readonly width: number; readonly height: number; }

Returns

number

@openseat/renderer-konva/src/renderer.ts

function

defaultIsHittable

Default hit rules. View mode: seats, zones (GA areas and sections shown as zones, showSeats: false, sold by quantity) and booths with an inventory key. Edit mode: everything but rows. The rows, seats and tables inside a zone section are never hit (the scene suppresses them).

function defaultIsHittable(
  obj: LayoutObject,
  mode: RendererMode,
): boolean;

Parameters

ParameterTypeDescription
objLayoutObject
modeRendererMode

Returns

boolean

@openseat/renderer-konva/src/renderer.ts

function

dividerPieces

The pieces of a divider (a path with a caption) that are drawn, in its local space: the polyline with the stretch under the caption cut out, so the line stops on both sides of the text. gap is the length cut out, centred caption.distance along the path. A closed path is walked back to its first point.

function dividerPieces(
  path: Pick<CustomPath, "points" | "closed">,
  caption: PathCaptionPlacement,
  gap: number,
): Point[][];

Parameters

ParameterTypeDescription
pathPick<CustomPath, "points" | "closed">
captionPathCaptionPlacement
gapnumber

Returns

Point[][]

@openseat/renderer-konva/src/shapes.ts

function

drawnRowLabels

The row labels that are drawn: core resolveRowLabelPlacements (each label pushed outward along the row until it clears every drawn seat in the layout), without the ones that could not be cleared. Without a layout (a preview of objects not added yet) the plain placements are used.

function drawnRowLabels(
  layout: LayoutDocument | null | undefined,
  row: Row,
  seats: readonly Seat[],
): readonly (RowLabelPlacement & {
  readonly fontSize: number;
  readonly box?: Bounds;
})[];

Parameters

ParameterTypeDescription
layoutLayoutDocument | null | undefined
rowRow
seatsreadonly Seat[]

Returns

readonly (RowLabelPlacement & { readonly fontSize: number; readonly box?: Bounds; })[]

@openseat/renderer-konva/src/scene.ts

function

edgePanStep

Edge auto-pan: the pan step (screen pixels per frame, ready for panBy) while a drag holds the pointer within margin pixels of the container edge. Zero when the pointer is further in. The step grows linearly to maxStep at the edge (and beyond it), and moves the content so that more of the side the pointer is near comes into view.

function edgePanStep(
  point: Point,
  size: Size,
  margin?: number,
  maxStep?: number,
): Point;

Parameters

ParameterTypeDescription
pointPoint
sizeSize
marginoptionalnumber

Default 24

maxStepoptionalnumber

Default 14

Returns

@openseat/renderer-konva/src/viewport.ts

function

effectivelyHidden

IDs of objects hidden themselves or through an ancestor. Cheap when nothing is hidden, which is the common case for large booking maps.

function effectivelyHidden(layout: LayoutDocument): Set<string>;

Parameters

ParameterTypeDescription
layoutLayoutDocument

Returns

Set<string>

@openseat/renderer-konva/src/scene.ts

function

escapeXml

Escapes text for use in SVG element content and attribute values. Code points that XML cannot represent at all are removed, so a stray control character in a label never makes the document unparseable.

function escapeXml(text: string): string;

Parameters

ParameterTypeDescription
textstring

Returns

string

@openseat/renderer-konva/src/svg-export.ts

function

fieldMarkingShapes

The markings of a rink, court or pitch, scaled to the stage's width and height. The long side is the length of the field, so a stage taller than it is wide gets a vertical field. Pure: the canvas and SVG renderers both draw exactly these shapes. Empty without (or with unknown) markings.

  • rink: red centre line, blue lines at ±1/6 of the length, a centre circle (radius 0.12 × width of the ice), four face-off circles, and red goal lines with half-circle creases 0.06 × length from each end;
  • court: centre line, centre circle and two key rectangles;
  • pitch: halfway line, centre circle and two penalty boxes.
function fieldMarkingShapes(stage: {
  readonly width: number;
  readonly height: number;
  readonly markings?: string;
}): FieldMarkingShape[];

Parameters

ParameterTypeDescription
stage{ readonly width: number; readonly height: number; readonly markings?: string; }

Returns

@openseat/renderer-konva/src/markings.ts

function

fitBounds

Viewport that fits bounds inside size with padding screen pixels on every side, centred.

function fitBounds(
  bounds: Bounds,
  size: Size,
  padding?: number,
  limits?: ZoomLimits,
): Viewport;

Parameters

ParameterTypeDescription
boundsBounds
sizeSize
paddingoptionalnumber

Default 24

limitsoptionalZoomLimits

Default DEFAULT_ZOOM_LIMITS

Returns

@openseat/renderer-konva/src/viewport.ts

function

gaPaint

Paint of a GA area, drawn as a zone (see zonePaintOf): its style or category colour as the tier tint, mixed toward white as an opaque pastel fill with a tier-colour border and a dark label of at least 4.5:1 contrast. Booked is the sold-out paint (light grey, grey text); blocked (Not for sale) is the same with a hatch. areaFillMode no longer changes zones: their fill is opaque in both modes.

function gaPaint(
  obj: Extract<LayoutObject, { type: "ga" }>,
  theme: Theme,
  categoryColour: string | undefined,
  options?: Pick<NodeOptions, "areaFillMode" | "areaState">,
): GaPaint;

Parameters

ParameterTypeDescription
objExtract<LayoutObject, { type: "ga"; }>
themeTheme
categoryColourstring | undefined
optionsoptionalPick<NodeOptions, "areaFillMode" | "areaState">

Default {}

Returns

@openseat/renderer-konva/src/nodes.ts

function

glyphPath

Path data of a pictogram.

function glyphPath(kind: AccessibleGlyphKind): string;

Parameters

ParameterTypeDescription
kindAccessibleGlyphKind

Returns

string

@openseat/renderer-konva/src/glyphs.ts

function

glyphScale

Scale from path units to layout units that fits a pictogram inside a seat of radius radius. compact halves it (seat labels are shown, and the pictogram moves below the number).

function glyphScale(
  kind: AccessibleGlyphKind,
  radius: number,
  compact?: boolean,
): number;

Parameters

ParameterTypeDescription
kindAccessibleGlyphKind
radiusnumber
compactoptionalboolean

Default false

Returns

number

@openseat/renderer-konva/src/glyphs.ts

function

gridStep

Grid line spacing in layout units for a grid of size at scale: the grid size, doubled until lines are at least minPx screen pixels apart, so a zoomed-out grid never turns into a solid fill.

function gridStep(
  size: number,
  scale: number,
  minPx?: number,
): number;

Parameters

ParameterTypeDescription
sizenumber
scalenumber
minPxoptionalnumber

Default 8

Returns

number

@openseat/renderer-konva/src/viewport.ts

function

handleHint

The tooltip for a handle hit, or null for no hit.

function handleHint(hit: HandleHit | null): string | null;

Parameters

ParameterTypeDescription
hitHandleHit | null

Returns

string | null

@openseat/renderer-konva/src/handles.ts

function

hatchSegments

Diagonal hatch lines (running from lower left to upper right) clipped to an outline, as segments in its local space. Computed geometrically rather than with a clip path, so the SVG export needs no <clipPath> references.

function hatchSegments(
  outline: HatchOutline,
): { readonly a: Point; readonly b: Point }[];

Parameters

ParameterTypeDescription
outlineHatchOutline

Returns

{ readonly a: Point; readonly b: Point; }[]

@openseat/renderer-konva/src/glyphs.ts

function

hatchSpacing

Spacing of hatch lines for an outline whose shorter side is size: about six lines across, at least 4 units apart.

function hatchSpacing(size: number): number;

Parameters

ParameterTypeDescription
sizenumber

Returns

number

@openseat/renderer-konva/src/glyphs.ts

function

hatchStrokeWidth

Stroke width of the hatch lines drawn over an outline.

function hatchStrokeWidth(outline: HatchOutline): number;

Parameters

ParameterTypeDescription
outlineHatchOutline

Returns

number

@openseat/renderer-konva/src/glyphs.ts

function

hatchWidth

Stroke width of hatch lines at a given spacing.

function hatchWidth(spacing: number): number;

Parameters

ParameterTypeDescription
spacingnumber

Returns

number

@openseat/renderer-konva/src/glyphs.ts

function

hitRowHandles

The row handle under point, within radius layout units.

function hitRowHandles(
  handles: readonly RowHandle[],
  point: Point,
  radius: number,
): HandleHit | null;

Parameters

ParameterTypeDescription
handlesreadonly RowHandle[]
pointPoint
radiusnumber

Returns

HandleHit | null

@openseat/renderer-konva/src/handles.ts

function

hitVertexHandles

The vertex or midpoint handle under point (vertices win), within radius layout units.

function hitVertexHandles(
  handles: VertexHandles,
  point: Point,
  radius: number,
): HandleHit | null;

Parameters

ParameterTypeDescription
handlesVertexHandles
pointPoint
radiusnumber

Returns

HandleHit | null

@openseat/renderer-konva/src/handles.ts

function

inventoryKeyOf

The inventory key of an object sold as a unit, which seat state maps (and booking statuses) use for it: a GA area's or booth's inventoryId, the object ID of a table booked as a whole, or the ID of a section shown as a zone (showSeats: false). Undefined for everything else.

function inventoryKeyOf(obj: LayoutObject): string | undefined;

Parameters

ParameterTypeDescription
objLayoutObject

Returns

string | undefined

@openseat/renderer-konva/src/glyphs.ts

function

isAccessibleSeat

True for a seat flagged wheelchair or companion.

function isAccessibleSeat(obj: LayoutObject): boolean;

Parameters

ParameterTypeDescription
objLayoutObject

Returns

boolean

@openseat/renderer-konva/src/glyphs.ts

function

isAdditiveClick

Whether a click adds to the selection: Shift or Cmd (meta) anywhere, Ctrl everywhere but macOS, where Ctrl+click opens the context menu instead.

function isAdditiveClick(
  evt: {
    readonly shiftKey: boolean;
    readonly ctrlKey: boolean;
    readonly metaKey: boolean;
  },
  isMac: boolean,
): boolean;

Parameters

ParameterTypeDescription
evt{ readonly shiftKey: boolean; readonly ctrlKey: boolean; readonly metaKey: boolean; }
isMacboolean

Returns

boolean

@openseat/renderer-konva/src/renderer.ts

function

isMacPlatform

True on macOS, where Ctrl+click is a secondary (context menu) click rather than an additive one.

function isMacPlatform(): boolean;

Returns

boolean

@openseat/renderer-konva/src/renderer.ts

function

isMarkedSeat

True when a seat carries the "marked" tag.

function isMarkedSeat(obj: LayoutObject): boolean;

Parameters

ParameterTypeDescription
objLayoutObject

Returns

boolean

@openseat/renderer-konva/src/nodes.ts

function

isTypingTarget

True when keyboard input is going to a text field, so canvas shortcuts (Space to pan, for example) must not react.

function isTypingTarget(target: EventTarget | null): boolean;

Parameters

ParameterTypeDescription
targetEventTarget | null

Returns

boolean

@openseat/renderer-konva/src/gestures.ts

function

isZoneObject

True for an object drawn as a zone: a GA area, or a section shown as a zone (showSeats: false).

function isZoneObject(obj: LayoutObject): obj is GaArea | Section;

Parameters

ParameterTypeDescription
objLayoutObject

Returns

obj is GaArea | Section

@openseat/renderer-konva/src/shapes.ts

function

labelColourOn

Dark or light label text, whichever contrasts more with fill.

function labelColourOn(fill: string, dark: string): string;

Parameters

ParameterTypeDescription
fillstring
darkstring

Returns

string

@openseat/renderer-konva/src/nodes.ts

function

labelFontStyle

Konva fontStyle for a label's bold and italic flags.

function labelFontStyle(
  style: { readonly bold?: boolean; readonly italic?: boolean } | undefined,
): string;

Parameters

ParameterTypeDescription
style{ readonly bold?: boolean; readonly italic?: boolean; } | undefined

Returns

string

@openseat/renderer-konva/src/nodes.ts

function

layoutToSvg

Renders a layout as a standalone SVG document: venue, areas, zones, stages, booths, tables, seats (coloured by category or seat state, with the wheelchair pictogram or companion mark on accessible seats), labels, dividers, row labels and section titles. Text goes where the canvas puts it at the "detail" level (core label layout): section titles in a header band clear of the seats, row labels pushed off seats, zone sections labelled inside. Deterministic for a given input, with all text XML-escaped. The viewBox is the content bounds (venue and titles included) plus padding. Hidden objects are skipped, and so is everything inside a hidden row, table or section and the contents of zone sections (showSeats: false), which draw as one zone; sections with outline "none" draw only their title, as in view mode.

function layoutToSvg(
  layout: LayoutDocument,
  opts?: SvgExportOptions,
): string;

Parameters

ParameterTypeDescription
layoutLayoutDocument
optsoptionalSvgExportOptions

Default {}

Returns

string

Example

export-svg.ts
import { writeFileSync } from "node:fs";
import { buildTemplate } from "@openseat/core/templates";
import { layoutToSvg } from "@openseat/renderer-konva"; // not @openseat/core

const { layout } = buildTemplate("performance.auditorium.annual-day", null, { name: "Annual Day 2026" });
writeFileSync("annual-day.svg", layoutToSvg(layout)); // standalone, deterministic, no canvas or DOM

Recipe: SVG in Node

@openseat/renderer-konva/src/svg-export.ts

function

markingColour

Stroke colour of a field marking: the theme's rink red or blue, or a line that contrasts with the stage fill.

function markingColour(
  colour: MarkingColour,
  theme: Theme,
  stageFill: string,
): string;

Parameters

ParameterTypeDescription
colourMarkingColour
themeTheme
stageFillstring

Returns

string

@openseat/renderer-konva/src/nodes.ts

function

memberKindFor

Member kind for an object's main node.

function memberKindFor(obj: LayoutObject): MemberKind;

Parameters

ParameterTypeDescription
objLayoutObject

Returns

@openseat/renderer-konva/src/group-transform.ts

function

outlineShorterSide

The shorter side of an outline's box, which sets its hatch spacing.

function outlineShorterSide(outline: HatchOutline): number;

Parameters

ParameterTypeDescription
outlineHatchOutline

Returns

number

@openseat/renderer-konva/src/glyphs.ts

function

panBy

function panBy(vp: Viewport, dx: number, dy: number): Viewport;

Parameters

ParameterTypeDescription
vpViewport
dxnumber
dynumber

Returns

@openseat/renderer-konva/src/viewport.ts

function

rotationSnapsFor

Transformer rotation snapping: every 15 degrees by default (0, 15 … 345, within 7.5 degrees, so every angle snaps), right angles with Shift (within 10 degrees), and free rotation with Alt.

function rotationSnapsFor(modifiers: {
  readonly shift: boolean;
  readonly alt: boolean;
}): { readonly snaps: number[]; readonly tolerance: number };

Parameters

ParameterTypeDescription
modifiers{ readonly shift: boolean; readonly alt: boolean; }

Returns

{ readonly snaps: number[]; readonly tolerance: number; }

@openseat/renderer-konva/src/group-transform.ts

function

roundedPathData

SVG path data of a closed polygon with its corners rounded by radius (core roundedPolygonPath: each corner clamped to half of its edges). Arcs are SVG A commands, so Konva and SVG draw true arcs.

function roundedPathData(
  points: readonly Point[],
  radius: number,
): string;

Parameters

ParameterTypeDescription
pointsreadonly Point[]
radiusnumber

Returns

string

@openseat/renderer-konva/src/shapes.ts

function

rowHandleCount

Seats to add (positive) or remove (negative) at a handle's end for a pointer at pointer: the pointer projected onto the end tangent, in whole seat spacings. Never removes more than seatCount - 1 seats.

function rowHandleCount(
  handle: RowHandle,
  spacing: number,
  seatCount: number,
  pointer: Point,
): number;

Parameters

ParameterTypeDescription
handleRowHandle
spacingnumber
seatCountnumber
pointerPoint

Returns

number

@openseat/renderer-konva/src/handles.ts

function

rowHandlesFor

The two "+" handles of a row, beyond its first and last seat. Empty for a row without seats.

function rowHandlesFor(
  row: Row,
  seats: readonly Seat[],
): RowHandle[];

Parameters

ParameterTypeDescription
rowRow
seatsreadonly Seat[]

Returns

@openseat/renderer-konva/src/handles.ts

function

rowLabelAnchor

Deprecated

Deprecated. Use rowLabelPlacementsFor, which handles both ends, curved and vertical rows. Without seats this falls back to a point left of row.position.

Where a row's start label is anchored.

function rowLabelAnchor(row: Row, seats?: readonly Seat[]): Point;

Parameters

ParameterTypeDescription
rowRow
seatsoptionalreadonly Seat[]

Default []

Returns

@openseat/renderer-konva/src/scene.ts

function

rowLabelBounds

Layout-space box of a row label drawn at placement.

function rowLabelBounds(
  text: string,
  placement: RowLabelPlacement,
): Bounds | null;

Parameters

ParameterTypeDescription
textstring
placementRowLabelPlacement

Returns

Bounds | null

@openseat/renderer-konva/src/scene.ts

function

rowLabelPlacementsFor

Where a row's labels would go before they are pushed clear of seats: before the first seat and/or after the last one along the row's tangent, following row.labelPosition. seats are the row's seats in row order.

The renderer and the SVG export draw core resolveRowLabelPlacements instead (see drawnRowLabels), which moves a label off any seat it would cover and leaves out one that cannot be cleared.

function rowLabelPlacementsFor(
  row: Row,
  seats: readonly Seat[],
): RowLabelPlacement[];

Parameters

ParameterTypeDescription
rowRow
seatsreadonly Seat[]

Returns

@openseat/renderer-konva/src/scene.ts

function

rowSeatSpacing

Slot spacing used to turn a handle drag into a seat count: the layout's, else the first gap.

function rowSeatSpacing(row: Row, seats: readonly Seat[]): number;

Parameters

ParameterTypeDescription
rowRow
seatsreadonly Seat[]

Returns

number

@openseat/renderer-konva/src/handles.ts

function

scrollIntoView

Viewport that scrolls the minimum distance needed to bring bounds fully on screen (with padding), without changing zoom. Used for keyboard focus.

function scrollIntoView(
  vp: Viewport,
  bounds: Bounds,
  size: Size,
  padding?: number,
): Viewport;

Parameters

ParameterTypeDescription
vpViewport
boundsBounds
sizeSize
paddingoptionalnumber

Default 32

Returns

@openseat/renderer-konva/src/viewport.ts

function

seatRadius

A seat's radius: a circle's radius, or half the shorter side of a rectangle.

function seatRadius(seat: Pick<Seat, "shape">): number;

Parameters

ParameterTypeDescription
seatPick<Seat, "shape">

Returns

number

@openseat/renderer-konva/src/glyphs.ts

function

sectionLabelColour

Colour of a section's label: the theme colour, or (over a solid fill) dark or white text, whichever reads better on the fill.

function sectionLabelColour(
  theme: Theme,
  solidFill?: string,
): string;

Parameters

ParameterTypeDescription
themeTheme
solidFilloptionalstring

Returns

string

@openseat/renderer-konva/src/nodes.ts

function

sectionLabelFontSize

The size a section label is drawn at: its labelSize (default 16), but no more than 0.45 × the shorter side of the outline's box in section space, so a label fits inside a small section. Never shrunk below 8.

function sectionLabelFontSize(
  section: Pick<Section, "boundary" | "labelSize">,
): number;

Parameters

ParameterTypeDescription
sectionPick<Section, "boundary" | "labelSize">

Returns

number

@openseat/renderer-konva/src/scene.ts

function

stageCornerRadius

Corner radius a stage is drawn with: its own cornerRadius, else theme.stage.cornerRadiusFraction × its shorter side (rect and thrust stages; round stages are not rounded further).

function stageCornerRadius(stage: Stage, theme: Theme): number;

Parameters

ParameterTypeDescription
stageStage
themeTheme

Returns

number

@openseat/renderer-konva/src/shapes.ts

function

stageLabelText

The text a stage shows: its label, upper-cased when the theme says so.

function stageLabelText(label: string, theme: Theme): string;

Parameters

ParameterTypeDescription
labelstring
themeTheme

Returns

string

@openseat/renderer-konva/src/nodes.ts

function

stagePaint

Paint of a stage: its own style where set, the theme's stage colours otherwise (a soft light grey with a thin border and a muted label). A stage with its own fill (a sports field, a dark stage) keeps it, with dark or white label text, whichever reads better on it.

function stagePaint(stage: Stage, theme: Theme): AreaStyle;

Parameters

ParameterTypeDescription
stageStage
themeTheme

Returns

@openseat/renderer-konva/src/nodes.ts

function

stagePathData

SVG path data of a stage's outline in its local space (core stageOutline): a rounded rect, a thrust (T) with a runway toward the audience, an ellipse, or a semicircle. Corners are rounded by stageCornerRadius.

function stagePathData(stage: Stage, theme: Theme): string;

Parameters

ParameterTypeDescription
stageStage
themeTheme

Returns

string

@openseat/renderer-konva/src/shapes.ts

function

suppressedObjects

IDs of objects that are not drawn and cannot be hit: hidden ones (effectivelyHidden) plus the rows, tables and seats of sections shown as zones (showSeats: false), whatever the mode. A zone section is drawn as one zone instead; its contents stay in the document.

function suppressedObjects(layout: LayoutDocument): Set<string>;

Parameters

ParameterTypeDescription
layoutLayoutDocument

Returns

Set<string>

@openseat/renderer-konva/src/scene.ts

function

transformNodePose

Where a member node goes for a selection transform, from its pose when the transform started. For "scaled" nodes the node is stretched by how much the map stretches its own axes, and turned to follow its local +x axis.

function transformNodePose(
  pose: NodePose,
  kind: MemberKind,
  t: SelectionTransform,
): NodePose;

Parameters

ParameterTypeDescription
poseNodePose
kindMemberKind
tSelectionTransform

Returns

@openseat/renderer-konva/src/group-transform.ts

function

usesAccessibleRing

True when a seat of radius layout units, drawn at pixelsPerUnit, gets the ring instead of the pictogram.

function usesAccessibleRing(
  radius: number,
  pixelsPerUnit: number,
): boolean;

Parameters

ParameterTypeDescription
radiusnumber
pixelsPerUnitnumber

Returns

boolean

@openseat/renderer-konva/src/glyphs.ts

function

venueBounds

Layout-space bounds of a venue outline.

function venueBounds(venue: Venue): Bounds;

Parameters

ParameterTypeDescription
venueVenue

Returns

@openseat/renderer-konva/src/scene.ts

function

venueContentBounds

The venue outline plus its name when shown.

function venueContentBounds(venue: Venue): Bounds;

Parameters

ParameterTypeDescription
venueVenue

Returns

@openseat/renderer-konva/src/scene.ts

function

venueNameBounds

Layout-space box of a venue's name, or null when it is not shown.

function venueNameBounds(venue: Venue): Bounds | null;

Parameters

ParameterTypeDescription
venueVenue

Returns

Bounds | null

@openseat/renderer-konva/src/scene.ts

function

venueNamePlacement

Where a venue's name is drawn: centred above the outline's top edge, its baseline about half a font size above it. at is the centre of the text.

function venueNamePlacement(venue: Venue): {
  readonly at: Point;
  readonly fontSize: number;
};

Parameters

ParameterTypeDescription
venueVenue

Returns

{ readonly at: Point; readonly fontSize: number; }

@openseat/renderer-konva/src/scene.ts

function

vertexHandlesFor

Vertex handles of an object with an editable outline (section, GA area, polygon, aisle, path), or null.

function vertexHandlesFor(obj: LayoutObject): VertexHandles | null;

Parameters

ParameterTypeDescription
objLayoutObject

Returns

@openseat/renderer-konva/src/handles.ts

function

visibleWorldBounds

Layout-space rectangle visible on screen, grown by margin screen pixels so edges do not pop in.

function visibleWorldBounds(
  vp: Viewport,
  size: Size,
  margin?: number,
): Bounds;

Parameters

ParameterTypeDescription
vpViewport
sizeSize
marginoptionalnumber

Default 0

Returns

@openseat/renderer-konva/src/viewport.ts

function

wheelAction

Decides what a wheel event does:

  • Ctrl or Cmd zooms (a trackpad pinch arrives as wheel + ctrlKey);
  • in "zoom" mode a plain wheel zooms at the cursor, unless the movement is mostly horizontal (a trackpad swipe) or Shift is held, which pans;
  • in "pan" mode a plain wheel pans. Shift with a vertical-only wheel pans horizontally.
function wheelAction(e: WheelInput, mode: WheelMode): WheelAction;

Parameters

ParameterTypeDescription
eWheelInput
modeWheelMode

Returns

@openseat/renderer-konva/src/gestures.ts

function

withAlpha

#rrggbb (or #rgb) colour with an alpha channel, as rgba(...). Other formats are returned unchanged.

function withAlpha(colour: string, alpha: number): string;

Parameters

ParameterTypeDescription
colourstring
alphanumber

Returns

string

@openseat/renderer-konva/src/nodes.ts

function

zoneCornerRadius

Corner radius a zone is drawn with: its own cornerRadius, else the theme fallback for zone sections (GA areas: none).

function zoneCornerRadius(
  zone: GaArea | Section,
  theme: Theme,
): number;

Parameters

ParameterTypeDescription
zoneGaArea | Section
themeTheme

Returns

number

@openseat/renderer-konva/src/shapes.ts

function

zonePaintOf

Paint of a zone (a GA area, or a section shown as a zone) in a visual state: its style or category colour as the tier tint (else the theme's GA or section outline colour) through zoneStatePaint. An available zone keeps its own style.stroke.

function zonePaintOf(
  zone: GaArea | Section,
  theme: Theme,
  categoryColour: string | undefined,
  state?: SeatVisualState,
): AreaStatePaint;

Parameters

ParameterTypeDescription
zoneGaArea | Section
themeTheme
categoryColourstring | undefined
stateoptionalSeatVisualState

Returns

@openseat/renderer-konva/src/nodes.ts

function

zonePathData

SVG path data of a zone's outline in its local space, its corners rounded by zoneCornerRadius.

function zonePathData(zone: GaArea | Section, theme: Theme): string;

Parameters

ParameterTypeDescription
zoneGaArea | Section
themeTheme

Returns

string

@openseat/renderer-konva/src/shapes.ts

function

zoneStatePaint

Paint of a zone (a GA area or a section shown as a zone) in tier colour tint and a visual state. Available: the theme's zonePaint (pastel fill, tier-colour border, dark label). Selected and held keep it with the state's colour as a thicker outline. Booked is the theme's sold-out paint (light grey, grey text, no tint); blocked is the same plus the not-for-sale hatch.

function zoneStatePaint(
  tint: string,
  state: SeatVisualState | undefined,
  theme: Theme,
): AreaStatePaint;

Parameters

ParameterTypeDescription
tintstring
stateSeatVisualState | undefined
themeTheme

Returns

@openseat/renderer-konva/src/glyphs.ts

function

zoomAt

Zooms by factor while keeping the layout point under screenPoint fixed, so zooming follows the cursor or pinch centre.

function zoomAt(
  vp: Viewport,
  screenPoint: Point,
  factor: number,
  limits?: ZoomLimits,
): Viewport;

Parameters

ParameterTypeDescription
vpViewport
screenPointPoint
factornumber
limitsoptionalZoomLimits

Default DEFAULT_ZOOM_LIMITS

Returns

@openseat/renderer-konva/src/viewport.ts

Classes4

class

GestureTracker

Turns raw pointer down/move/up into taps, drags and two-finger pinches.

DOM-free so it can be tested directly: the renderer feeds it pointer events and reacts to what it returns. Rules:

  • one pointer that moves less than the threshold and lifts is a tap;
  • one pointer that passes the threshold is a drag;
  • a second pointer turns any drag into a pinch (the drag is cancelled);
  • after a pinch, nothing else happens until every pointer has lifted, so lifting one finger does not cause a jump into a drag.
class GestureTracker

Members

MemberTypeDescription
constructorconstructor(options?: GestureOptions)
isActivegetterboolean
isDragginggetterboolean
downmethod(id: number, point: Point, info: PointerInfo) => GestureEvent[]
movemethod(id: number, point: Point) => GestureEvent[]
upmethod(id: number, point: Point) => GestureEvent[]
cancelmethod(id: number) => GestureEvent[]

Pointer lost (pointercancel, window blur). Cancels any drag without a tap.

abortmethod() => GestureEvent[]

Abandons the current gesture (for example on Escape). A drag reports dragcancel, a pinch pinchend; afterwards nothing happens until every pointer has lifted.

Every member is readonly.

@openseat/renderer-konva/src/gestures.ts

class

Scene

Renderer-independent model of what is drawn: object lookup, paint order, bounds, and a spatial index for culling and hit testing.

Updates are diffed by object reference, so hosts must update layouts immutably (replace an object to change it). That is what makes re-rendering a 2,000-seat layout after moving one seat cost one node, not 2,000.

class Scene

Members

MemberTypeDescription
ghostHiddenSeatsboolean

In the designer, a seat hidden on its own is still drawn (faintly) and can be clicked, so it can be shown again; seats of a hidden row, table or section stay hidden with it. Off for buyers.

constructorconstructor(cellSize?: number)
layoutgetterLayoutDocument | null
drawOrdergetterreadonly string[]
objectsByIdgetterReadonlyMap<string, LayoutObject>
setLayoutmethod(layout: LayoutDocument) => SceneDiff
resetmethod() => void

Forgets everything, so the next setLayout reports every object as added.

refreshHiddenmethod() => boolean

Recomputes the hidden and ghost sets from the current layout (after ghostHiddenSeats changed). True when either set changed.

isHiddenmethod(id: string) => boolean

True when the object or an ancestor (its row, table or section) is hidden, or it is inside a section shown as a zone: it is not drawn and cannot be hit.

isGhostmethod(id: string) => boolean

True for a seat hidden on its own that the designer draws faintly (see ghostHiddenSeats).

isLockedmethod(id: string) => boolean

True when the object or an ancestor (its row, table or section) is locked.

getmethod(id: string) => LayoutObject | undefined
rankmethod(id: string) => number
boundsOfmethod(id: string) => Bounds | undefined
objectIdForSeatmethod(seatId: string) => string | undefined

Seat object ID for a public seat ID.

objectIdForInventorymethod(key: string) => string | undefined

Object ID of a GA area, booth or whole-booked table for its inventory key (inventoryId, or the table's object ID). See inventoryKeyOf.

categoryColourmethod(categoryId: string | undefined) => string | undefined
querymethod(area: Bounds) => string[]

IDs whose bounds intersect area, in no particular order.

hitTestmethod(point: Point, tolerance?: number, filter?: (obj: LayoutObject) => boolean) => string | null

Topmost object containing point, or null. Hidden objects and objects rejected by filter are skipped, so a non-interactive area never blocks the seat beneath it.

queryContainedmethod(area: Bounds, filter?: (obj: LayoutObject) => boolean) => string[]

Objects whose bounds lie entirely inside area. Used for marquee selection.

rowSeatsmethod(row: Row) => Seat[]

A row's seats in row order (missing or non-seat members skipped).

contentBoundsmethod() => Bounds | null

Union of all object bounds, the venue outline and the section titles (which may sit in a header band outside their section), or null for an empty layout.

@openseat/renderer-konva/src/scene.ts

class

SeatMapRenderer

The seat map renderer: draws a layout on a Konva canvas, in view mode (a booking map) or edit mode (the designer, with resize and rotate handles).

It lives in its own module, apart from SeatMapViewRenderer, so a page that only shows a map (a booking page, through BookingMap) never imports Konva's Transformer.

class SeatMapRenderer extends SeatMapViewRenderer

Extends SeatMapViewRenderer: its public members apply here too.

Members

MemberTypeDescription
constructorconstructor(options: SeatMapRendererOptions)

@openseat/renderer-konva/src/edit-renderer.ts

class

SeatMapViewRenderer

The seat map renderer without Konva's Transformer, for pages that only show and sell a layout (a booking map): everything SeatMapRenderer does, except that edit mode draws no resize or rotate handles. Bundlers then leave the Transformer out of such pages. Use SeatMapRenderer for editing.

class SeatMapViewRenderer

Members

MemberTypeDescription
constructorconstructor(options: SeatMapRendererOptions, edit?: RendererEditSupport)

edit is internal: SeatMapRenderer passes it.

setLayoutmethod(layout: LayoutDocument) => void
getLayoutmethod() => LayoutDocument | null
setSeatStatesmethod(states: ReadonlyMap<string, SeatVisualState>) => void
setZoneNotesmethod(notes: ReadonlyMap<string, string> | null) => void

Notes drawn under GA zone names in view mode, by inventory key: a buyer's map shows each zone's price there, as the big ticketing sites do. A zone too short for two lines shows its name only. Null clears.

setHighlightmethod(opts: HighlightOptions | null) => void

Emphasises a class of seats and dims every other seat, for a buyer filter. { accessible: true } keeps wheelchair and companion seats at full strength. Null (or {}) clears it.

getHighlightmethod() => HighlightOptions | null
setSelectionmethod(ids: readonly string[]) => void
getSelectionmethod() => readonly string[]
setFocusmethod(objectId: string | null) => void

Draws a keyboard focus ring and scrolls the object into view.

setModemethod(mode: RendererMode) => void
getModemethod() => RendererMode
setThememethod(theme: Theme) => void
setEventsmethod(events: RendererEvents) => void
setSnapMovemethod(snapMove: SeatMapRendererOptions["snapMove"]) => void
setResolveTargetmethod(fn: ((hitId: string) => string | null) | null) => void

Maps a hit to the object a drag moves; null makes the hit not draggable. Pass null to reset.

setMarqueeOnAreasmethod(enabled: boolean) => void

When on (the default), dragging on an unselected area (section, polygon) box-selects instead of moving it.

setFocusScopemethod(ids: readonly string[] | null) => void

Limits interaction to a set of objects (an "entered" section or group). Everything else is dimmed and not hittable. Null clears the scope.

setIssueHighlightsmethod(ids: readonly string[]) => void

Outlines objects with validation issues. Pass an empty array to clear.

setVertexEditingmethod(objectId: string | null) => void

Shows vertex handles for an object's outline (section, GA area, polygon, aisle, path). Null hides them.

setRowHandlesmethod(rowId: string | null) => void

Shows the "+" handles that extend or shorten a row. Null hides them.

setGridmethod(grid: GridOptions) => void

Grid lines inside the canvas, edit mode only.

setWheelModemethod(mode: WheelMode) => void

What a plain mouse wheel does: zoom at the cursor (default) or pan.

setSeatVisibilitymethod(visibility: SeatVisibility, hideScale?: number) => void

Hide individual seats when zoomed out below hideScale (sections still draw), or always draw them.

setAreaFillModemethod(mode: AreaFillMode) => void

Fills coloured sections and GA areas with a translucent tint (default) or solidly.

getAreaFillModemethod() => AreaFillMode
setPanOnDragmethod(enabled: boolean) => void

In edit mode, make primary-button drags pan instead of moving or marquee-selecting (a hand tool).

setDrawOnDragmethod(enabled: boolean) => void

In edit mode, make primary-button drags report onDrawStart/onDraw/onDrawEnd instead of moving or marquee-selecting, for tools that draw (rows, for example).

setPreviewmethod(objects: readonly LayoutObject[]) => void

Draws objects that are not part of the layout yet, such as rows being drawn, above everything else. They are not hittable. Pass an empty array to clear.

setGuidesmethod(guides: readonly Guide[]) => void

Draws alignment guides. Pass an empty array to clear them.

setCursormethod(cursor: string | null) => void

Forces a cursor (for example crosshair while a placement tool is active). Null restores the default.

isGestureActivemethod() => boolean

True while the user is in the middle of an edit gesture: a transformer rotate or resize, a vertex or row handle drag, a marquee, a drawing drag or an object drag. Panning and pinching are not edit gestures. Hosts use it to hold back keyboard commands (undo, delete) mid-gesture.

cancelGesturemethod() => void

Abandons the gesture in progress (Escape) and restores what was drawn before it, without a commit event: a move, marquee or draw is cancelled as if a second finger interrupted it (nodes snap back, the draw reports onDrawCancel), a transformer rotate or resize is undone (no onTransformEnd or onGroupTransformEnd), a vertex drag is dropped and a row handle drag reports onRowHandleCancel.

getViewportmethod() => Viewport
setViewportmethod(viewport: Viewport, emit?: boolean) => void
fitToScreenmethod(padding?: number) => void

Fits the content to the container. In edit mode the canvas area is included, so its outline is in view. The default margin is 32 px, less on a small container (4% of its shorter side, at least 10 px), so a phone map shows the venue as large as it can.

getFitViewportmethod(padding?: number) => Viewport

The viewport fitToScreen would move to, without moving: the content (plus the canvas area in edit mode) fitted into the container.

getContentBoundsmethod() => Bounds | null

Layout-space bounds of everything drawn (objects, row labels, the venue and its name), or null when empty.

zoomToBoundsmethod(bounds: Bounds, padding?: number) => void

Fits a layout-space rectangle into the container (for "zoom to selection" or a section).

zoomBymethod(factor: number, around?: Point) => void

Zooms around a screen point (the container centre by default).

panBymethod(dx: number, dy: number) => void
scrollObjectIntoViewmethod(objectId: string) => void
worldToScreenmethod(point: Point) => Point
screenToWorldmethod(point: Point) => Point
hitTestmethod(screenPoint: Point, pointerType?: PointerKind) => string | null

Object under a container-relative screen point, using the current mode's hit rules and scope.

boundsOfObjectmethod(objectId: string) => Bounds | null

Layout-space bounds of an object. Rows report the union of their seats, sections include their contents.

resizemethod(width: number, height: number) => void
getSizemethod() => Size
getElementmethod() => HTMLDivElement

The canvas wrapper element that receives pointer events.

getStatsmethod() => RendererStats
flushmethod() => void

Draws synchronously. Normally drawing is batched to animation frames; tests and exports use this.

exportImagemethod(opts?: ExportImageOptions) => string

Renders the layout to a PNG data URL. The area is temporarily fitted into the container (edit helpers, selection and handles hidden), captured, and the view restored. The output is capped at 8192 px per side by lowering the pixel ratio.

getTextBoxmethod(objectId: string, kind: TextBoxKind) => Bounds | null

Layout-space box of the text drawn now for one object: a section's title ("section-title"), a zone's name ("zone-label") and so on. Null when that text is not drawn. The box is the text as drawn (fitted to its glyphs), which can be narrower than core's estimate. BookingMap uses it to keep a section title whole on screen after a zoom.

destroymethod() => void

Every member is readonly.

@openseat/renderer-konva/src/renderer.ts

Interfaces38

interface

AreaStatePaint

How an area in a given state is painted, and whether it carries the not-for-sale hatch.

interface AreaStatePaint extends AreaStyle

Extends AreaStyle

Members

MemberTypeDescription
hatchboolean
noteoptionalstring

Replaces the capacity line of a GA label: "Not for sale" or "Sold out".

fillstring

From AreaStyle

strokestring

From AreaStyle

strokeWidthnumber

From AreaStyle

labelColourstring

From AreaStyle

Every member is readonly.

@openseat/renderer-konva/src/glyphs.ts

interface

BackgroundClickEvent

interface BackgroundClickEvent

Members

MemberTypeDescription
additiveboolean
pointerTypePointerKind
pointPoint

Where the click landed, in layout coordinates.

Every member is readonly.

@openseat/renderer-konva/src/renderer.ts

interface

CategoryPaint

Category-coloured paint: a light tint of the colour as the fill, and a stronger shade of it as the stroke.

interface CategoryPaint

Members

MemberTypeDescription
fillstring

Opaque light tint (the colour at the area tint strength over white).

strokestring
labelColourstring

Label text with at least 4.5:1 contrast on fill.

Every member is readonly.

@openseat/renderer-konva/src/glyphs.ts

interface

ContextMenuEvent

interface ContextMenuEvent

Members

MemberTypeDescription
objectIdstring | null

The object under the pointer (raw hit, before resolveTarget), or null.

pointPoint

Layout coordinates.

screenPointPoint

Client (viewport) coordinates, for positioning a menu.

pointerTypePointerKind

Every member is readonly.

@openseat/renderer-konva/src/renderer.ts

interface

DrawEvent

A drawing drag (see setDrawOnDrag). Points are in layout coordinates.

interface DrawEvent

Members

MemberTypeDescription
startPoint
pointPoint
pointerTypePointerKind

Every member is readonly.

@openseat/renderer-konva/src/renderer.ts

interface

ExportImageOptions

interface ExportImageOptions

Members

MemberTypeDescription
pixelRatiooptionalnumber

Output pixels per screen pixel of the fitted view. Default 2; reduced to keep the image within 8192 px.

paddingoptionalnumber

Screen pixels around the area. Default 24.

Default 24

areaoptional"content" | "canvas"

"content" (default): the objects and venue. "canvas": the layout's canvas rectangle.

backgroundoptionalstring

Background colour. Default the theme's canvas background.

Every member is readonly.

@openseat/renderer-konva/src/renderer.ts

interface

GaPaint

How a GA area is painted: fill (CSS colour, translucent for a tint), outline, label colour and state cues.

interface GaPaint

Members

MemberTypeDescription
fillstring
strokestring
strokeWidthnumber
labelColourstring
hatchboolean
noteoptionalstring

Every member is readonly.

@openseat/renderer-konva/src/nodes.ts

interface

GestureOptions

interface GestureOptions

Members

MemberTypeDescription
dragThresholdoptionalnumber

Screen pixels a mouse or pen must travel before a press becomes a drag.

touchDragThresholdoptionalnumber

Larger threshold for touch, since fingers jitter while tapping.

Every member is readonly.

@openseat/renderer-konva/src/gestures.ts

interface

GridOptions

interface GridOptions

Members

MemberTypeDescription
sizenumber

Grid spacing in layout units.

visibleboolean

Every member is readonly.

@openseat/renderer-konva/src/renderer.ts

interface

GroupTransformEvent

A transform of a whole selection through the group transformer.

interface GroupTransformEvent

Members

MemberTypeDescription
idsreadonly string[]

The selected objects (members are implied).

transformSelectionTransform

Pivot is the initial centre of the selection's bounds. Apply with core's transformObjects.

Every member is readonly.

@openseat/renderer-konva/src/renderer.ts

interface

Guide

An alignment guide: a vertical line at x = value or a horizontal line at y = value, in layout units.

interface Guide

Members

MemberTypeDescription
axis"x" | "y"
valuenumber

Every member is readonly.

@openseat/renderer-konva/src/renderer.ts

interface

HighlightOptions

What setHighlight emphasises. Everything else is dimmed.

interface HighlightOptions

Members

MemberTypeDescription
accessibleoptionalreadonlyboolean

Keep wheelchair and companion seats at full strength and dim every other seat (an "Accessible seats" filter).

@openseat/renderer-konva/src/renderer.ts

interface

MarqueeSelectEvent

interface MarqueeSelectEvent

Members

MemberTypeDescription
objectIdsreadonly string[]
additiveboolean

Every member is readonly.

@openseat/renderer-konva/src/renderer.ts

interface

MoveEvent

interface MoveEvent

Members

MemberTypeDescription
objectIdsreadonly string[]

Objects the user dragged. Members (seats of rows, contents of sections) are implied, not listed.

deltaPoint

Movement in layout units, after snapping.

modifiersMoveModifiers

Every member is readonly.

@openseat/renderer-konva/src/renderer.ts

interface

MoveModifiers

Modifier keys held during a move.

interface MoveModifiers

Members

MemberTypeDescription
altboolean

Alt (Option) was held when the drag started: hosts turn this into a duplicate-drag.

shiftboolean

Shift is held now: hosts usually constrain the move.

Every member is readonly.

@openseat/renderer-konva/src/renderer.ts

interface

NodeOptions

Context some nodes need beyond the object itself.

interface NodeOptions

Members

MemberTypeDescription
modeoptional"view" | "edit"

Edit mode draws helpers (dashed outlines of hidden sections). Default "view".

Default "view"

rowSeatsoptionalreadonly Seat[]

A row's seats in row order, which place its labels. Without them a row draws no labels.

layoutoptionalLayoutDocument | null

The layout the object belongs to. Row labels are pushed clear of every seat in it (core resolveRowLabelPlacements); without it they use the plain placements (a preview of objects not added yet).

areaFillModeoptionalAreaFillMode

How sections and GA areas with a colour are filled. Default "tint".

Default "tint"

areaStateoptionalSeatVisualState

Visual state of a GA area, booth or table booked whole (looked up by its inventory key). "blocked" draws it greyed and hatched (Not for sale), "booked" greyed (Sold out). Absent means available.

zoneNoteoptionalstring

View mode: a short second line under a zone's name, such as its price ("₹1,499"). Drawn only when the zone is tall enough for both lines.

Every member is readonly.

@openseat/renderer-konva/src/nodes.ts

interface

NodePose

A Konva node's own transform: Konva composes translate · rotate · scale.

interface NodePose

Members

MemberTypeDescription
xnumber
ynumber
rotationnumber
scaleXnumber
scaleYnumber

Every member is readonly.

@openseat/renderer-konva/src/group-transform.ts

interface

ObjectClickEvent

interface ObjectClickEvent

Members

MemberTypeDescription
objectIdstring
seatIdoptionalstring

Public seat ID when the clicked object is a seat.

additiveboolean

True when Shift or Cmd was held, or Ctrl on platforms other than macOS (where Ctrl+click opens the context menu): hosts usually treat this as "add to selection". See isAdditiveClick.

pointerTypePointerKind
pointPoint

Where the click landed, in layout coordinates.

buttonnumber

DOM button: always 0 (primary), since other buttons do not click.

Every member is readonly.

@openseat/renderer-konva/src/renderer.ts

interface

PointerInfo

interface PointerInfo

Members

MemberTypeDescription
pointerTypePointerKind
buttonnumber

DOM button of the pointerdown: 0 primary, 1 middle, 2 secondary.

shiftKeyboolean
ctrlKeyboolean
metaKeyboolean
altKeyboolean

Every member is readonly.

@openseat/renderer-konva/src/gestures.ts

interface

ProxyRect

The proxy rectangle as Konva sees it: (x, y) is the top-left corner before rotation.

interface ProxyRect

Members

MemberTypeDescription
xnumber
ynumber
widthnumber
heightnumber
rotationoptionalnumber

Degrees. Default 0.

Default 0

scaleXoptionalnumber
scaleYoptionalnumber

Every member is readonly.

@openseat/renderer-konva/src/group-transform.ts

interface

RendererEditSupport

What edit mode needs that a view-only page does not: Konva's Transformer (resize and rotate handles, about 7 kB gzip). SeatMapRenderer passes it; SeatMapViewRenderer leaves it out.

interface RendererEditSupport

Members

MemberTypeDescription
Transformerreadonlytypeof Transformer

@openseat/renderer-konva/src/renderer.ts

interface

RendererEvents

interface RendererEvents

Members

MemberTypeDescription
onObjectClickoptionalmethod(event: ObjectClickEvent) => void
onBackgroundClickoptionalmethod(event: BackgroundClickEvent) => void
onHoverChangeoptionalmethod(objectId: string | null) => void
onViewportChangeoptionalmethod(viewport: Viewport) => void
onMoveStartoptionalmethod(event: { readonly objectIds: readonly string[]; }) => void
onMoveoptionalmethod(event: MoveEvent) => void

Fires during a drag, for live feedback such as alignment guides. Do not commit changes here.

onMoveEndoptionalmethod(event: MoveEvent) => void

Fires once per drag gesture. Commit the move here, then call setLayout.

onTransformEndoptionalmethod(event: TransformEndEvent) => void
onGroupTransformoptionalmethod(event: GroupTransformEvent) => void

Live group transform (once per frame at most). Do not commit here.

onGroupTransformEndoptionalmethod(event: GroupTransformEvent) => void

Commit a group transform here.

onMarqueeSelectoptionalmethod(event: MarqueeSelectEvent) => void
onDrawStartoptionalmethod(event: DrawEvent) => void

Drawing drags, while setDrawOnDrag(true) is on. onDrawEnd fires once, unless the drag is cancelled.

onDrawoptionalmethod(event: DrawEvent) => void
onDrawEndoptionalmethod(event: DrawEvent) => void
onDrawCanceloptionalmethod() => void

A drawing drag was interrupted (for example by a second finger starting a pinch).

onPointerMoveoptionalmethod(event: { readonly point: Point; readonly pointerType: PointerKind; }) => void

The mouse or pen moved with no button pressed. Point in layout coordinates.

onContextMenuoptionalmethod(event: ContextMenuEvent) => void

Secondary click (or long press) in edit mode. The browser menu is suppressed.

onVertexDragoptionalmethod(event: VertexDragEvent) => void

A vertex handle is being dragged (once per frame at most).

onVertexDragEndoptionalmethod(event: VertexDragEvent) => void
onVertexInsertoptionalmethod(event: VertexInsertEvent) => void

A midpoint handle was clicked.

onVertexRemoveoptionalmethod(event: VertexRemoveEvent) => void

Alt+click or double-click on a vertex handle.

onRowHandleDragoptionalmethod(event: RowHandleDragEvent) => void

A row's "+" handle was dragged far enough to change its seat count.

onRowHandleDragEndoptionalmethod(event: RowHandleDragEvent) => void
onRowHandleCanceloptionalmethod() => void

Every member is readonly.

@openseat/renderer-konva/src/renderer.ts

interface

RendererStats

interface RendererStats

Members

MemberTypeDescription
objectCountnumber
nodeCountnumber
visibleNodeCountnumber
seatLabelNodeCountnumber
framesnumber
lastFrameMsnumber
accessibleSeatsnumber

Seats drawn as accessible (wheelchair or companion): with a pictogram, or with the ring when tiny on screen.

accessibleRingSeatsnumber

Of those, the seats currently drawn with the ring because they are under 5 px in radius on screen.

Every member is readonly.

@openseat/renderer-konva/src/renderer.ts

interface

RowHandle

interface RowHandle

Members

MemberTypeDescription
end"start" | "end"
positionPoint

Where the "+" is drawn.

originPoint

Centre of the end seat the handle extends from.

directionPoint

Unit vector pointing away from the row along its end tangent.

Every member is readonly.

@openseat/renderer-konva/src/handles.ts

interface

RowHandleDragEvent

interface RowHandleDragEvent

Members

MemberTypeDescription
rowIdstring
end"start" | "end"
countnumber

Seats to add (positive) or remove (negative) at that end.

Every member is readonly.

@openseat/renderer-konva/src/renderer.ts

interface

SceneDiff

interface SceneDiff

Members

MemberTypeDescription
addedreadonly string[]
removedreadonly string[]
changedreadonly string[]

Objects whose reference changed. Unchanged references are assumed unchanged (immutable updates).

orderChangedboolean
hiddenChangedboolean

The set of effectively hidden objects changed (an object or one of its ancestors was hidden or shown), so unchanged objects may need re-culling.

Every member is readonly.

@openseat/renderer-konva/src/scene.ts

interface

SeatMapRendererOptions

interface SeatMapRendererOptions

Members

MemberTypeDescription
containerHTMLDivElement
layoutLayoutDocument
themeoptionalTheme
modeoptionalRendererMode
seatStatesoptionalReadonlyMap<string, SeatVisualState>

Visual state per public seat ID. Seats not listed are drawn as available.

highlightoptionalHighlightOptions | null

Initial highlight (see setHighlight).

selectionoptionalreadonly string[]

Object IDs drawn with a selection outline.

zoomLimitsoptionalPartial<ZoomLimits>
seatLabelMinScaleoptionalnumber

Zoom level at which seat labels appear. Default 1.6.

Default 1.6

rowLabelMinScaleoptionalnumber

Zoom level at which row labels appear. Default 0.35.

Default 0.35

hitToleranceoptional{ readonly mouse?: number; readonly touch?: number; }

Extra hit radius in screen pixels. Defaults: mouse 2, touch 10.

isHittableoptional(obj: LayoutObject, mode: RendererMode) => boolean

Decides which objects respond to pointer input. Defaults to seats, sellable booths and GA areas in view mode, everything but rows in edit mode.

resolveTargetoptional(hitId: string) => string | null

Maps the object under the pointer to what a drag moves (for example a seat to its section at the top level). Null means "not draggable". Default: the hit itself.

snapMoveoptional(input: { readonly objectIds: readonly string[]; readonly delta: Point; readonly modifiers?: MoveModifiers; }) => Point

Adjusts a drag delta, for grid snapping or alignment guides.

eventsoptionalRendererEvents
autoResizeoptionalboolean

Track container size with a ResizeObserver. Default true.

Default true

initialFitoptionalboolean

Fit the layout to the container on creation. Default true.

Default true

wheelModeoptionalWheelMode

What a plain mouse wheel does. Default "zoom".

Default "zoom"

seatVisibilityoptionalSeatVisibility

Default "always". "hidden-below-scale" hides seats (sections still draw) when zoomed out.

Default "always"

seatHideScaleoptionalnumber

Scale below which seats are hidden with "hidden-below-scale". Default 0.5.

Default 0.5

areaFillModeoptionalAreaFillMode

How sections and GA areas with a style or category colour are filled: "tint" (default) washes them with the colour so seats read on top; "solid" fills them with it, for an overview where seats are hidden.

zoneNotesoptionalReadonlyMap<string, string>

View mode: a second line under a GA zone's name ("₹1,499"), by its inventory key. See SeatMapViewRenderer.setZoneNotes.

Every member is readonly.

@openseat/renderer-konva/src/renderer.ts

interface

Size

interface Size

Members

MemberTypeDescription
widthnumber
heightnumber

Every member is readonly.

@openseat/renderer-konva/src/viewport.ts

interface

StageDecor

Stage fields the renderer reads beyond core's base schema. Declared structurally so the renderer compiles whether or not the installed core types already include them.

interface StageDecor

Members

MemberTypeDescription
styleoptional{ readonly fill?: string; readonly stroke?: string; readonly strokeWidth?: number; }
markingsoptionalFieldMarkings

Every member is readonly.

@openseat/renderer-konva/src/markings.ts

interface

SvgExportOptions

interface SvgExportOptions

Members

MemberTypeDescription
themeoptionalTheme
paddingoptionalnumber

Layout units around the content. Default 24.

Default 24

seatStatesoptionalReadonlyMap<string, SeatVisualState>

Visual state per public seat ID, and per inventory key for GA areas, booths and tables booked whole (as in the canvas renderer). Objects not listed are available.

seatLabelsoptionalboolean

Draw seat labels inside seats. Default false.

Default false

rowLabelsoptionalboolean

Draw row labels. Default true.

Default true

backgroundoptionalstring

Background fill. Default the theme's canvas background; "none" for transparent.

areaFillModeoptionalAreaFillMode

How coloured sections and GA areas are filled, as in the canvas renderer. Default "tint".

Default "tint"

Every member is readonly.

@openseat/renderer-konva/src/svg-export.ts

interface

TransformEndEvent

interface TransformEndEvent

Members

MemberTypeDescription
objectIdstring
positionPoint
rotationnumber
scaleXnumber

Scale applied by the resize handles. The host turns this into new dimensions.

scaleYnumber

Every member is readonly.

@openseat/renderer-konva/src/renderer.ts

interface

VertexDragEvent

interface VertexDragEvent

Members

MemberTypeDescription
objectIdstring
indexnumber
pointPoint

New vertex position in layout (world) coordinates.

Every member is readonly.

@openseat/renderer-konva/src/renderer.ts

interface

VertexHandles

interface VertexHandles

Members

MemberTypeDescription
verticesreadonly Point[]

The outline's vertices, in layout space.

midpointsreadonly Point[]

Midpoint of edge i (vertex i to vertex i + 1), where a click inserts a vertex.

closedboolean

Every member is readonly.

@openseat/renderer-konva/src/handles.ts

interface

VertexInsertEvent

interface VertexInsertEvent

Members

MemberTypeDescription
objectIdstring
edgeIndexnumber

The edge from vertex edgeIndex to the next one.

pointPoint

Layout coordinates of the new vertex.

Every member is readonly.

@openseat/renderer-konva/src/renderer.ts

interface

VertexRemoveEvent

interface VertexRemoveEvent

Members

MemberTypeDescription
objectIdstring
indexnumber

Every member is readonly.

@openseat/renderer-konva/src/renderer.ts

interface

Viewport

Maps layout space to screen space: screen = world * scale + (x, y). Screen coordinates are CSS pixels relative to the renderer container.

interface Viewport

Members

MemberTypeDescription
xnumber
ynumber
scalenumber

Every member is readonly.

@openseat/renderer-konva/src/viewport.ts

interface

WheelInput

The parts of a DOM WheelEvent that decide what it does.

interface WheelInput

Members

MemberTypeDescription
deltaXnumber
deltaYnumber
deltaModenumber

0 pixels, 1 lines, 2 pages.

ctrlKeyboolean
metaKeyboolean
shiftKeyboolean

Every member is readonly.

@openseat/renderer-konva/src/gestures.ts

interface

ZoomLimits

interface ZoomLimits

Members

MemberTypeDescription
minScalenumber
maxScalenumber

Every member is readonly.

@openseat/renderer-konva/src/viewport.ts

Types15

type

AccessibleGlyphKind

Which pictogram a seat carries: the wheelchair symbol, the companion mark, or none.

type AccessibleGlyphKind = "wheelchair" | "companion";

@openseat/renderer-konva/src/glyphs.ts

type

AreaFillMode

How sections and GA areas with a style or category colour are filled: "tint" (a translucent wash, seats drawn on top) or "solid" (the full colour, for an overview where seats are hidden).

type AreaFillMode = "tint" | "solid";

@openseat/renderer-konva/src/nodes.ts

type

FieldMarkings

Sports field markings drawn inside a stage.

type FieldMarkings = "rink" | "court" | "pitch";

@openseat/renderer-konva/src/markings.ts

type

FieldMarkingShape

One marking in the stage's local space (origin at the stage centre, x along its width). Angles are degrees, measured clockwise from +x as on screen; an arc runs clockwise from startAngle to endAngle.

type FieldMarkingShape =
  | {
      readonly kind: "line";
      readonly points: readonly Point[];
      readonly closed: boolean;
      readonly colour: MarkingColour;
      readonly strokeWidth: number;
    }
  | {
      readonly kind: "circle";
      readonly centre: Point;
      readonly radius: number;
      readonly colour: MarkingColour;
      readonly strokeWidth: number;
    }
  | {
      readonly kind: "arc";
      readonly centre: Point;
      readonly radius: number;
      readonly startAngle: number;
      readonly endAngle: number;
      readonly colour: MarkingColour;
      readonly strokeWidth: number;
    };

Variants · 3

DiscriminantTypeDescription
kind: "line"{ readonly kind: "line"; readonly points: readonly Point[]; readonly closed: boolean; readonly colour: MarkingColour; readonly strokeWidth: number; }
kind: "circle"{ readonly kind: "circle"; readonly centre: Point; readonly radius: number; readonly colour: MarkingColour; readonly strokeWidth: number; }
kind: "arc"{ readonly kind: "arc"; readonly centre: Point; readonly radius: number; readonly startAngle: number; readonly endAngle: number; readonly colour: MarkingColour; readonly strokeWidth: number; }

@openseat/renderer-konva/src/markings.ts

type

GestureEvent

type GestureEvent =
  | {
      readonly type: "tap";
      readonly point: Point;
      readonly info: PointerInfo;
    }
  | {
      readonly type: "dragstart";
      readonly start: Point;
      readonly point: Point;
      readonly info: PointerInfo;
    }
  | {
      readonly type: "dragmove";
      readonly start: Point;
      readonly point: Point;
      readonly step: Point;
      readonly info: PointerInfo;
    }
  | {
      readonly type: "dragend";
      readonly start: Point;
      readonly point: Point;
      readonly info: PointerInfo;
    }
  | {
      readonly type: "dragcancel";
      readonly info: PointerInfo;
// … 14 more lines (type truncated)

This type is long; its declaration is shortened here.

Variants · 8

DiscriminantTypeDescription
type: "tap"{ readonly type: "tap"; readonly point: Point; readonly info: PointerInfo; }
type: "dragstart"{ readonly type: "dragstart"; readonly start: Point; readonly point: Point; readonly info: PointerInfo; }
type: "dragmove"{ readonly type: "dragmove"; readonly start: Point; readonly point: Point; readonly step: Point; readonly info: PointerInfo; }
type: "dragend"{ readonly type: "dragend"; readonly start: Point; readonly point: Point; readonly info: PointerInfo; }
type: "dragcancel"{ readonly type: "dragcancel"; readonly info: PointerInfo; }

The current drag was abandoned, for example because a second finger turned it into a pinch.

type: "pinchstart"{ readonly type: "pinchstart"; readonly center: Point; }
type: "pinch"{ readonly type: "pinch"; readonly center: Point; readonly factor: number; readonly step: Point; }
type: "pinchend"{ readonly type: "pinchend"; }

@openseat/renderer-konva/src/gestures.ts

type

HandleHit

type HandleHit =
  | {
      readonly kind: "vertex";
      readonly index: number;
    }
  | {
      readonly kind: "midpoint";
      readonly edgeIndex: number;
    }
  | {
      readonly kind: "row";
      readonly end: "start" | "end";
    };

Variants · 3

DiscriminantTypeDescription
kind: "vertex"{ readonly kind: "vertex"; readonly index: number; }
kind: "midpoint"{ readonly kind: "midpoint"; readonly edgeIndex: number; }
kind: "row"{ readonly kind: "row"; readonly end: "start" | "end"; }

@openseat/renderer-konva/src/handles.ts

type

HatchOutline

Outline a hatch is clipped to, in the object's local space.

type HatchOutline =
  | {
      readonly kind: "polygon";
      readonly points: readonly Point[];
    }
  | {
      readonly kind: "rect";
      readonly width: number;
      readonly height: number;
    }
  | {
      readonly kind: "circle";
      readonly radius: number;
    };

Variants · 3

DiscriminantTypeDescription
kind: "polygon"{ readonly kind: "polygon"; readonly points: readonly Point[]; }
kind: "rect"{ readonly kind: "rect"; readonly width: number; readonly height: number; }
kind: "circle"{ readonly kind: "circle"; readonly radius: number; }

@openseat/renderer-konva/src/glyphs.ts

type

LayerName

Which Konva layer an object's node belongs on.

type LayerName = "areas" | "seats" | "top";

@openseat/renderer-konva/src/nodes.ts

type

MarkingColour

Colour role of a marking: the rink's red and blue lines (theme fieldMarking tokens), or a neutral line that contrasts with the stage fill.

type MarkingColour = "red" | "blue" | "line";

@openseat/renderer-konva/src/markings.ts

type

MemberKind

How a member node follows a group transform:

  • "rigid": position mapped, rotation follows (seats, labels: they keep their size);
  • "scaled": position mapped, rotation follows, the node also stretches (areas, booths, tables);
  • "frame": the node's local frame is the layout frame (row label groups), so it takes the full transform;
  • "point": position mapped, rotation kept (upright text such as section and seat labels).
type MemberKind = "rigid" | "scaled" | "frame" | "point";

@openseat/renderer-konva/src/group-transform.ts

type

PointerKind

type PointerKind = "mouse" | "pen" | "touch";

@openseat/renderer-konva/src/gestures.ts

type

RendererMode

type RendererMode = "view" | "edit";

@openseat/renderer-konva/src/renderer.ts

type

SeatVisibility

Whether individual seats are drawn at every zoom, or only once zoomed in past seatHideScale.

type SeatVisibility = "always" | "hidden-below-scale";

@openseat/renderer-konva/src/renderer.ts

type

WheelAction

type WheelAction =
  | {
      readonly kind: "zoom";
      readonly factor: number;
    }
  | {
      readonly kind: "pan";
      readonly dx: number;
      readonly dy: number;
    };

Variants · 2

DiscriminantTypeDescription
kind: "zoom"{ readonly kind: "zoom"; readonly factor: number; }

Multiply the scale by factor, keeping the point under the cursor fixed.

kind: "pan"{ readonly kind: "pan"; readonly dx: number; readonly dy: number; }

Pan by screen pixels.

@openseat/renderer-konva/src/gestures.ts

type

WheelMode

What a plain mouse wheel does: zoom at the cursor, or pan.

type WheelMode = "zoom" | "pan";

@openseat/renderer-konva/src/gestures.ts

Constants28

const

ACCESSIBLE_RING_MIN_RADIUS_PX

Below this on-screen seat radius (in pixels) the pictogram is not legible, so an accessible seat is drawn with a ring in the glyph colour instead.

const ACCESSIBLE_RING_MIN_RADIUS_PX = 5

@openseat/renderer-konva/src/glyphs.ts

const

ACCESSIBLE_RING_WIDTH_PX

Width of that ring, in screen pixels.

const ACCESSIBLE_RING_WIDTH_PX = 2

@openseat/renderer-konva/src/glyphs.ts

const

AREA_TINT_ALPHA

Fill opacity of sections and GA areas tinted by a style or category colour.

const AREA_TINT_ALPHA = 0.35

@openseat/renderer-konva/src/nodes.ts

const

COMPACT_GLYPH_OFFSET

Vertical offset of a compact pictogram below the seat centre, and of the seat label above it, as × radius.

const COMPACT_GLYPH_OFFSET = 0.42

@openseat/renderer-konva/src/glyphs.ts

const

COMPACT_LABEL_OFFSET

const COMPACT_LABEL_OFFSET = -0.32

@openseat/renderer-konva/src/glyphs.ts

const

COMPANION_GLYPH_NAME

Konva name of the companion mark node drawn over a companion seat.

const COMPANION_GLYPH_NAME = "companion-mark"

@openseat/renderer-konva/src/nodes.ts

const

COMPANION_GLYPH_PATH

Companion-seat mark: a small head-and-shoulders figure, centred on the origin in a box about 11 units tall. Visibly different from the wheelchair.

const COMPANION_GLYPH_PATH: string

@openseat/renderer-konva/src/glyphs.ts

const

COMPANION_GLYPH_SIZE

Height of COMPANION_GLYPH_PATH's box, in path units.

const COMPANION_GLYPH_SIZE = 11

@openseat/renderer-konva/src/glyphs.ts

const

DEFAULT_ZOOM_LIMITS

const DEFAULT_ZOOM_LIMITS: ZoomLimits

@openseat/renderer-konva/src/viewport.ts

const

DIVIDER_CAPTION_PAD

Space left between a divider line and its caption on each side, × the caption font size.

const DIVIDER_CAPTION_PAD = 0.6

@openseat/renderer-konva/src/shapes.ts

const

DIVIDER_LINE_NAME

Konva name of each drawn piece of a divider line (broken around its caption).

const DIVIDER_LINE_NAME = "divider-line"

@openseat/renderer-konva/src/nodes.ts

const

HANDLE_RADIUS_PX

Handle radius in screen pixels.

const HANDLE_RADIUS_PX = 6

@openseat/renderer-konva/src/handles.ts

const

MIDPOINT_HANDLE_HINT

Tooltip of an edge midpoint handle.

const MIDPOINT_HANDLE_HINT =
  "Click to add a corner here (or drag to place it)"

@openseat/renderer-konva/src/handles.ts

const

MIN_SECTION_LABEL_SIZE

Smallest size a section label is shrunk to for a small outline.

const MIN_SECTION_LABEL_SIZE = 8

@openseat/renderer-konva/src/scene.ts

const

NOT_FOR_SALE_HATCH_NAME

Konva name of the diagonal hatch drawn over a not-for-sale GA area, booth or table.

const NOT_FOR_SALE_HATCH_NAME = "not-for-sale-hatch"

@openseat/renderer-konva/src/nodes.ts

const

RESIZE_HANDLE_HINT

Tooltip of the transformer's resize handles.

const RESIZE_HANDLE_HINT = "Drag to resize"

@openseat/renderer-konva/src/handles.ts

const

ROTATE_HANDLE_HINT

Tooltip of the transformer's rotate handle.

const ROTATE_HANDLE_HINT =
  "Drag to rotate (hold Shift for 90\u00B0 steps)"

@openseat/renderer-konva/src/handles.ts

const

ROW_HANDLE_GAP

Distance from a row's end seat edge to its "+" handle, in layout units.

const ROW_HANDLE_GAP = 12

@openseat/renderer-konva/src/handles.ts

const

ROW_HANDLE_HINT

Tooltip of a row's "+" handle (shown as the canvas container's title while hovered).

const ROW_HANDLE_HINT =
  "Add a seat to this row (drag to add several)"

@openseat/renderer-konva/src/handles.ts

const

ROW_LABEL_FONT_SIZE

const ROW_LABEL_FONT_SIZE = 11

@openseat/renderer-konva/src/scene.ts

const

ROW_LABEL_GAP

Gap between the edge of a row's end seat and its row label, in layout units.

const ROW_LABEL_GAP = 8

@openseat/renderer-konva/src/scene.ts

const

SECTION_LABEL_SIZE

Default section label size, in layout units.

const SECTION_LABEL_SIZE = 16

@openseat/renderer-konva/src/scene.ts

const

STAGE_OUTLINE_NAME

Konva name of a stage's outline path.

const STAGE_OUTLINE_NAME = "stage-outline"

@openseat/renderer-konva/src/nodes.ts

const

TEXT_KIND_ATTR

Konva attribute naming what a text node is (a core TextBoxKind), on every section title, row label, zone, stage, table and booth label, free label and divider caption. The renderer's text-box test hooks read it.

const TEXT_KIND_ATTR = "openseatTextKind"

@openseat/renderer-konva/src/nodes.ts

const

VERTEX_HANDLE_HINT

Tooltip of a vertex handle.

const VERTEX_HANDLE_HINT =
  "Drag to move this corner (Alt+click or double-click to remove it)"

@openseat/renderer-konva/src/handles.ts

const

WHEELCHAIR_GLYPH_NAME

Konva name of the wheelchair pictogram node drawn over an accessible seat.

const WHEELCHAIR_GLYPH_NAME = "accessible-glyph"

@openseat/renderer-konva/src/nodes.ts

const

WHEELCHAIR_GLYPH_PATH

Wheelchair pictogram as SVG path data, centred on the origin in a box about 20 units tall: head, body and leg, and a wheel (a ring: its inner circle winds the other way, so the nonzero fill rule leaves a hole). Drawn with a fill only, so it renders the same in Konva and in SVG without fonts.

const WHEELCHAIR_GLYPH_PATH: string

@openseat/renderer-konva/src/glyphs.ts

const

WHEELCHAIR_GLYPH_SIZE

Height of WHEELCHAIR_GLYPH_PATH's box, in path units.

const WHEELCHAIR_GLYPH_SIZE = 20

@openseat/renderer-konva/src/glyphs.ts