From d0c365ae0f96cc9d298e5970515ab41267f9d3f4 Mon Sep 17 00:00:00 2001 From: Matthew Craig Date: Wed, 21 Jun 2017 20:55:32 -0500 Subject: [PATCH 1/2] Add more explanation and demo to description of links --- docs/source/examples/Widget Events.ipynb | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/source/examples/Widget Events.ipynb b/docs/source/examples/Widget Events.ipynb index 08dbd0487a..0efd586947 100644 --- a/docs/source/examples/Widget Events.ipynb +++ b/docs/source/examples/Widget Events.ipynb @@ -571,6 +571,19 @@ "# dl.unlink()" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### The difference between linking in the kernel and linking in the client\n", + "\n", + "Linking in the kernel means linking via python. For one slider to track another, when one slider is adjusted the browser must send a message to the kernel (python in this case), the kernel updates the other slider, which sends a message back to the browser to move the other slider. If the kernel is not running (as in a static web page) then the controls will not be linked.\n", + "\n", + "Linking on the client side means contructing the linnk in Javascript. When one slider is changed, Javascript running in the browser changes the value of the other slider, without communicating with the kernel at all.\n", + "\n", + "To see the difference between the two, go to the [static version of this page in the ipywidgets documentation](http://ipywidgets.readthedocs.io/en/latest/examples/Widget%20Events.html) and try out the sliders near the bottom. The ones linked in the kernel with `link` and `dlink` are no longer linked, but the ones linked in the client with `jslink` and `jsdlink` are still linked." + ] + }, { "cell_type": "markdown", "metadata": { From 5d44db5ccee03b8067b95f44e7fcc6107b83c59a Mon Sep 17 00:00:00 2001 From: Jason Grout Date: Thu, 22 Jun 2017 06:58:51 -0400 Subject: [PATCH 2/2] Tweak wording. --- docs/source/examples/Widget Events.ipynb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/source/examples/Widget Events.ipynb b/docs/source/examples/Widget Events.ipynb index 0efd586947..8d1e96539d 100644 --- a/docs/source/examples/Widget Events.ipynb +++ b/docs/source/examples/Widget Events.ipynb @@ -577,11 +577,11 @@ "source": [ "### The difference between linking in the kernel and linking in the client\n", "\n", - "Linking in the kernel means linking via python. For one slider to track another, when one slider is adjusted the browser must send a message to the kernel (python in this case), the kernel updates the other slider, which sends a message back to the browser to move the other slider. If the kernel is not running (as in a static web page) then the controls will not be linked.\n", + "Linking in the kernel means linking via python. If two sliders are linked in the kernel, when one slider is changed the browser sends a message to the kernel (python in this case) updating the changed slider, the link widget in the kernel then propagates the change to the other slider object in the kernel, and then the other slider's kernel object sends a message to the browser to update the other slider's views in the browser. If the kernel is not running (as in a static web page), then the controls will not be linked.\n", "\n", - "Linking on the client side means contructing the linnk in Javascript. When one slider is changed, Javascript running in the browser changes the value of the other slider, without communicating with the kernel at all.\n", + "Linking using jslink (i.e., on the browser side) means contructing the link in Javascript. When one slider is changed, Javascript running in the browser changes the value of the other slider in the browser, without needing to communicate with the kernel at all. If the sliders are attached to kernel objects, each slider will update their kernel-side objects independently.\n", "\n", - "To see the difference between the two, go to the [static version of this page in the ipywidgets documentation](http://ipywidgets.readthedocs.io/en/latest/examples/Widget%20Events.html) and try out the sliders near the bottom. The ones linked in the kernel with `link` and `dlink` are no longer linked, but the ones linked in the client with `jslink` and `jsdlink` are still linked." + "To see the difference between the two, go to the [static version of this page in the ipywidgets documentation](http://ipywidgets.readthedocs.io/en/latest/examples/Widget%20Events.html) and try out the sliders near the bottom. The ones linked in the kernel with `link` and `dlink` are no longer linked, but the ones linked in the browser with `jslink` and `jsdlink` are still linked." ] }, {