It's me again. I wonder, if and how I can combine jspsych with snap in a way that allows to render different svgs and present them.
Yours,
Marcel
--
You received this message because you are subscribed to the Google Groups "jsPsych" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jspsych+u...@googlegroups.com.
To post to this group, send email to jsp...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jspsych/7372d0bf-acd9-4f6d-afa2-b5982c197aee%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/jspsych/2493ed3c-8116-463a-bf07-a9ce379df7f1%40googlegroups.com.
Here is a code snippet - showing what I am doing - the dot stays on.
Sorry still taking baby steps with this.
Philip.
var sp = Snap("#svg");
var sp_circ = sp.circle(x_cent,y_cent,5);
var fix_block = {
type: "single-stim",
is_html : true,
timing_response: 500,
timing_post_trial: 0,
stimulus: sp.toString()
};
timeline.push(fix_block);
var s = Snap("#svg");
var dis1_col = [];
dis1_col[0] = colors[0];
for (var jp =1; jp < 4; jp++){
dis1_col[jp] = colors[jp-1];
}
for (var ip=0; ip<n_el; ip++){
var s_circ = s.circle(x_val[ip],y_val[ip],10);
s_circ.attr({
fill: dis1_col[ip]
});
}
var presentation_block = {
type: "single-stim",
is_html : true,
timing_response: 100,
timing_post_trial: 600,
stimulus: s.toString()
};
timeline.push(presentation_block);
supposed to present a small simgle fixation followed by a new display containing four colored dots
Thanks
Philip.
var sp = Snap("#svg");
var sp_circ = sp.circle(x_cent,y_cent,5);
var str = sp.toString();
$('#svg').remove(); // or other method to clear this from the DOMTo view this discussion on the web visit https://groups.google.com/d/msgid/jspsych/7c16e255-e0da-48d5-9ab5-0f826f78532c%40googlegroups.com.
$('#svg').remove();this then appears to remove '#svg' completely and so cant re-use the definition
could you suggest an alternative?
Philip.To view this discussion on the web visit https://groups.google.com/d/msgid/jspsych/9adad595-8942-4f95-9167-b58f81528d45%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jspsych/d7bb222e-993f-4a49-ab0e-79eed42ffe43%40googlegroups.com.