Scene schema
This page lists every type that makes up a stored drawing: its scenes, layouts, models, elements and styles. Use it to look up a field’s name and type when you read or write a drawing’s records.
A ? after a field name marks it optional, and a linked type opens that type. A type that extends another lists
only the fields that differ. The page is generated from the schemas in @dxos/scene, whose source also holds the
same types as one JSON Schema document, ontology.schema.json.
Document
Section titled “Document”The root of a drawing as it is read or printed whole.
Document
Section titled “Document”Scenes, layouts and models together. The first scene is the root.
| Field | Type |
|---|---|
scenes |
(Scene.SceneRecord2D or Scene.SceneRecord3D)[] |
layouts |
(Scene.LayoutRecord2D or Scene.LayoutRecord3D)[] |
models |
(Scene.ModelRecord2D or Scene.ModelRecord3D)[] |
Scenes
Section titled “Scenes”A scene views one layout through a camera.
Scene.SceneRecord2D
Section titled “Scene.SceneRecord2D”A 2D scene as plain data.
| Field | Type |
|---|---|
id |
string |
dim |
2d |
name? |
string |
theme? |
string |
layout |
string |
camera |
Scene.Camera2D |
Scene.SceneRecord3D
Section titled “Scene.SceneRecord3D”A 3D scene as plain data. Extends Scene.SceneRecord2D.
| Field | Type |
|---|---|
dim |
3d |
camera |
Scene.Camera3D |
Scene.Scene2D
Section titled “Scene.Scene2D”A 2D scene as an ECHO object. ECHO type org.dxos.type.scene.scene2d, version 0.1.0. As Scene.SceneRecord2D, without dim.
| Field | Type |
|---|---|
key |
string |
layout |
ref to Scene.Layout2D |
Scene.Scene3D
Section titled “Scene.Scene3D”A 3D scene as an ECHO object. ECHO type org.dxos.type.scene.scene3d, version 0.1.0. As Scene.SceneRecord3D, without dim.
| Field | Type |
|---|---|
key |
string |
layout |
ref to Scene.Layout3D |
Scene.Camera2D
Section titled “Scene.Camera2D”Where a 2D scene looks and how far in.
| Field | Type |
|---|---|
center |
{ x: number, y: number } |
zoom |
number |
Scene.Camera3D
Section titled “Scene.Camera3D”An orbit camera. Angles are in degrees.
| Field | Type |
|---|---|
target |
Scene.Vec3 |
yaw |
number |
pitch |
number |
distance |
number |
fov |
number |
projection |
perspective orthographic |
Layouts
Section titled “Layouts”A layout positions elements in one coordinate space.
Scene.LayoutRecord2D
Section titled “Scene.LayoutRecord2D”A 2D layout as plain data.
| Field | Type |
|---|---|
id |
string |
dim |
2d |
name? |
string |
model? |
string |
elements |
map of Scene.ElementRecord2D |
styles? |
map of Style2D |
layers? |
map of Layer |
kind? |
Scene.LayoutKind |
anonymous? |
boolean |
arrange? |
Scene.Arrangement |
props? |
map of any |
grid? |
Scene.GridPitch |
lattice? |
Scene.Lattice |
constraints? |
Scene.Constraint[] |
Scene.LayoutRecord3D
Section titled “Scene.LayoutRecord3D”A 3D layout as plain data. As Scene.LayoutRecord2D, without grid, lattice, constraints.
| Field | Type |
|---|---|
dim |
3d |
elements |
map of Scene.ElementRecord3D |
styles? |
map of Style3D |
Scene.Layout2D
Section titled “Scene.Layout2D”A 2D layout as an ECHO object. ECHO type org.dxos.type.scene.layout2d, version 0.2.0. As Scene.LayoutRecord2D, without dim.
| Field | Type |
|---|---|
key |
string |
model? |
ref to any object |
Scene.Layout3D
Section titled “Scene.Layout3D”A 3D layout as an ECHO object. ECHO type org.dxos.type.scene.layout3d, version 0.2.0. As Scene.LayoutRecord3D, without dim.
| Field | Type |
|---|---|
key |
string |
model? |
ref to any object |
Scene.GridPitch
Section titled “Scene.GridPitch”A grid pitch in scene px.
Type: number, at least 1.
Scene.Lattice
Section titled “Scene.Lattice”Lattice mode’s grid: shapes span whole cells and links run in the gutters.
| Field | Type |
|---|---|
width |
number |
height |
number |
gutterX |
number |
gutterY |
number |
Scene.Constraint
Section titled “Scene.Constraint”Constrained mode’s relation of one element to another.
| Field | Type |
|---|---|
subject |
string |
relation |
Scene.Placement |
object |
string |
Scene.Arrangement
Section titled “Scene.Arrangement”How a layout places the elements that have no position yet.
| Field | Type |
|---|---|
kind |
string |
params? |
map of any |
A layer that elements paint on, bottom first.
| Field | Type |
|---|---|
id |
string |
name |
string |
z |
string |
hidden? |
boolean |
Models
Section titled “Models”A model holds the reusable objects that elements place, and the named styles.
Scene.ModelRecord2D
Section titled “Scene.ModelRecord2D”A 2D model as plain data.
| Field | Type |
|---|---|
id |
string |
dim |
2d |
name? |
string |
objects |
map of Scene.Object2D |
styles? |
map of NamedStyle2D |
catalogs? |
string[] |
Scene.ModelRecord3D
Section titled “Scene.ModelRecord3D”A 3D model as plain data. Extends Scene.ModelRecord2D.
| Field | Type |
|---|---|
dim |
3d |
objects |
map of Scene.Object3D |
styles? |
map of NamedStyle3D |
Scene.Model2D
Section titled “Scene.Model2D”A 2D model as an ECHO object. ECHO type org.dxos.type.scene.model2d, version 0.2.0. As Scene.ModelRecord2D, without dim.
| Field | Type |
|---|---|
key |
string |
objects |
map of Scene.StoredObject2D |
catalogs? |
ref to StyleCatalog[] |
Scene.Model3D
Section titled “Scene.Model3D”A 3D model as an ECHO object. ECHO type org.dxos.type.scene.model3d, version 0.2.0. As Scene.ModelRecord3D, without dim.
| Field | Type |
|---|---|
key |
string |
objects |
map of Scene.StoredObject3D |
catalogs? |
ref to StyleCatalog[] |
Scene.Object2D
Section titled “Scene.Object2D”A reusable 2D object, with no position.
| Field | Type |
|---|---|
id |
string |
kind |
string |
style? |
string |
props? |
map of any |
lockAspect? |
boolean |
size? |
{ width: number, height: number } |
overrides? |
Style2D |
parts? |
string |
Scene.Object3D
Section titled “Scene.Object3D”A reusable 3D object, with no position.
| Field | Type |
|---|---|
id |
string |
kind |
string |
style? |
string |
props? |
map of any |
lockAspect? |
boolean |
scale? |
Scene.Vec3 |
overrides? |
Style3D |
parts? |
string |
Scene.StoredObject2D
Section titled “Scene.StoredObject2D”A 2D object as a Model2D stores it. Extends Scene.Object2D.
| Field | Type |
|---|---|
parts? |
ref to any object |
Scene.StoredObject3D
Section titled “Scene.StoredObject3D”A 3D object as a Model3D stores it. Extends Scene.Object3D.
| Field | Type |
|---|---|
parts? |
ref to any object |
Elements
Section titled “Elements”An element is one stored record of a layout, in either dimension.
Scene.BaseElement
Section titled “Scene.BaseElement”The fields every element has, in either dimension.
| Field | Type |
|---|---|
id |
string |
object? |
string |
kind? |
string |
z? |
string |
layer? |
string |
hidden? |
boolean |
locked? |
boolean |
label? |
string |
style? |
string |
source? |
ElementEndpoint |
target? |
ElementEndpoint |
pinned? |
boolean |
constrain? |
PartLayout |
composite? |
string |
dsl? |
Scene.DslIdentity |
data? |
map of any |
props? |
map of any |
Scene.Element2D
Section titled “Scene.Element2D”A 2D element. Extends Scene.BaseElement.
| Field | Type |
|---|---|
center? |
{ x: number, y: number } |
size? |
{ width: number, height: number } |
rotation? |
number |
scale? |
{ x: number, y: number } |
fit? |
InstanceFit |
overrides? |
Style2D |
ports? |
Port[] |
portsPerSide? |
number |
exposed? |
boolean |
bind? |
string |
optional? |
boolean |
grow? |
string |
follows? |
string |
partOverrides? |
map of map of unknown |
parent? |
string |
extent? |
{ width?: number, height?: number } |
path? |
line ortho curve spline smart |
points? |
Point[] |
tail? |
arrow circle diamond diamond-filled crowsfoot triangle |
head? |
arrow circle diamond diamond-filled crowsfoot triangle |
connector? |
DiagramConnector |
Scene.Element3D
Section titled “Scene.Element3D”A 3D element. Extends Scene.BaseElement.
| Field | Type |
|---|---|
center? |
Scene.Vec3 |
scale? |
Scene.Vec3 |
rotation? |
Scene.Vec3 |
fit? |
InstanceFit |
overrides? |
Style3D |
Scene.ElementRecord2D
Section titled “Scene.ElementRecord2D”A 2D element as a layout stores it: the element, and its kind’s own fields beside it.
| Field | Type |
|---|---|
id |
string |
object? |
string |
kind? |
string |
z? |
string |
layer? |
string |
hidden? |
boolean |
locked? |
boolean |
label? |
string |
style? |
string |
source? |
ElementEndpoint |
target? |
ElementEndpoint |
pinned? |
boolean |
constrain? |
PartLayout |
composite? |
string |
dsl? |
Scene.DslIdentity |
data? |
map of any |
props? |
map of any |
center? |
{ x: number, y: number } |
size? |
{ width: number, height: number } |
rotation? |
number |
scale? |
{ x: number, y: number } |
fit? |
InstanceFit |
overrides? |
Style2D |
ports? |
Port[] |
portsPerSide? |
number |
exposed? |
boolean |
bind? |
string |
optional? |
boolean |
grow? |
string |
follows? |
string |
partOverrides? |
map of map of unknown |
parent? |
string |
extent? |
{ width?: number, height?: number } |
path? |
line ortho curve spline smart |
points? |
Point[] |
tail? |
arrow circle diamond diamond-filled crowsfoot triangle |
head? |
arrow circle diamond diamond-filled crowsfoot triangle |
connector? |
DiagramConnector |
Scene.ElementRecord3D
Section titled “Scene.ElementRecord3D”A 3D element as a layout stores it.
| Field | Type |
|---|---|
id |
string |
object? |
string |
kind? |
string |
z? |
string |
layer? |
string |
hidden? |
boolean |
locked? |
boolean |
label? |
string |
style? |
string |
source? |
ElementEndpoint |
target? |
ElementEndpoint |
pinned? |
boolean |
constrain? |
PartLayout |
composite? |
string |
dsl? |
Scene.DslIdentity |
data? |
map of any |
props? |
map of any |
center? |
Scene.Vec3 |
scale? |
Scene.Vec3 |
rotation? |
Scene.Vec3 |
fit? |
InstanceFit |
overrides? |
Style3D |
ElementEndpoint
Section titled “ElementEndpoint”A link’s end as an element stores it.
| Field | Type |
|---|---|
node? |
string |
port? |
string |
point? |
Point |
Scene.DslIdentity
Section titled “Scene.DslIdentity”The DSL statement that made an element.
| Field | Type |
|---|---|
object |
string |
element |
string |
part? |
string |
ref? |
string |
index? |
string |
portal? |
string |
PartLayout
Section titled “PartLayout”How a part of a composite follows its frame on each axis.
| Field | Type |
|---|---|
x? |
PartConstraint |
y? |
PartConstraint |
Scene.Vec3
Section titled “Scene.Vec3”A 3D vector.
| Field | Type |
|---|---|
x |
number |
y |
number |
z |
number |
A node is the typed form of a 2D element that is not a link, one schema per kind.
NodeBase
Section titled “NodeBase”The fields every node kind shares.
| Field | Type | Notes |
|---|---|---|
kind |
string | |
id |
string | |
z |
string | |
locked? |
boolean | |
center |
Point | |
size |
Size | |
rotation? |
number | -360 to 360 |
ports? |
Port[] | |
portsPerSide? |
number | |
layer? |
string | |
style? |
string | |
overrides? |
Style2D | |
exposed? |
boolean | |
bind? |
string | |
optional? |
boolean | |
hidden? |
boolean | |
grow? |
string | |
follows? |
string | |
composite? |
string | |
partOverrides? |
map of map of unknown | |
parent? |
string | |
extent? |
{ width?: number, height?: number } | |
constrain? |
PartLayout |
BaseNode
Section titled “BaseNode”A node whose kind is not known here: a box with a label. Extends NodeBase.
| Field | Type |
|---|---|
label? |
string |
RectNode
Section titled “RectNode”A rectangle. Extends NodeBase.
| Field | Type |
|---|---|
kind |
rect |
label? |
string |
padding? |
Padding |
EllipseNode
Section titled “EllipseNode”An ellipse inscribed in the frame. Extends NodeBase.
| Field | Type |
|---|---|
kind |
ellipse |
label? |
string |
padding? |
Padding |
CloudNode
Section titled “CloudNode”A cloud filling the frame. Extends NodeBase.
| Field | Type |
|---|---|
kind |
cloud |
label? |
string |
padding? |
Padding |
params? |
CloudParams |
CloudParams
Section titled “CloudParams”A cloud’s own settings.
| Field | Type | Notes |
|---|---|---|
bumps? |
integer | 3 to 24 |
PolygonNode
Section titled “PolygonNode”A regular polygon. Extends NodeBase.
| Field | Type |
|---|---|
kind |
polygon |
label? |
string |
padding? |
Padding |
params? |
PolygonParams |
PolygonParams
Section titled “PolygonParams”A polygon’s own settings.
| Field | Type | Notes |
|---|---|---|
sides? |
integer | 3 to 24 |
fit? |
frame circle |
ShapeNode
Section titled “ShapeNode”A shape that a named recipe draws from the frame and parameters. Extends NodeBase.
| Field | Type |
|---|---|
kind |
shape |
label? |
string |
padding? |
Padding |
recipe |
string |
params? |
map of number |
PolylineNode
Section titled “PolylineNode”A line through points, in the 0 to 1 space of its frame. Extends NodeBase.
| Field | Type |
|---|---|
kind |
polyline |
label? |
string |
padding? |
Padding |
points |
Point[] |
bends? |
PolylineBend[] |
params? |
PolylineParams |
PolylineParams
Section titled “PolylineParams”A polyline’s own settings.
| Field | Type |
|---|---|
closed? |
boolean |
smooth? |
boolean |
PolylineBend
Section titled “PolylineBend”A segment of a polyline that runs as a curve.
| Field | Type |
|---|---|
segment |
number |
control |
Point |
second? |
Point |
HullNode
Section titled “HullNode”A border drawn round the nodes that name it as their parent. Extends NodeBase.
| Field | Type | Notes |
|---|---|---|
kind |
hull |
|
label? |
string | |
padding? |
Padding | |
shape? |
perimeter box |
|
inset? |
integer | At least 0 |
points? |
Point[] | |
group? |
string |
NoteNode
Section titled “NoteNode”Free text. Extends NodeBase.
| Field | Type |
|---|---|
kind |
note |
padding? |
Padding |
label |
string |
ViewNode
Section titled “ViewNode”A window onto a child view. Extends NodeBase.
| Field | Type |
|---|---|
kind |
view |
label? |
string |
scene |
string |
link? |
ViewLink |
frame? |
Bounds |
ViewLink
Section titled “ViewLink”How a view node shows what it links to.
| Field | Type |
|---|---|
contents? |
boolean |
InstanceNode
Section titled “InstanceNode”A composite object placed in a scene. Extends NodeBase.
| Field | Type |
|---|---|
kind |
instance |
composite |
string |
fit? |
InstanceFit |
frame? |
Bounds |
hull? |
perimeter box |
hullInset? |
number |
PathNode
Section titled “PathNode”A vector shape from SVG path data. Extends NodeBase.
| Field | Type |
|---|---|
kind |
path |
d |
string |
viewBox |
Bounds |
GeneratorNode
Section titled “GeneratorNode”A node whose content a generator computes. Extends NodeBase.
| Field | Type |
|---|---|
kind |
generator |
generator |
string |
params? |
map of unknown |
seed? |
number |
DiagramNode
Section titled “DiagramNode”A shape of a laid-out diagram. Extends NodeBase.
| Field | Type |
|---|---|
kind |
diagram |
label? |
string |
element |
DiagramShape |
heading? |
DiagramHeading |
DiagramHeading
Section titled “DiagramHeading”Where a diagram shape’s heading sits.
| Field | Type |
|---|---|
id |
string |
x |
number |
y |
number |
w? |
number |
color? |
Color |
weight? |
Weight |
DiagramShape
Section titled “DiagramShape”The diagram shapes a diagram node can hold.
One of Shape.Box, Shape.Circle, Shape.Text, Shape.Portal.
BuiltinNode
Section titled “BuiltinNode”Any node kind this package defines.
One of RectNode, EllipseNode, CloudNode, PolygonNode, ShapeNode, PolylineNode, HullNode, NoteNode, ViewNode, InstanceNode, PathNode, GeneratorNode, DiagramNode.
An attachment point on a node, as a fraction of its frame.
| Field | Type |
|---|---|
id |
string |
x |
number |
y |
number |
side? |
Side |
accepts? |
PortDirection |
Padding
Section titled “Padding”Space between a shape’s frame and its text.
| Field | Type |
|---|---|
x? |
number |
y? |
number |
A link is the typed form of a 2D element that joins two ends.
A link between two ends.
| Field | Type |
|---|---|
kind |
link |
id |
string |
z |
string |
locked? |
boolean |
source |
Endpoint |
target |
Endpoint |
path? |
line ortho curve spline smart |
points? |
Point[] |
tail? |
arrow circle diamond diamond-filled crowsfoot triangle |
head? |
arrow circle diamond diamond-filled crowsfoot triangle |
label? |
string |
layer? |
string |
style? |
string |
overrides? |
LineStyle |
connector? |
DiagramConnector |
constrain? |
PartLayout |
Endpoint
Section titled “Endpoint”A link’s end: on a node, or free at a point.
One of PortEndpoint, PointEndpoint.
PortEndpoint
Section titled “PortEndpoint”A link end on a node.
| Field | Type |
|---|---|
node |
string |
port? |
string |
PointEndpoint
Section titled “PointEndpoint”A free link end at a point.
| Field | Type |
|---|---|
point |
Point |
DiagramConnector
Section titled “DiagramConnector”A link drawn as a diagram connector.
| Field | Type |
|---|---|
relation? |
Shape.Relation |
head? |
Shape.ArrowHead |
tail? |
Shape.ArrowTail |
stroke? |
Stroke |
color? |
Color |
route? |
Point[] |
caption? |
DiagramCaption |
DiagramCaption
Section titled “DiagramCaption”Where a diagram connector’s caption sits.
| Field | Type |
|---|---|
x |
number |
y |
number |
w? |
number |
color? |
Color |
weight? |
Weight |
Styles
Section titled “Styles”A style is the look an element takes, by name or as its own overrides.
LineStyle
Section titled “LineStyle”A link’s style.
| Field | Type |
|---|---|
color? |
string |
stroke? |
Stroke |
fontSize? |
number |
Style2D
Section titled “Style2D”A 2D look: what a node draws with. Extends LineStyle.
| Field | Type | Notes |
|---|---|---|
opacity? |
number | 0 to 1 |
fill? |
Fill | |
corners? |
Corners | |
weight? |
Weight | |
guide? |
boolean | |
font? |
Font | |
textColor? |
string | |
align? |
Align | |
valign? |
VerticalAlign |
Style3D
Section titled “Style3D”A 3D look: a material over a colour.
| Field | Type |
|---|---|
color? |
string |
fill? |
Fill |
stroke? |
Stroke |
corners? |
Corners |
opacity? |
number |
metalness? |
number |
roughness? |
number |
emissive? |
number |
NamedStyle2D
Section titled “NamedStyle2D”A model’s named 2D style. Extends Style2D.
| Field | Type |
|---|---|
name? |
string |
NamedStyle3D
Section titled “NamedStyle3D”A model’s named 3D style. Extends Style3D.
| Field | Type |
|---|---|
name? |
string |
StyleClass
Section titled “StyleClass”A named look that nodes and links take their style from.
| Field | Type |
|---|---|
id |
string |
name |
string |
style? |
Style2D |
StyleCatalog
Section titled “StyleCatalog”A reusable set of styles, as an ECHO object. ECHO type org.dxos.type.scene.styleCatalog, version 0.2.0.
| Field | Type |
|---|---|
key |
string |
name |
string |
dim |
2d 3d |
styles |
map of CatalogStyle |
id |
string |
CatalogStyle
Section titled “CatalogStyle”One style of a catalog: the 2D and 3D fields in one struct.
| Field | Type | Notes |
|---|---|---|
color? |
string | |
fill? |
Fill | |
stroke? |
Stroke | |
corners? |
Corners | |
opacity? |
number | 0 to 1 |
metalness? |
number | |
roughness? |
number | |
emissive? |
number | |
weight? |
Weight | |
guide? |
boolean | |
font? |
Font | |
fontSize? |
number | |
textColor? |
string | |
align? |
Align | |
valign? |
VerticalAlign |
A theme fills the slots a style names: its colours and its typefaces.
ThemeSlots
Section titled “ThemeSlots”The colours and typefaces a theme defines, by name.
| Field | Type |
|---|---|
colors? |
map of Color |
fonts? |
map of string |
A typeface slot of the theme: body, mono, or one the theme defines.
Type: string.
Vocabulary
Section titled “Vocabulary”The geometry and the style values that every part of a drawing states in the same words.
A colour: a theme name (blue, accent), a name at a tone (blue/2), or a CSS literal (#1e90ff).
Type: string.
A point.
| Field | Type |
|---|---|
x |
number |
y |
number |
A size.
| Field | Type |
|---|---|
width |
number |
height |
number |
Bounds
Section titled “Bounds”A rectangle by its top-left corner and size.
| Field | Type |
|---|---|
x |
number |
y |
number |
width |
number |
height |
number |
Diagram shapes
Section titled “Diagram shapes”A diagram shape is a primitive of the diagram DSL, stored inside a diagram node.
ShapeBase
Section titled “ShapeBase”The id and style fields every diagram shape shares.
| Field | Type | Notes |
|---|---|---|
id |
string | Stable element id, unique within the object (e.g. “left-eye”) |
color? |
Color | Stroke/text color |
fill? |
Fill | Interior fill of closed shapes |
stroke? |
Stroke | Line or outline |
weight? |
Weight | Stroke weight / text size |
align? |
Align | Where the shape’s text sits across it |
valign? |
VerticalAlign | Where the shape’s text sits down it |
fontSize? |
number | Text size in scene units |
Shape.Box
Section titled “Shape.Box”A closed shape in a bounding box. Extends ShapeBase.
| Field | Type | Notes |
|---|---|---|
kind |
Shape.BoxKind | |
x |
number | Left edge (object-local units) |
y |
number | Top edge (object-local units) |
w |
number | |
h |
number | |
rotation? |
number | Clockwise rotation in degrees |
text? |
string | Centered label |
corners? |
Corners | Rects only |
component? |
string | A contributed element kind’s name |
data? |
map of any | A contributed kind’s own fields |
cols? |
number or string | Column tracks |
rows? |
number or string | Row tracks |
gap? |
number | Space between two cells |
padding? |
number | Space inside the grid’s frame |
autoCols? |
number or string | Size of each implicit column track |
autoRows? |
number or string | Size of each implicit row track |
justifyContent? |
Shape.Place | Where the columns sit across the frame |
alignContent? |
Shape.Place | Where the rows sit down the frame |
layout? |
Shape.Layout | How the box places its children |
packSeed? |
number | A packing’s seed |
packMin? |
number | Smallest packed child |
packMax? |
number | Largest packed child |
parent? |
string | The grid that places this box |
width? |
number | Width the box keeps inside its grid cell |
height? |
number | Height the box keeps inside its grid cell |
Shape.Circle
Section titled “Shape.Circle”A circle. Extends ShapeBase.
| Field | Type | Notes |
|---|---|---|
kind |
circle |
|
cx |
number | Center x (object-local units) |
cy |
number | Center y (object-local units) |
r |
number | |
text? |
string |
Shape.Polyline
Section titled “Shape.Polyline”A straight segment or a polyline. Extends ShapeBase.
| Field | Type | Notes |
|---|---|---|
kind |
line |
|
points |
Point[] | Two or more points (object-local units) |
closed? |
boolean | Close the path back to the first point |
guide? |
boolean | A guide (lifeline, divider, outline) rather than a connector |
Shape.Curve
Section titled “Shape.Curve”A smooth curve through points. Extends ShapeBase.
| Field | Type | Notes |
|---|---|---|
kind |
curve |
|
points |
Point[] | Control points the curve passes through |
Shape.Arc
Section titled “Shape.Arc”A circular arc. Angles are in degrees. Extends ShapeBase.
| Field | Type |
|---|---|
kind |
arc |
cx |
number |
cy |
number |
r |
number |
startAngle |
number |
endAngle |
number |
Shape.Text
Section titled “Shape.Text”Free-standing text. Extends ShapeBase.
| Field | Type | Notes |
|---|---|---|
kind |
text |
|
x |
number | |
y |
number | |
w? |
number | Wrap width |
text |
string |
Shape.Arrow
Section titled “Shape.Arrow”A connector between two elements or points. Extends ShapeBase.
| Field | Type | Notes |
|---|---|---|
kind |
arrow |
|
from? |
string | Source element ref, optionally #port |
to? |
string | Target element ref, optionally #port |
start? |
Point | Explicit start (used when from is omitted) |
end? |
Point | Explicit end (used when to is omitted) |
text? |
string | Label at the arrow midpoint |
head? |
Shape.ArrowHead | Marker at the target end (default arrow) |
tail? |
Shape.ArrowTail | Marker at the source end (default none) |
route? |
Point[] | The connector’s route, ends included |
path? |
Shape.Path | How the connector runs between its ends (default smart) |
relation? |
Shape.Relation | What the connector means |
Shape.Portal
Section titled “Shape.Portal”A window onto another drawing. Extends ShapeBase.
| Field | Type | Notes |
|---|---|---|
kind |
portal |
|
x |
number | Left edge (object-local units) |
y |
number | Top edge (object-local units) |
w |
number | |
h |
number | |
ref |
string | The drawing shown inside the box |
text? |
string | Title shown on the frame |
Shape.Element
Section titled “Shape.Element”Any diagram shape.
One of Shape.Box, Shape.Circle, Shape.Polyline, Shape.Curve, Shape.Arc, Shape.Text, Shape.Arrow, Shape.Portal.
Each enum is a set of literal values.
| Name | Values |
|---|---|
Scene.LayoutKind |
view composite |
Scene.Placement |
right-of left-of above below aligned |
PartConstraint |
min max stretch center scale |
InstanceFit |
fit fill none |
Scene.Dimension |
2d 3d |
PortDirection |
in out any |
LinkPath |
line ortho curve spline smart |
Marker |
arrow circle diamond diamond-filled crowsfoot triangle |
StyleHue |
neutral red orange amber green teal sky blue violet |
NodeTone |
0 1 2 3 |
TextTone |
1 2 3 |
Side |
top right bottom left |
Stroke |
none solid dashed dotted sketchy |
Fill |
none solid tint pattern glass |
Corners |
all top bottom none |
Weight |
s m l xl |
Align |
left center right |
VerticalAlign |
top middle bottom |
Shape.BoxKind |
rect ellipse diamond triangle grid |
Shape.Layout |
tracks pack |
Shape.Place |
start center end |
Shape.Path |
smart ortho line curve |
Shape.ArrowHead |
arrow triangle crowsfoot none |
Shape.ArrowTail |
none circle arrow |
Shape.Relation |
association dependency inheritance implementation composition aggregation one-to-many many-to-many |
Other kinds
Section titled “Other kinds”These element kinds have no schema in @dxos/scene. An element of one carries the base fields, and the package
named draws it and defines any fields of its own.
| Kind | Dimension | Package |
|---|---|---|
link |
2D and 3D | @dxos/react-ui-canvas |
label |
2D and 3D | @dxos/react-ui-canvas |
group |
2D and 3D | @dxos/react-ui-canvas |
card |
2D | @dxos/react-ui-canvas |
icon |
2D | @dxos/react-ui-canvas |
solid |
2D and 3D | @dxos/react-ui-canvas |
image |
2D | @dxos/plugin-canvas |
graph |
2D | @dxos/plugin-canvas |
cube |
3D | @dxos/react-ui-canvas |
sphere |
3D | @dxos/react-ui-canvas |
cylinder |
3D | @dxos/react-ui-canvas |
cone |
3D | @dxos/react-ui-canvas |
pyramid |
3D | @dxos/react-ui-canvas |
mesh |
3D | @dxos/react-ui-canvas |
score |
3D | @dxos/react-ui-canvas |
edge |
3D | @dxos/react-ui-canvas |
face |
3D | @dxos/react-ui-canvas |