|
41 | 41 | "outputs": [],
|
42 | 42 | "source": [
|
43 | 43 | "#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", |
47 | 48 | "\n",
|
48 | 49 | "x = slider(0:.1:2pi, label=\"x\")\n",
|
49 | 50 | "s = map(a -> slider(-1:.05:1, value=sin(2a), label=\"sin(2x)\"), signal(x))\n",
|
|
247 | 248 | },
|
248 | 249 | "outputs": [],
|
249 | 250 | "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", |
251 | 252 | "# Value should be the value from the textbox, changes in slider should update the textbox and vice-versa \n",
|
252 | 253 | "\n",
|
253 | 254 | "expslide = selection_slider(2.^(1:0.01:10), label=\"exponential value\"; orientation=\"vertical\")\n",
|
|
281 | 282 | },
|
282 | 283 | "outputs": [],
|
283 | 284 | "source": [
|
| 285 | + "#single select\n", |
284 | 286 | "ss = selection(11:20)\n",
|
285 | 287 | "display.([ss,signal(ss)]);"
|
286 | 288 | ]
|
|
423 | 425 | },
|
424 | 426 | "outputs": [],
|
425 | 427 | "source": [
|
426 |
| - "#layout\n", |
| 428 | + "#layout hbox vbox\n", |
427 | 429 | "cb = checkbox();\n",
|
428 | 430 | "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", |
430 | 432 | "layout = hbox(vbox(s1,cb), s2)\n",
|
431 | 433 | "display.([layout, map(signal, (cb,s1,s2))...]);"
|
432 | 434 | ]
|
|
435 | 437 | "cell_type": "code",
|
436 | 438 | "execution_count": null,
|
437 | 439 | "metadata": {
|
438 |
| - "collapsed": true |
| 440 | + "collapsed": false |
439 | 441 | },
|
440 | 442 | "outputs": [],
|
441 | 443 | "source": [
|
442 | 444 | "#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", |
444 | 446 | "n = selection_slider(1:4)\n",
|
445 | 447 | "s1 = map(nv->hbox(map(nvi->togglebuttons(nvi+10:nvi+13), 1:nv)...), signal(n))\n",
|
446 | 448 | "display.([n, s1]);"
|
|
450 | 452 | "cell_type": "code",
|
451 | 453 | "execution_count": null,
|
452 | 454 | "metadata": {
|
453 |
| - "collapsed": true |
| 455 | + "collapsed": false |
454 | 456 | },
|
455 | 457 | "outputs": [],
|
456 | 458 | "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", |
458 | 461 | "\n",
|
459 | 462 | "s2 = map(nv->(boxer = nv%2 == 0 ? hbox : vbox; boxer(togglebuttons(nv:nv+3), togglebuttons(nv:nv+3))), signal(n))\n",
|
460 | 463 | "display.([n, s2]);"
|
|
484 | 487 | },
|
485 | 488 | "outputs": [],
|
486 | 489 | "source": [
|
| 490 | + "# test the set! function, bottom slider should have the range defined by the top 3 sliders\n", |
487 | 491 | "sldmin = slider(0:.01:10.0, label=\"min value\")\n",
|
488 | 492 | "sldstep = slider(0.01:.01:1, label=\"step size\")\n",
|
489 | 493 | "sldmax = slider(10.0:.1:20.0, label=\"max value\")\n",
|
|
497 | 501 | "cell_type": "code",
|
498 | 502 | "execution_count": null,
|
499 | 503 | "metadata": {
|
500 |
| - "collapsed": true |
| 504 | + "collapsed": false |
501 | 505 | },
|
502 | 506 | "outputs": [],
|
503 | 507 | "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", |
505 | 510 | "x=Sym(\"x\")\n",
|
506 | 511 | "s = @manipulate for n=vslider(1:50)\n",
|
507 | 512 | " SymPy.diff(sin(x^2),x,n)\n",
|
|
534 | 539 | "display(s5)\n",
|
535 | 540 | "foreach(v ->(@show v), signal(s5));"
|
536 | 541 | ]
|
| 542 | + }, |
| 543 | + { |
| 544 | + "cell_type": "code", |
| 545 | + "execution_count": null, |
| 546 | + "metadata": { |
| 547 | + "collapsed": true |
| 548 | + }, |
| 549 | + "outputs": [], |
| 550 | + "source": [] |
537 | 551 | }
|
538 | 552 | ],
|
539 | 553 | "metadata": {
|
|
0 commit comments