constructor(target, themeManager, options) {
    if (typeof target === 'string' || target instanceof String) {
      this.canvas = document.getElementById(target);
    } else {
      this.canvas = target;
    }

    this.ctx = this.canvas.getContext('2d');
    this.themeManager = themeManager;
    this.opts = options;
    this.drawingWidth = 0.0;
    this.drawingHeight = 0.0;
    this.offsetX = 0.0;
    this.offsetY = 0.0;
    this.fontLarge = this.opts.fontSizeLarge + 'pt Helvetica, Arial, sans-serif';
    this.fontSmall = this.opts.fontSizeSmall + 'pt Helvetica, Arial, sans-serif';
    this.updateSize(this.opts.width, this.opts.height);
    this.ctx.font = this.fontLarge;
    this.hydrogenWidth = this.ctx.measureText('H').width;
    this.halfHydrogenWidth = this.hydrogenWidth / 2.0;
    this.halfBondThickness = this.opts.bondThickness / 2.0; // TODO: Find out why clear was here.
    // this.clear();
  }
The constructor for the class CanvasWrapper.

@param {(String|HTMLElement)} target The canvas id or the canvas HTMLElement.
@param {ThemeManager} themeManager Theme manager for setting proper colors.
@param {Object} options The smiles drawer options object.