Tooltip Following Mouse

In this example, the tooltip follows the mouse. It demonstrates the behavior of the tooltip at different positions on the screen, especially near the edges. Move your mouse around the black box to test out the behavior!

body {
  background-color: #444;
var tip = new d3plus.Tooltip()
    .data([{title: "Test Tooltip"}])
    .position([window.innerWidth / 2, window.innerHeight / 2])

  window.addEventListener("mousemove", function(e) {
      .position([e.pageX, e.pageY])