Data
Data source
"dataSources": [
{
"id": "data",
"query": "given trackers[data] from +1 to -12 weeks"
}
]
An array of data queries that resolve when the chart is loaded and the date changed.
id:String
unique identifier within the layoutquery:String
Dispatch query string; $user will be replaced with the id of the currently displayed user if applicable
Data attach
"dataAttach": "..dispatch query.."
"dataAttachList": Data Attach list
A query that returns a single dispatch. The data values of the dispatch will be attached to the shared store and available within the layout. Example usage is with a template, e.g. "My age is {values.age}"
- Data Attach query
query:String
Dispatch query string; $user will be replaced with the id of the currently displayed or context user if applicable
- Data Attach List
- query:
query:String
Dispatch query string; $user will be replaced with the id of the currently displayed or context user if applicable - name:
name:String
name used to access the data in values
- query:
Data Attach List
will place the result under values.
Data Attach
will place the result under values.
Attachment attach
"attributeAttach": "..attribute query.."
A query that returns attribute data.
query:String
Attribute query string; $user will be replaced with the id of the currently displayed or context user if applicable
Data source connections
Data source connections have the following attributes:
- source: the data source to pull from
- pick
- apply
- groupBy
- timeSeries
- takeFirst
- takeLast
- precision
- default
- format
- groupedFormat
- condition
- trackerId
- trackerHandle
- empty
- total, vTotal, hTotal
- conditionalBackground
"connect": [
{
"title": "Data elements",
"source": "data",
"pick": "values.height",
"apply": "sum(ls)",
"format": "0,0"
}
]
When calculating the following steps are applied:
trackerId
|trackerHandle
- filters by tracker handle or id (optional)condition
- applies condition and filters anything that is not true (optional)pick
- this grabs value from the individual dispatchesapply
- this computes the list of individual values into a single value; it is passed an array of pick values calledls
Apply
Apply is performed on each entry matching "timeSeries".
Example of timeSeries
{
"timeSeries": "YYYY-MM-DD; YYYY-MM-DD; P1D; day", // would apply to each day
"timeSeries": "YYYY-MM; YYYY-MM; P1M", // would apply to each month
}
In apply it is possible to access a specific value in the list using at
. For example at(ls, 0)
would give the first element, at(ls, -1)
would give the last value.
Connection
An array of connections to a data source to populate a chart or table. The connection resolves to a single value per through a two step process. The pick
attribute is applied to each dispatch resulting in a list of values while apply
is used to turn the list of values into a single value.
Data is grouped based on the grouping or through a time series expression.
When using dataAttach, dataAttachList or attributeAttach the data will be exposed through the template language by using:
- dataAttach:
values.<path to data>
ordispatch.<path to data>
- dataAttachList:
values.<name provided>.$dispatch.values.<path to data>
- attributeAttach:
store.<path>
In the case of dataAttachList other dispatch attributes are available through $dispatch.
Properties
title:String
descriptive title for use in configurationsource:String
Data source identifierpick:String
an expression resolved per dispatch that results in a list of number valuesapply:String
an expression processes the list of values resolved throughpick
wherels
refers to the value listformat:String
format string
Data source segmentation
"timeSeries": "YYYY-MM-DD; MMM-D; P1D"
Time series defines how to group time series data.
Group; Display; Period
Group
a date format string for the groupDisplay
the display title for the groupPeriod
the duration from the start to the end of the group