Looking for (component) code slider v2020.2.10 Py&JS

OS : Win10
PsychoPy version (e.g. 1.84.x): 2020.2.10

Hi all,

Does anyone know if and where I can find code for a (radio) slider in both python and JS? I want to add my slider in a code component, as my slider (made with the slider component) currently looks fine on my desktop but inconsistent and weird online. I thought it might help if I can instead put the slider in a code component and perhaps adjust it there.

Any help is greatly appreciated!

Ideally we’d like to get it so that the Slider looks the same online as offline, so if you could share some details about what specifically is wrong with it then that would be a huge help. Could you take screenshots of it on each platform?

Getting the code is easier said than done - you could get the code to initialise the Slider easily enough, but Slider also inserts some code each frame and each routine so you’d need that too, and to make sure it’s put in the right place via the Code component. This is doable, but is difficult and probably more trouble than it’s worth. You’re probably better off putting some JavaScript in the Each Routine tab to change the properties of the Slider, rather than making it again from scratch. If you share screenshots of each I can try putting something together to line them up for you (and put the same code into the program so this problem doesn’t happen in future!)

I also notice you’re using the last version, we made quite a few changes to Slider in 2021.1.0 so it may be worth updating to see if it’s any better for you, back up your experiment first though as the changes may affect backwards compatibility!

Thank you very much for your help!

I did use the most current version first, but the slider there gave me quite some troubles (online). This is why I went back to the 2020.2.10 version.

After starting this topic I found some posts on issues with label alignment, and I think it is now ‘‘fixed’’ by using Wakefields crib sheet (i.e. making a code_JS section with this at ‘begin experiment’:

thisExp=psychoJS.experiment;
win=psychoJS.window;
event=psychoJS.eventManager;
shuffle = util.shuffle;
Array.prototype.append = [].push;

and this at ‘end routine’ )

experimentInit(); 

I think that fixed the misaligned labels, but now it still looks different (and the marker seems missing):

However, if the experiment looks like this in all browsers, then I do not mind the markerless look that much.

This is what it looks like on my dekstop:

The red dot will not appear online (and the dots are much bigger, as you can see).

The red dot is one a few people have found - it’s something we’re working on (if not already fixed for the next bug fix release). Essentially, it’s a mismatch between what the Slider interprets “color” as - the dot is actually there, it’s just that it’s the same color as the space behind it. If you change the Slider’s “color” to something other than white it should become visible.

The bigger dots are new, so I’ll bring this up with the JS team. Synchronising Sliders between Python and JS is something we’re working on at the moment, so this is really helpful, thanks!

What issues were you having in the new version?

1 Like

Thank you so very much!

My issues in the 2021.1.2 version were/are quite similar:

  • The red part in the (radio) slider seems to have completely disappeared. So when (in the running experiment) I am clicking a ‘radio button’ / circle on the slider, I see no red at all.
  • The size of the dots in the slide (Radio) also do not appear to update when I’m syncing changes on to Pavlovia

Unfortunately, the solution of changing the slider’s color to something other than white (in the builder-slider component) does not appear to work. Is there something else I can do? (2020.2.10)