LineChart data
A smooth line that draws itself through the values, a dot riding its end, the area under it tinted.
Props#
| Prop | Type | Default | Notes |
|---|---|---|---|
| values* | list of number | ||
| w | number (100 to 1060) | 760 | |
| h | number (60 to 1000) | 340 | |
| color | color | "accent" | |
| seconds | number (0.2 to 8) | 1.6 | |
| area | bool | true |
* 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 | shape |
Example#
{"el": "LineChart", "values": [4, 9, 7, 15, 13, 24, 31]}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": "shape",
"kind": "spark",
"values": "$values",
"w": "$w",
"h": "$h",
"stroke": "$color",
"strokeW": 8,
"head": true,
"area": "$area",
"motion": [{"do": "draw", "curve": {"ease": "inOut", "duration": "$seconds"}}]
}