Skip to main content
Version: v2.1.0

VegaComponentConfig

Defined in: parser/types.ts:837

The VegaComponentConfig interface is used to define the properties of a Vega Component. This component is used to render a Vega/Vega-Lite Component by adding Vega/Vega-Lite specs within the reVISit config itself.

To do this, would use the following snippet:

{
"type": "vega",
"config": { ... vega specs here ...},
}

IIf you are using Vega, you can use signals with `revisitAnswer` to send the user's responses back to the reVISit. For example, you can use the following snippet in your Vega spec's signals section:
```js
{
"signals": [
{
"name": "revisitAnswer",
"value": {},
"on": [
{
"events": "rect:click",
"update": "{responseId: 'vegaDemoResponse1', response: datum.category}"
}
]
}
]
}
In this example, when a user clicks on a rectangle in the Vega chart, the `revisitAnswer` signal is updated with the responseId and response.

Extends

Properties

PropertyTypeDescriptionInherited fromDefined in
allowFailedTraining?booleanControls whether the component should allow failed training. If not provided, the default is true.BaseIndividualComponent.allowFailedTrainingparser/types.ts:576
configobjectThe vega or vega-lite configuration.-parser/types.ts:840
correctAnswer?Answer[]The correct answer to the component. This is used for training trials where the user is shown the correct answer after a guess.BaseIndividualComponent.correctAnswerparser/types.ts:570
description?stringThe description of the component. This is used to identify and provide additional information for the component in the admin panel.BaseIndividualComponent.descriptionparser/types.ts:580
helpTextPathOverride?stringOptional override for the help text. If present, will override the default help text path set in the uiConfig.BaseIndividualComponent.helpTextPathOverrideparser/types.ts:592
instruction?stringThe instruction of the component. This is used to identify and provide additional information for the component in the admin panel.BaseIndividualComponent.instructionparser/types.ts:582
instructionLocation?ConfigResponseBlockLocationThe location of the instructions.BaseIndividualComponent.instructionLocationparser/types.ts:568
meta?Record<string, unknown>The meta data for the component. This is used to identify and provide additional information for the component in the admin panel.BaseIndividualComponent.metaparser/types.ts:578
nextButtonDisableTime?numberA timeout (in ms) after which the next button will be disabled.BaseIndividualComponent.nextButtonDisableTimeparser/types.ts:586
nextButtonEnableTime?numberA timer (in ms) after which the next button will be enabled.BaseIndividualComponent.nextButtonEnableTimeparser/types.ts:588
nextButtonLocation?ConfigResponseBlockLocationThe location of the next button.BaseIndividualComponent.nextButtonLocationparser/types.ts:566
nextButtonText?stringThe text that is displayed on the next button.BaseIndividualComponent.nextButtonTextparser/types.ts:564
provideFeedback?booleanControls whether the component should provide feedback to the participant, such as in a training trial. If not provided, the default is false.BaseIndividualComponent.provideFeedbackparser/types.ts:572
recordAudio?booleanWhether or not to record audio for a component. Only relevant if recordStudyAudio in the uiConfig is true. Defaults to false.BaseIndividualComponent.recordAudioparser/types.ts:584
responseResponse[]The responses to the componentBaseIndividualComponent.responseparser/types.ts:560
responseDividers?booleanWhether to show the response dividers. Defaults to false.BaseIndividualComponent.responseDividersparser/types.ts:590
trainingAttempts?numberThe number of training attempts allowed for the component. The next button will be disabled until either the correct answer is given or the number of attempts is reached. When the number of attempts is reached, if the answer is incorrect still, the correct value will be shown to the participant. The default value is 2. Providing a value of -1 will allow infinite attempts and the participant must enter the correct answer to continue, and reVISit will not show the correct answer to the user.BaseIndividualComponent.trainingAttemptsparser/types.ts:574
type"vega"--parser/types.ts:838