descriptors#
Interfaces#
CircleDescriptor#
Defined in: writers/src/descriptors.ts:88
A circle of radius r around (cx, cy).
Extends#
Written
Properties#
attrs#
readonlyattrs: readonlyAttribute[]
Defined in: writers/src/descriptors.ts:63
Its attributes in the order they are written: its address, geometry, paint and opacity.
Inherited from#
Written.attrs
cx#
readonlycx:number
Defined in: writers/src/descriptors.ts:90
cy#
readonlycy:number
Defined in: writers/src/descriptors.ts:91
r#
readonlyr:number
Defined in: writers/src/descriptors.ts:92
source#
readonlysource:DescriptorSource
Defined in: writers/src/descriptors.ts:64
Inherited from#
Written.source
tag#
readonlytag:"circle"
Defined in: writers/src/descriptors.ts:89
text#
readonlytext:null
Defined in: writers/src/descriptors.ts:93
LineDescriptor#
Defined in: writers/src/descriptors.ts:78
A line from (x1, y1) to (x2, y2).
Extends#
Written
Properties#
attrs#
readonlyattrs: readonlyAttribute[]
Defined in: writers/src/descriptors.ts:63
Its attributes in the order they are written: its address, geometry, paint and opacity.
Inherited from#
Written.attrs
source#
readonlysource:DescriptorSource
Defined in: writers/src/descriptors.ts:64
Inherited from#
Written.source
tag#
readonlytag:"line"
Defined in: writers/src/descriptors.ts:79
text#
readonlytext:null
Defined in: writers/src/descriptors.ts:84
x1#
readonlyx1:number
Defined in: writers/src/descriptors.ts:80
x2#
readonlyx2:number
Defined in: writers/src/descriptors.ts:82
y1#
readonlyy1:number
Defined in: writers/src/descriptors.ts:81
y2#
readonlyy2:number
Defined in: writers/src/descriptors.ts:83
PathDescriptor#
Defined in: writers/src/descriptors.ts:104
A path drawn by the commands d.
Extends#
Written
Properties#
attrs#
readonlyattrs: readonlyAttribute[]
Defined in: writers/src/descriptors.ts:63
Its attributes in the order they are written: its address, geometry, paint and opacity.
Inherited from#
Written.attrs
d#
readonlyd: readonlyPathCommand[]
Defined in: writers/src/descriptors.ts:106
source#
readonlysource:DescriptorSource
Defined in: writers/src/descriptors.ts:64
Inherited from#
Written.source
tag#
readonlytag:"path"
Defined in: writers/src/descriptors.ts:105
text#
readonlytext:null
Defined in: writers/src/descriptors.ts:107
PointsDescriptor#
Defined in: writers/src/descriptors.ts:97
A polygon (closed) or polyline (open) through points.
Extends#
Written
Properties#
attrs#
readonlyattrs: readonlyAttribute[]
Defined in: writers/src/descriptors.ts:63
Its attributes in the order they are written: its address, geometry, paint and opacity.
Inherited from#
Written.attrs
points#
readonlypoints: readonlyPoint[]
Defined in: writers/src/descriptors.ts:99
source#
readonlysource:DescriptorSource
Defined in: writers/src/descriptors.ts:64
Inherited from#
Written.source
tag#
readonlytag:"polygon"|"polyline"
Defined in: writers/src/descriptors.ts:98
text#
readonlytext:null
Defined in: writers/src/descriptors.ts:100
RectDescriptor#
Defined in: writers/src/descriptors.ts:68
A rect: its top-left corner (x, y), its width and its height.
Extends#
Written
Properties#
attrs#
readonlyattrs: readonlyAttribute[]
Defined in: writers/src/descriptors.ts:63
Its attributes in the order they are written: its address, geometry, paint and opacity.
Inherited from#
Written.attrs
height#
readonlyheight:number
Defined in: writers/src/descriptors.ts:73
source#
readonlysource:DescriptorSource
Defined in: writers/src/descriptors.ts:64
Inherited from#
Written.source
tag#
readonlytag:"rect"
Defined in: writers/src/descriptors.ts:69
text#
readonlytext:null
Defined in: writers/src/descriptors.ts:74
width#
readonlywidth:number
Defined in: writers/src/descriptors.ts:72
x#
readonlyx:number
Defined in: writers/src/descriptors.ts:70
y#
readonlyy:number
Defined in: writers/src/descriptors.ts:71
TextDescriptor#
Defined in: writers/src/descriptors.ts:111
A text element holding text, anchored at (x, y) by its start or middle.
Extends#
Written
Properties#
anchor#
readonlyanchor:"start"|"middle"
Defined in: writers/src/descriptors.ts:115
attrs#
readonlyattrs: readonlyAttribute[]
Defined in: writers/src/descriptors.ts:63
Its attributes in the order they are written: its address, geometry, paint and opacity.
Inherited from#
Written.attrs
source#
readonlysource:DescriptorSource
Defined in: writers/src/descriptors.ts:64
Inherited from#
Written.source
tag#
readonlytag:"text"
Defined in: writers/src/descriptors.ts:112
text#
readonlytext:string
Defined in: writers/src/descriptors.ts:116
x#
readonlyx:number
Defined in: writers/src/descriptors.ts:113
y#
readonlyy:number
Defined in: writers/src/descriptors.ts:114
Type Aliases#
Attribute#
Attribute = readonly [typeof
ADDRESS_ATTRIBUTES[number] |"fill"|"stroke"|"stroke-dasharray"|"text-anchor",string] | readonly ["x"|"y"|"width"|"height"|"rx"|"x1"|"y1"|"x2"|"y2"|"cx"|"cy"|"r"|"font-size"|"stroke-width"|"opacity",number] | readonly ["points", readonlyPoint[]] | readonly ["d", readonlyPathCommand[]]
Defined in: writers/src/descriptors.ts:30
One SVG attribute, its name and its value, as the descriptor writes it.
AttributeValue#
AttributeValue =
Attribute[1]
Defined in: writers/src/descriptors.ts:59
An attribute value: a number, a string, polygon points or path data.
Descriptor#
Descriptor =
RectDescriptor|LineDescriptor|CircleDescriptor|PointsDescriptor|PathDescriptor|TextDescriptor
Defined in: writers/src/descriptors.ts:123
One SVG element: its tag, its geometry, its attributes in the order they are written, its text, and the element it was written from.
PathCommand#
Defined in: layout/src/elements.ts:199
One path command and its points, in the order they are written.
Point#
Point = readonly [
number,number]
Defined in: layout/src/elements.ts:196
A point (x, y) in block-local canvas units.
Tag#
Tag =
"rect"|"line"|"circle"|"polygon"|"polyline"|"path"|"text"
Defined in: writers/src/descriptors.ts:27
The SVG element a descriptor writes.
Variables#
ADDRESS_ATTRIBUTES#
constADDRESS_ATTRIBUTES: readonly ["data-id","data-facet","data-part"]
Defined in: writers/src/descriptors.ts:24
The SVG attributes that carry an element’s address (section 7.2), in the order written.
Functions#
toDescriptors()#
toDescriptors(
drawing):Descriptor[]
Defined in: writers/src/descriptors.ts:436
The descriptors of a drawing, in the order of its elements, each naming its element.