Callout data
A label with a line that draws out to a point and ends in a dot: for naming something on screen. dx and dy are where the dot lands, in pixels from the label.
Props#
| Prop | Type | Default | Notes |
|---|---|---|---|
| text* | string | ||
| dx | number | -170 | |
| dy | number | 230 | |
| fill | color | overrides the surface's fill | |
| ink | color | "ink" | |
| accent | color | "accent" | |
| radius | number (0 to 200) | overrides the surface's corner |
* required. Every node also takes the common props: id, motion, start, place, scale, rotate, opacity, w, h. A colour is a palette name, never a value.
Parts#
Named parts can be restyled from outside without making a new component: "parts": { "root": { … } }.
| Part | Is a |
|---|---|
| root | box |
| line | shape |
| dot | shape |
| label | box |
| text | text |
Example#
{"el": "Callout", "text": "Founder"}How it is made#
This component is plain data. Its whole definition is the tree below: copy it into a scene's components list under a new name to make your own version. See Custom components.
{
"el": "box",
"dir": "stack",
"w": 10,
"h": 10,
"children": [
{
"el": "shape",
"id": "line",
"kind": "rect",
"w": "=sqrt(dx*dx+dy*dy)",
"h": 6,
"radius": 3,
"fill": "$accent",
"rotate": "=atan2(dy,dx)*180/pi",
"motion": [
{"do": "drive", "pose": {"x": "=dx/2", "y": "=dy/2"}},
{"do": "draw", "delay": 0.1, "curve": "snap"}
]
},
{
"el": "shape",
"id": "dot",
"kind": "circle",
"w": 30,
"fill": "$accent",
"stroke": "white",
"strokeW": 5,
"motion": [
{"do": "drive", "pose": {"x": "$dx", "y": "$dy"}},
{"do": "enter", "from": "shrink", "delay": 0.4, "curve": "bouncy"}
]
},
{
"el": "box",
"id": "label",
"surface": "chip",
"fill": "$fill",
"radius": "$radius",
"motion": [{"do": "enter", "from": "pop", "curve": "punchy"}],
"children": [
{
"el": "text",
"id": "text",
"text": "$text",
"size": 46,
"weight": 700,
"color": "$ink",
"align": "center",
"maxW": 380
}
]
}
]
}