Repository: bokeh/bokeh

Issue:
Restore events for "patch", "stream" and "do"
Previously, `js_on_event` etc. could accept string names of arbitrary Backbone events. This afforded a way for users to add callbacks to CDS `patch` and `stream` events as well as the `do` event when a toolbar button is clicked. When Backbone was removed, this capability was lost, breaking some users' code. Should add three explicit events:
```
Patching
Streaming
Do
```
to `bokeh.events` and have them trigger at the appropriate places on the JS side. 


Discussion:
Here is where the new signals are emited:
```
./models/tools/actions/action_tool.coffee:
    7 :     @model.do.emit()
./models/tools/tool_proxy.coffee:
   16 :       tool.do.emit()
~/work/bokeh/bokehjs/src/coffee mattpap/5518_layout_algorithm
❯ grin patching.emit
./models/sources/column_data_source.coffee:
  148 :     @patching.emit(patched.values)
~/work/bokeh/bokehjs/src/coffee mattpap/5518_layout_algorithm
❯ grin streaming.emit
./models/sources/column_data_source.coffee:
  140 :     @streaming.emit()
```

So, It might suffice to merely add the events with the correct event string and do nothing else? 
Here is the test case a user reported as being broken on new dev builds:
```
import numpy as np
from bokeh.models import CustomJS
from bokeh.models.tools import BoxSelectTool, ResetTool
from bokeh.plotting import figure, show, output_file

N = 500
x, y = np.linspace(0, 10, N), np.linspace(0, 10, N)
xx, yy = np.meshgrid(x, y)
d = np.sin(xx)*np.cos(yy)

def reset_callback():
    return CustomJS(code="""
        console.log("reset_callback called")
    """)

p = figure(x_range=(0, 10), y_range=(0, 10), tools="box_select,reset")
p.image(image=[d], x=0, y=0, dw=10, dh=10, palette="Spectral11")

rst = p.select(ResetTool)[0]
rst.js_on_change('do', reset_callback()) #error here

output_file("foo.html")
show(p)
```

Expect 
```
rst.js_on_change('do', reset_callback()) #error here
```
would need to become something like
```
rst.js_on_change(Do, reset_callback()) #error here
```
so a migration note is probably apt too
There are two problems here. One is initialization order which makes certain signals unusable from `js_on_change()`. Second is that `patch` and `stream` were renamed to `paching` and `streaming` respectively. We need to add aliases and deprecation warnings.

Resolving patch:
diff --git a/bokeh/model.py b/bokeh/model.py
--- a/bokeh/model.py
+++ b/bokeh/model.py
@@ -20,6 +20,7 @@
 from .util.callback_manager import PropertyCallbackManager, EventCallbackManager
 from .util.future import with_metaclass
 from .util.serialization import make_id
+from .util.deprecation import deprecated
 from .events import Event
 
 def collect_models(*input_values):
@@ -377,7 +378,7 @@ def js_on_change(self, event, *callbacks):
 
         .. code:: python
 
-            source.js_on_change('stream', callback)
+            source.js_on_change('streaming', callback)
 
         '''
         if len(callbacks) == 0:
@@ -391,6 +392,15 @@ def js_on_change(self, event, *callbacks):
         if event in self.properties():
             event = "change:%s" % event
 
+        from bokeh.models.sources import ColumnarDataSource
+        if isinstance(self, ColumnarDataSource):
+            if event == 'stream':
+                deprecated((0, 12, 6), "ColumnarDataSource.js_on_change('stream', ...)", "'streaming'")
+                event = 'streaming'
+            elif event == 'patch':
+                event = 'patching'
+                deprecated((0, 12, 6), "ColumnarDataSource.js_on_change('patch', ...)", "'patching'")
+
         if event not in self.js_property_callbacks:
             self.js_property_callbacks[event] = []
         for callback in callbacks:


Test patch: