names#

Interfaces#

CutText#

Defined in: layout/src/names.ts:26

A text as drawn: cut to its max-width or whole, with its width.

Properties#

text#

readonly text: string

Defined in: layout/src/names.ts:27

width#

readonly width: number

Defined in: layout/src/names.ts:28


NameItem#

Defined in: layout/src/names.ts:12

A name and its text: what one line or ancestor line gives its row of the name column.

Properties#

name#

readonly name: Styled

Defined in: layout/src/names.ts:13

text#

readonly text: string

Defined in: layout/src/names.ts:14


RowName#

Defined in: layout/src/names.ts:18

The one text of a row of the name column (section 6.6), before its row’s ordinate is known.

Properties#

first#

readonly first: Styled

Defined in: layout/src/names.ts:20

The first displayed name of the row, whose address, style and font size the text takes.

text#

readonly text: string

Defined in: layout/src/names.ts:21

width#

readonly width: number

Defined in: layout/src/names.ts:22

Functions#

centredLabel()#

centredLabel(owner, centre, baseline, item, coordinate?): TextElement

Defined in: layout/src/names.ts:124

A label centred on centre.

Parameters#

owner#

Styled

centre#

number

baseline#

number

item#

Measured

coordinate?#

ShownCoordinate

Returns#

TextElement


cutText()#

cutText(measure, text, size, maximum): CutText

Defined in: layout/src/names.ts:38

A name text cut to its max-width with … (section 6.6): the longest prefix that fits with the ellipsis, found by binary search over the text’s advance sums.

Parameters#

measure#

TextMeasure

text#

string

size#

number

maximum#

number | "none"

Returns#

CutText


lineNames()#

lineNames(lines): NameItem[]

Defined in: layout/src/names.ts:74

The names a row’s lines give it, in their order: a segment’s line gives none (section 6.6), and a timeline drawn in several pieces of a switched card names its row once (section 8.10).

Parameters#

lines#

readonly Entry[]

Returns#

NameItem[]


nameElement()#

nameElement(scope, name, n, y): TextElement

Defined in: layout/src/names.ts:109

A row’s text drawn at the name column n, vertically centred on the row’s ordinate y: its baseline at y + (a(s) − d(s)) / 2, s its font size (section 6.6).

Parameters#

scope#

Scope

name#

RowName

n#

number

y#

number

Returns#

TextElement


nameOf()#

nameOf(timeline): string

Defined in: layout/src/names.ts:32

The name of a timeline (section 5.3): its name, or its whole ID, never parsed.

Parameters#

timeline#

{ }

Returns#

string


rowName()#

rowName(scope, items): RowName | undefined

Defined in: layout/src/names.ts:89

The text of a row of the name column (section 6.6): the displayed names of items, in order, joined by , , or the content of the first of them when it is not none, cut to that name’s max-width; undefined when no name is displayed, so the row has no text.

Parameters#

scope#

Scope

items#

readonly NameItem[]

Returns#

RowName | undefined