-
Notifications
You must be signed in to change notification settings - Fork 19
protocol.json
forms = [];
Forms map variables defined in the registry to components. For example, a text variable might be mapped to an input component, and a categorical variable could be mapped to a toggle box, or a checkbox.
data = {};
The data key holds external data to be used within the app. Essentially, it functions as a data repository for things outside of the interview that might nevertheless be brought into it. Examples of how this data might be brought into an interview are through node creation (a roster network is included in the data key, and the user selects a node from this network on a roster interface), or by displaying the data on a specific interface (for example displaying census tract data stored in the data key on a map interface).
Eventually we intend for it to be possible to have the data itself located elsewhere, with the data key merely containing a URI 'pointer' that can be resolved to access (or create) the data. This system would allow data to be dynamically loaded and created by other systems in response to iterview variables. For example, a previous network could be downloaded and displayed in a side panel on a name generator, based on a participant ID.
variableRegistry.node[NODE_TYPE].displayVariable;
Used to tell network canvas which variable to use for the visual representation of the node. Should default to the first variable of type 'text' if not provided.
forms[NODE_TYPE] = { /* form definition */ };
By default, an interface will look for a form with the same name as the object type.
forms[NODE_TYPE].fields[].variable = 'firstName';
These variables are assumed to be children of the object type that is being created.
forms[NODE_TYPE].fields[].value = "return new Date().toString();";
This is intended as an example of a hidden field that has a value set when the form is shown. Will this work?
stages[].prompts[].filter = "return operator.or([\nselect.edge({ type: 'friend' }),\nselect.alter({ type: 'person', attribute: 'age', operator: 'GREATER_THAN', value: 29 })]);",
filter nodes by these criteria.
stages[].prompts[].disabled = "return operator.or([\nselect.edge({ type: 'friend' }),\nselect.alter({ type: 'person', attribute: 'age', operator: 'LESS_THAN', value: 29 })]);",
put nodes matched here into the disabled state.