Description
An advanced "heat map"-like tool. Supports virtually any behavior, from simply recording whether a region was selected to asking followup questions about the selected region.
Instructions
- Lines 56-58 of header 1 must be updated with the image and its dimensions.
- Inside the
$(document).readyevent after theinitializeSvgcall, you must calladdRegionfor each region of the image.addRegionhas these parameters:questionshould always be set to'[% QuestionName() %]'.regionmust define the shape and location of the region. All positions are defined off the top-left corner of the image.rectanglerequirestop,bottom,left, andright.circlerequires center coordinatesxandyand radiusr.ellipserequires center coordinatesxandyand radiirxandry.polygonrequires three or more[x, y]points.
- (optional)
followupsis a list of questions to show if the region is clicked. - (optional)
startwill be called after the region is initialized. Useful for restoring the region if a respondent leaves the question and later returns to it. - (optional)
verificationwill be called when the respondent attempts to submit thefollowups. Should return a Boolean. - (optional)
failwill be called whenverificationreturnsfalse. Useful for explaining what is wrong with the response. - (optional)
passwill be called whenverificationreturnstrue. Useful for making changes to the question or region to reflect the response.
Notes
The rectangle and circle built into the download can serve as an example of how to prompt the respondent, require a response, and update the display accordingly.
The triangle built into the download can serve as an example of how to build an "on-off" region.
If defined, start, verification, fail, and pass will be called with two arguments. The first argument is the clicked region. The second argument is followups.