Grid
Grid
Configurable grid display showing one row per user. See detailed grid documentation
tile
=grid
title
grid
dispatches
: dispatch queryusers
: user query to define the rowsfields
: Array with entry for each columntitle
render
: attributes | metrics | images | dispatchwidth
: column width- additional attributes based on render
Under fields; shows user attributes.
attributes
source
: path to attributetitle
: optional title to display
Under fields; shows dispatch data.
trackers
: handle array to matchshow
:- [metric api name]: Array
- first element: String name
- second element: array | string
- [metric api name]: Array
"show": {
"meatKinds": [
"What kinds of meat", "array"
],
"dairyKinds": [
"What kinds of dairy", "array"
]
}
trackers
: handle array to matchtakeRight
: N, take from the end of the list N entriestakeLeft
: N, take from the start of the list N entriesstyles
: style override
trackers
: handle array to matchmatch
: Date expression to match withperiod
: adjustment to todaycreateTracker
: handle for add entry
"trackers": [
"prescription"
],
"match": "GGGG-WW",
"period": "+1 week",
"createTracker": "prescription"
Render options
{
"tile":"grid",
"grid": {
"dispatches": <dispatch query>,
"users": <user query>,
"fields": [
{
"render": <panel below>,
"title": <title>,
"width": <width in pts>
}
]
}
}
Render Options
Attributes
Attributes can come from user attributes or from the user object. When using the user object refer to the root using $user
.
render
=attributes
title
width
attributes
array- source: path to value
- title: Display title
Metrics
Display metrics from the matched dispatch.
render
=metrics
title
width
trackers
: Array of tracker handlesshow
: array *[metric]: Array with first element as title, second as eitherstring
orarray
Example
{
"title": "Diet",
"render": "metrics",
"width": 120,
"trackers": ["preprogramDiet"],
"show": {
"dairyKinds": ["What kinds of dairy","array"],
"preferences": ["Comments","string"]
}
}
Images
Display images from the matched dispatch.
render
=images
title
width
trackers
: Array of tracker handlestakeRight
: how many images to show from end of the listtakeLeft
: how many images to show from the start of the list
Dispatch
render
=dispatch
title
width
trackers
: Array of tracker handlesmatch
: Date definition - see Dateperiod
: Period definition - see Periodvariant
: dispatch | sheetsheet
: Dispatch sheet object if variant is sheet
Dispatch Sheet
Dispatch sheet allows a grid display with dates across the top and metrics down as rows. Dispatches can be created for each column.
Sheet definition
- count: number
- start: period expression - see Period
- period: period expression - see Period
- align: week | isoWeek | month | year
- metrics: SheetMetric
- match: Date format to match the dispatch list
- write: number array with zero based indices to allow writing
- clone: number array with zero based indices to allow cloning to following period
Sheet metric
- property: which dispatch value
- title
- kind: title | field
- adornment: put label in field
- adornmentPos: start | end
Combined Example
{
"tile": "grid",
"display": {
"span": "12"
},
"grid": {
"dispatches": "given group [players], given trackers[wellness] from today to -6 weeks",
"users": "given group [players]",
"fields": [
{
"title": "Physical",
"render": "attributes",
"width": 120,
"attributes": [
{
"source": "intake.fitness"
},
{
"source": "$user.dob",
"title": "Age"
}
]
},
{
"title": "Diet",
"render": "metrics",
"width": 120,
"trackers": ["preprogramDiet"],
"show": {
"dairyKinds": ["What kinds of dairy","array"],
"preferences": ["Comments","string"]
}
},
{
"title": "3 Photos",
"render": "images",
"width": 120,
"contentWidth": 40,
"trackers": ["preprogramPhotos"]
},
{
"title": "Last week",
"render": "dispatch",
"width": 180,
"trackers": ["wellness"],
"match": "GGGG-WW",
"period": "-1 week"
},
{
"title": "This week",
"render": "dispatch",
"width": 180,
"trackers": ["wellness"],
"match": "GGGG-WW",
"createTracker": "wellness",
"variant": "sheet",
"sheet": {
"metrics": [
{
"kind": "title",
"title": "Stuff"
},
{
"property": "score",
"adornment": "pts"
},
{
"property": "stress"
}
],
"match": "GGGG-WW",
"period": "P1W",
"start": "-P5W",
"align": "isoWeek",
"count": 6,
"write": [4,5],
"clone": [4],
"tracker": "wellness"
}
}
]
}
}