code: def __init__(self, root_model, link, source_plot, target_plot=None):
      self.root_model = root_model
      self.link = link
      self.source_plot = source_plot
      self.target_plot = target_plot
      self.validate()
  
      references = {
          k: v
          for k, v in link.param.values().items()
          if k not in ("source", "target", "name")
      }
  
      for sh in self.source_handles + [self.source_model]:
          key = f"source_{sh}"
          references[key] = source_plot.handles[sh]
  
      for p, value in link.param.values().items():
          if p in ("name", "source", "target"):
              continue
          references[p] = value
  
      if target_plot is not None:
          for sh in self.target_handles + [self.target_model]:
              key = f"target_{sh}"
              references[key] = target_plot.handles[sh]
  
      if self.source_model in source_plot.handles:
          src_model = source_plot.handles[self.source_model]
          src_cb = CustomJS(args=references, code=self.source_code)
          for ch in self.on_source_changes:
              src_model.js_on_change(ch, src_cb)
          for ev in self.on_source_events:
              src_model.js_on_event(ev, src_cb)
          self.src_cb = src_cb
      else:
          self.src_cb = None
  
      if (
          target_plot is not None
          and self.target_model in target_plot.handles
          and self.target_code
      ):
          tgt_model = target_plot.handles[self.target_model]
          tgt_cb = CustomJS(args=references, code=self.target_code)
          for ch in self.on_target_changes:
              tgt_model.js_on_change(ch, tgt_cb)
          for ev in self.on_target_events:
              tgt_model.js_on_event(ev, tgt_cb)
          self.tgt_cb = tgt_cb
      else:
          self.tgt_cb = None
  
imports: import numpy
  from bokeh.models import CustomJS, Toolbar
  from bokeh.models.tools import RangeTool
  from ...core.util import isscalar
  from ..links import DataLink, Link, RangeToolLink, RectanglesTableLink, SelectionLink, VertexTableLink
  from ..plot import GenericElementPlot, GenericOverlayPlot
label_desc: Use image node_id 1 to create a new LinkCallback object  with example: obj = LinkCallback(root_model, link, source_plot, target_plot)