basket = r.questions().qTitle("Control").baskets()
The basic concepts behind Syrup and it’s parts are as follows:
The Syrup library creates a single entry in the browsers
TaffyDB query objects or
In order to provide both a simple and powerful query facility to the full survey data Syrup makes use of TaffyDB to create query objects at various levels within the main data: questions, baskets and productViews are currently provided.
Everywhere you see a
qObjyou can apply both TaffyDB functions as well as those custom functions provided by Syrup such as
To look at the contents of any
With the exception of few stand alone helper functions the entire library uses chaining syntax (think jQuery). For example, to get the basket contents from a
qObjwe simple do
qObj.baskets()which returns another
qObjcontaining just basket data from the questions detailed in the source
RespondentDatais a class on the
syrupobject and provides the entry point for fetching data from the main ConceptSauce data API.
Once data is loaded you are returned an instance of
RespondentData(usually assigned to the variable
r) which is then used to access and query qObjs on the data.
qObjof available questions data relative to the preceding
qObjis augmented with data from other levels of the original set.
qObjcentered around the
productViewEventssection of the survey data.
productViewshas extra fields to aid working with the data. These fields come from other levels of the original data set.
basketContentssection of data. As with other custom functions in Syrup,
basketsadds extra data points to aid use in queries.
Syrup contains a growing number of filters to refine the content of a
qObj. Where possible these filters are designed so they can be fed data from any level of the original data set (
basketsfor example) and will attempt to produce relavent results.
A growing number of general helper functions exist. For example
timings()which will return a plain
Array of Objectswith all relevant timings from whatever source
qObjwas supplied, some fields maybe blank depending on the source
let result = someQobj.timings() // result is an `Array` of `Objects` with the following fields: // startTime // endTime // duration // questionID // questionTitle // type