code: function handleDocumentKeyup(e) {
    // Cancel rect if Esc is pressed
    if (e.keyCode === 27) {
      lines = null;
      path.parentNode.removeChild(path);
      document.removeEventListener('mousemove', handleDocumentMousemove);
      document.removeEventListener('mouseup', handleDocumentMouseup);
    }
  }
docs: Handle document.keyup event
  
  @param {Event} e The DOM event to be handled