Skip to content

Commit 9641907

Browse files
committed
Test updates
1 parent b102a61 commit 9641907

File tree

1 file changed

+26
-12
lines changed

1 file changed

+26
-12
lines changed

test/notebooks/Interact Manual Tests.ipynb

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,10 @@
4141
"outputs": [],
4242
"source": [
4343
"#Dependent sliders\n",
44-
"# first and second numbers (signal(first_slider) and sval) should update if you move the sin slider (before moving x)\n",
45-
"# but shouldn't update after you move the x slider\n",
46-
"# second two (sval and cval) should update always\n",
44+
"# move the sin slider (before moving x): the first number below the widgets (signal(first_slider)) \n",
45+
"# should update, but should stop after you move the x slider\n",
46+
"# second and third (sval and cval) should update if x is moved, and if sin or cos slider is moved respectively\n",
47+
"# moving the x should also move the sliders\n",
4748
"\n",
4849
"x = slider(0:.1:2pi, label=\"x\")\n",
4950
"s = map(a -> slider(-1:.05:1, value=sin(2a), label=\"sin(2x)\"), signal(x))\n",
@@ -247,7 +248,7 @@
247248
},
248249
"outputs": [],
249250
"source": [
250-
"# Same but vertical selection_slider, Float64 checkbox, shared signal, and textbox value set.\n",
251+
"# Same but vertical selection_slider, Float64 textbox, shared signal, and textbox value set.\n",
251252
"# Value should be the value from the textbox, changes in slider should update the textbox and vice-versa \n",
252253
"\n",
253254
"expslide = selection_slider(2.^(1:0.01:10), label=\"exponential value\"; orientation=\"vertical\")\n",
@@ -281,6 +282,7 @@
281282
},
282283
"outputs": [],
283284
"source": [
285+
"#single select\n",
284286
"ss = selection(11:20)\n",
285287
"display.([ss,signal(ss)]);"
286288
]
@@ -423,10 +425,10 @@
423425
},
424426
"outputs": [],
425427
"source": [
426-
"#layout\n",
428+
"#layout hbox vbox\n",
427429
"cb = checkbox();\n",
428430
"s1 = slider(1:10; orientation=\"vertical\"); \n",
429-
"s2 = slider(11:0.1:20; orientation=\"vertical\"); \n",
431+
"s2 = vslider(11:0.1:20; label=\"s2\"); \n",
430432
"layout = hbox(vbox(s1,cb), s2)\n",
431433
"display.([layout, map(signal, (cb,s1,s2))...]);"
432434
]
@@ -435,12 +437,12 @@
435437
"cell_type": "code",
436438
"execution_count": null,
437439
"metadata": {
438-
"collapsed": true
440+
"collapsed": false
439441
},
440442
"outputs": [],
441443
"source": [
442444
"#hbox, vbox as values of a signal{Widget} 1\n",
443-
"\n",
445+
"# Sets of togglebuttons should appear on one row, as you move the slider\n",
444446
"n = selection_slider(1:4)\n",
445447
"s1 = map(nv->hbox(map(nvi->togglebuttons(nvi+10:nvi+13), 1:nv)...), signal(n))\n",
446448
"display.([n, s1]);"
@@ -450,11 +452,12 @@
450452
"cell_type": "code",
451453
"execution_count": null,
452454
"metadata": {
453-
"collapsed": true
455+
"collapsed": false
454456
},
455457
"outputs": [],
456458
"source": [
457-
"#hbox, vbox as values of a signal{Widget} 1, orientation should change from horizontal to vertical\n",
459+
"# hbox, vbox as values of a signal{Widget} 1, orientation should change from horizontal to\n",
460+
"# vertical as you move the slider\n",
458461
"\n",
459462
"s2 = map(nv->(boxer = nv%2 == 0 ? hbox : vbox; boxer(togglebuttons(nv:nv+3), togglebuttons(nv:nv+3))), signal(n))\n",
460463
"display.([n, s2]);"
@@ -484,6 +487,7 @@
484487
},
485488
"outputs": [],
486489
"source": [
490+
"# test the set! function, bottom slider should have the range defined by the top 3 sliders\n",
487491
"sldmin = slider(0:.01:10.0, label=\"min value\")\n",
488492
"sldstep = slider(0.01:.01:1, label=\"step size\")\n",
489493
"sldmax = slider(10.0:.1:20.0, label=\"max value\")\n",
@@ -497,11 +501,12 @@
497501
"cell_type": "code",
498502
"execution_count": null,
499503
"metadata": {
500-
"collapsed": true
504+
"collapsed": false
501505
},
502506
"outputs": [],
503507
"source": [
504-
"#latex output, should be replaced and formatted nicely\n",
508+
"#latex output, should be replaced and formatted nicely as you ramp up the slider\n",
509+
"using SymPy\n",
505510
"x=Sym(\"x\")\n",
506511
"s = @manipulate for n=vslider(1:50)\n",
507512
" SymPy.diff(sin(x^2),x,n)\n",
@@ -534,6 +539,15 @@
534539
"display(s5)\n",
535540
"foreach(v ->(@show v), signal(s5));"
536541
]
542+
},
543+
{
544+
"cell_type": "code",
545+
"execution_count": null,
546+
"metadata": {
547+
"collapsed": true
548+
},
549+
"outputs": [],
550+
"source": []
537551
}
538552
],
539553
"metadata": {

0 commit comments

Comments
 (0)