export class Tooltip {
  constructor (id) {
    this.div = document.getElementById(id);
    if (this.div) {
      document.body.appendChild(this.div);
      this.hide();
    }
  }

  show (x, y, strHTML) {
    if (this.div == null) return;
    this.div.style.display = 'inline-block';
    this.div.style.left = x + 'px';
    this.div.style.top = y + 'px';
    this.div.innerHTML = strHTML;
    this.div.focus();
  }

  hide () {
    if (this.div == null) return;
    this.div.style.display = 'none';
  }
}

