function ConnectionPreview(
    injector,
    canvas,
    graphicsFactory,
    elementFactory
) {
  this._canvas = canvas;
  this._graphicsFactory = graphicsFactory;
  this._elementFactory = elementFactory;

  // optional components
  this._connectionDocking = injector.get('connectionDocking', false);
  this._layouter = injector.get('layouter', false);
}
Draws connection preview. Optionally, this can use layouter and connection docking to draw
better looking previews.

@param {Injector} injector
@param {Canvas} canvas
@param {GraphicsFactory} graphicsFactory
@param {ElementFactory} elementFactory