export class Tooltip {
  constructor (id) {
    this.div = document.getElementById(id);
    console.log('id',id)
    console.log('this.div', this.div)
    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.style.position = 'absolute';

    this.div.innerHTML = strHTML;
    this.div.focus();
    console.log('show.div',this.div)
    console.log('this.div.innerHTML',this.div.innerHTML)

  }

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