gestures/region#
Interfaces#
Held#
Defined in: arranger/src/gestures/region.ts:56
A region of a manifest and the timeline holding it.
Extended by#
Properties#
region#
readonlyregion:object
Defined in: arranger/src/gestures/region.ts:58
timeline#
readonlytimeline:object
Defined in: arranger/src/gestures/region.ts:57
RegionContext#
Defined in: arranger/src/gestures/region.ts:158
Where a drag reads its snapping: the block and how finely a value is picked.
Properties#
block#
readonlyblock:string
Defined in: arranger/src/gestures/region.ts:159
granularity#
readonlygranularity:Granularity
Defined in: arranger/src/gestures/region.ts:160
RegionHost#
Defined in: arranger/src/gestures/region.ts:274
The handles’ side of a drag.
Properties#
actions#
readonlyactions:NodeActions
Defined in: arranger/src/gestures/region.ts:275
Methods#
granularity()#
granularity():
Granularity
Defined in: arranger/src/gestures/region.ts:279
Returns#
live()#
live(
live):void
Defined in: arranger/src/gestures/region.ts:281
Hears the dragged handle’s place and value while it moves; null once the drag ends.
Parameters#
live#
RegionLive | null
Returns#
void
target()#
target(): {
node:BlockNode;subject:RegionSubject; } |undefined
Defined in: arranger/src/gestures/region.ts:277
The node the region lies in, as stored, and the brace whose handle is pressed.
Returns#
{ node: BlockNode; subject: RegionSubject; } | undefined
viewport()#
viewport():
Viewport
Defined in: arranger/src/gestures/region.ts:278
Returns#
Viewport
RegionLive#
Defined in: arranger/src/gestures/region.ts:252
Where a dragged handle lies on the canvas as the preview draws its brace, in canvas units.
Properties#
at#
readonlyat:Point
Defined in: arranger/src/gestures/region.ts:254
edge#
readonlyedge:GapEdge
Defined in: arranger/src/gestures/region.ts:253
text#
readonlytext:string
Defined in: arranger/src/gestures/region.ts:258
What the flag says: the region and its stretch with the dragged end at value.
top#
readonlytop:number
Defined in: arranger/src/gestures/region.ts:256
The top of the brace there, in canvas units: the flag’s pole rises above it.
RegionPiece#
Defined in: arranger/src/gestures/region.ts:76
One brace of a region drawn, with the card drawing it and the map of that card’s axis.
Properties#
axis#
readonlyaxis:CardAxis
Defined in: arranger/src/gestures/region.ts:84
card#
readonlycard:PlaceKey
Defined in: arranger/src/gestures/region.ts:81
The place key of the card drawing it.
element#
readonlyelement:RegionElement
Defined in: arranger/src/gestures/region.ts:79
index#
readonlyindex:number
Defined in: arranger/src/gestures/region.ts:78
Its index in drawing.elements.
nth#
readonlynth:number
Defined in: arranger/src/gestures/region.ts:83
How many braces of the same region the same card draws before it.
RegionPress#
Defined in: arranger/src/gestures/region.ts:285
What a press on a handle holds.
Extends#
Properties#
context#
readonlycontext:RegionContext
Defined in: arranger/src/gestures/region.ts:289
node#
readonlynode:BlockNode
Defined in: arranger/src/gestures/travel.ts:14
Inherited from#
pan#
readonlypan:Point
Defined in: arranger/src/gestures/travel.ts:16
Inherited from#
screen#
readonlyscreen:Point
Defined in: arranger/src/gestures/travel.ts:15
Inherited from#
subject#
readonlysubject:RegionSubject
Defined in: arranger/src/gestures/region.ts:288
view#
readonlyview:View
Defined in: arranger/src/gestures/region.ts:287
The view as stored at the press, which the command is built on.
RegionSubject#
Defined in: arranger/src/gestures/region.ts:88
What the handles of one brace act on.
Extends#
Properties#
edges#
readonlyedges: readonlyGapEdge[]
Defined in: arranger/src/gestures/region.ts:94
The ends of the brace its card’s axis reads back as the region’s own: those taking a handle.
end#
readonlyend:Rational
Defined in: arranger/src/gestures/region.ts:92
piece#
readonlypiece:RegionPiece
Defined in: arranger/src/gestures/region.ts:89
region#
readonlyregion:object
Defined in: arranger/src/gestures/region.ts:58
Inherited from#
start#
readonlystart:Rational
Defined in: arranger/src/gestures/region.ts:91
The region’s start and end on its timeline’s own axis, exact.
timeline#
readonlytimeline:object
Defined in: arranger/src/gestures/region.ts:57
Inherited from#
Type Aliases#
RegionEdge#
RegionEdge =
GapEdge
Defined in: arranger/src/gestures/region.ts:53
An end of a region: its start (the brace’s left end) or its end (its right one).
Functions#
handlePoint()#
handlePoint(
element,edge):Point
Defined in: arranger/src/gestures/region.ts:293
The handle’s place on a brace: its end, at the ordinate of its arms.
Parameters#
element#
edge#
Returns#
regionCommand()#
regionCommand(
view,block,subject,edge,value):Command|null
Defined in: arranger/src/gestures/region.ts:236
The command storing value as the edge of subject’s region in block
block of view: one set of that end on {block, id: R}, written in
the timeline’s number type; null where it is the stored value, the
block is gone or the number type cannot hold it.
Parameters#
view#
block#
string
subject#
edge#
value#
Returns#
Command | null
regionDrag()#
regionDrag(
context,subject,edge,dx,tolerance,reach):Rational|null
Defined in: arranger/src/gestures/region.ts:201
The value the edge of subject takes when its handle is dragged dx
block units: the value of the region’s timeline the card’s axis reads at
the end’s abscissa moved by dx (beyond the axis or inside a gap, the end
moved by dx / k, k the block units per unit of the timeline on the run
the end lies on), snapped to a value of targetsOf within tolerance
block units, else to the simplest value of its number type within reach
block units (core’s snapOnRow), held where the end may lie: never past
the region’s other end, nor before its timeline’s start or after its known
end. null where the axis has no scale there.
Parameters#
context#
subject#
edge#
dx#
number
tolerance#
number
reach#
number
Returns#
Rational | null
regionGesture()#
regionGesture(
host,edge):GestureStrategy<RegionPress,Rational>
Defined in: arranger/src/gestures/region.ts:305
The drag of the edge handle of a selected region’s brace: the
pointer’s travel in the block’s drawing units moves that end
(regionDrag: a snapping value within HIT_TOLERANCE screen pixels,
else the simplest value within half a pixel). Each value is previewed as
its set leaves the block, the handle following its brace there; the
release stores it, one set.
Parameters#
host#
edge#
Returns#
regionOf()#
regionOf(
manifest,id):Held|undefined
Defined in: arranger/src/gestures/region.ts:62
The region id of manifest and its timeline; undefined where no timeline holds one.
Parameters#
manifest#
id#
string
Returns#
Held | undefined
regionSubjectsOf()#
regionSubjectsOf(
manifest,drawing,address): readonlyRegionSubject[]
Defined in: arranger/src/gestures/region.ts:126
What the handles of the region address of manifest act on in
drawing: one subject per brace drawn of it, in drawing order, with the
ends taking a handle; none for an atomic section (read only), an address
naming no region, or a brace in no recorded card.
Parameters#
manifest#
drawing#
address#
Returns#
readonly RegionSubject[]
regionText()#
regionText(
subject,edge,value):string
Defined in: arranger/src/gestures/region.ts:266
What the flag of a dragged region handle says: the region’s name (its
ID without one) and its stretch with the edge at value, written as a
gap’s flag writes a stretch: “B, 12–18 ♩”.
Parameters#
subject#
edge#
value#
Returns#
string