Grid
Description
Configurable grid display showing one row per user. See detailed grid documentation
Attributes
tile=gridtitlegriddispatches: dispatch queryusers: user query to define the rowsfields: [Array of objects]titlerender: attributes | metrics | images | dispatchwidth: column width- Also include an additional attributes based on render option which describe below with each options
Simple Example
{
"tile":"grid",
"grid": {
"dispatches": <dispatch query>,
"users": <user query>,
"fields": [
{
"render": <panel below>,
"title": <title>,
"width": <width in pts>
}
]
}
}
Render Options
Display the data based on user attributes and dispatches values attributes. When using a user attribute use a $user in front of attribute name like $user.mobile it return the mobile number of user.
render=attributeswidth: Container Width in numbersort: asc | desc; for widgets that show mulitple entriestake: how many entries to take from the listmatchcreateTracker: used for adding new entriescontentWidthvariantshowtrackersattributes: [Array]source: path to valuetitle: optional title to displayformatAs: optional title to display
Attributes Example
{
"grid": {
"dispatches": "given tracker[wellness]",
"users": "given group [Test]",
"fields": [
{
"title": "Field Test 1",
"render": "attributes",
"width": 300,
"attributes": [
{
"source": "wellness.sleep",
"title": "Sleep"
},
{
"source": "wellness.expression",
"title": "Expression"
},
{
"source": "$user.dob",
"title": "User Attributes Test"
}
]
}
]
}
}
Display a string list which matched with the dispatches values
render=metricswidth: container Width in numbertrackers: [Array of tracker handles]show: [Objects][metric key Which matched with dispatches values]: [Array]- first element: Title
- second element: Metric Kind. Array | String | boolean
Metric Example
"grid": {
"dispatches": "given tracker[wellness]",
"users": "given group [Test]",
"fields": [
{
"title": "Field Test 1",
"render": "metrics",
"trackers": [
"wellness"
],
"show": {
"sleep": [
"Sleep Ration",
"number"
],
"expression": [
"Expression Ratio",
"number"
]
}
}
]
}
Display images from the matched dispatch.
render=imagestitlewidthtrackers: Array of tracker handlestakeRight: N, take from the end of the list N entriesstyles: style override
Images Example
{
"grid": {
"dispatches": "given tracker[photos]",
"users": "given group [Test]",
"fields": [
{
"title": "Field Test 1",
"render": "images",
"width": 120,
"contentWidth": 50,
"trackers": [
"photos"
]
}
]
}
}
render=dispatchtitle: Provide a Dispatch titlewidthtrackers: [Array] Provide a list of tracker handles for the dispatch filtrationmatch: Provide a valid Date definition - see Dateperiod: Provide a valid Period definition - see Periodvariant: dispatch | sheet. By default, is dispatch.sheet: [Object] Provide if variant is sheetcount: numberstart: period expression - see Periodperiod: period expression - see Periodalign: week | isoWeek | month | year. By default, is isoWeekmetrics: [Array of Object]property: Provide a valid Dispatch values attribute which matches with dispatch values.titlekind: title | field.adornment: Provide a label for the text FieldsadornmentPos: start | end. Start Input position of textField
tracker: Provide a tracker handle for dispatch filtrationmatch: Provide a valid time expression to match with dispatch data for e.g. YYYY-MM-DDwrite: [Array of Numbers] Provide a text field index to write the dataclone: [Array of Numbers] Provide a text field index to clone the data
createTracker: Provide a tracker handle for data creation if have not matching dispatches.
Example1
{
"grid": {
"dispatches": "given tracker[wellness]",
"users": "given group [Test]",
"fields": [
{
"title": "Field Test 1",
"render": "dispatch",
"width": 120,
"trackers": [
"wellness"
],
"variant: "dispatch",
"match": "YYYY-MM-DD",
"createTracker": "wellness"
}
]
}
}
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.
Example2
{
"grid": {
"dispatches": "given tracker[wellness]",
"users": "given group [Test]",
"fields": [
{
"title": "Field Test 1",
"render": "dispatch",
"width": 120,
"trackers": [
"wellness"
],
"variant": "sheet",
"sheet": {
"count": 5,
"tracker": "wellness",
"match": "YYYY-MM-DD",
"align": "year",
"clone": [1,3,5],
"write": [2,4],
"metrics": [
{
"property": "sleep",
"title": "Property 1",
"kind": "title"
},
{
"property": "sleep",
"title": "Property 1",
"kind": "value",
"adornment": "Hello Test Label",
"adornmentPos": "start"
}
]
},
"match": "YYYY-MM-DD",
"createTracker": "wellness"
}
]
}
}
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"
}
}
]
}
}