title: Update DataTable on Tap event in Bokeh
body: <p>I am trying to calculate euclidean distance of two points. Initial distance is calculated in the data. </p>
  
  <p>Then, when the user is moving the line, I'd like the <code>distance</code> column to update based on the new coordinates. I can see that <code>x</code> and <code>y</code> columns are updating, but not the <code>distance</code> column. Below is my attempt:</p>
  
  <pre><code>output_file("tools_point_draw.html")
  
  _tools_to_show = 'box_zoom,pan,save,hover,reset,tap'        
  
  p = figure(x_range=(0, 10), y_range=(0, 10), tools=_tools_to_show,
             plot_width=862, plot_height=604,
             title='Plot name')
  
  p.background_fill_color = 'white'
  
  d_true = {'x': [2, 3], 'y': [4, 1], 
            'color': ['red', 'red'],
            'desc': ['true','true']}
  
  df_true = pd.DataFrame(d_true)
  df_true['distance'] = np.sqrt(np.sum((df_true['x'] - df_true['y'])**2))
  source = ColumnDataSource(df_true)
  
  renderer2 = p.scatter(x='x', y='y', source=source, color='color', size=15,
                        line_color='red', line_width=5)
  renderer = p.line(x='x', y='y', source=source, color='red',
                    line_dash='dashed', line_width=10)
  
  columns = [TableColumn(field="x", title="I am X"),
             TableColumn(field="y", title="I am Y"),
             TableColumn(field='color', title='color'),
             TableColumn(field='desc', title='desc'),
             TableColumn(field='distance', title='distance')]
  
  update = CustomJS(args=dict(source_data=source), code="""
      var data = source_data.data;
      var f = cb_obj.value; //is this necessary?
  
      //Sum of squares for euclidean
      for(var i = 0, i &lt; data['x'].length; i &lt; size ; i++) {
          var res += Math.pow(data['x'][i] - data['y'][i], 2)
      }
  
      //Take square root
      var res2 = Math.sqrt(res)
  
      //Update table
      data['distance'] = res2
  
      source_data.change.emit();
  
      """)
  
  update.js_on_change('tap', update)
  
  table = DataTable(source=source, columns=columns, editable=True, height=200, width=862)
  
  draw_tool = PointDrawTool(renderers=[renderer, renderer2], empty_value='black')
  p.add_tools(draw_tool)
  p.toolbar.active_tap = draw_tool
  
  show(Column(p, table))
  </code></pre>