Skip to content

Grid

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 handles
  • show: array *[metric]: Array with first element as title, second as either string or array

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 handles
  • takeRight: how many images to show from end of the list
  • takeLeft: how many images to show from the start of the list

Dispatch

  • render=dispatch
  • title
  • width
  • trackers: Array of tracker handles
  • match: Date definition - see Date
  • period: Period definition - see Period
  • variant: dispatch | sheet
  • sheet: 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"
                }
            }
        ]
    }
}