generateClickEvent(
    eventType,
    event,
    pointer,
    oldSelection,
    emptySelection = false
  ) {
    const properties = this._initBaseEvent(event, pointer);

    if (emptySelection === true) {
      properties.nodes = [];
      properties.edges = [];
    } else {
      const tmp = this.getSelection();
      properties.nodes = tmp.nodes;
      properties.edges = tmp.edges;
    }

    if (oldSelection !== undefined) {
      properties["previousSelection"] = oldSelection;
    }

    if (eventType == "click") {
      // For the time being, restrict this functionality to
      // just the click event.
      properties.items = this.getClickedItems(pointer);
    }

    if (event.controlEdge !== undefined) {
      properties.controlEdge = event.controlEdge;
    }

    this.body.emitter.emit(eventType, properties);
  }
Generate an event which the user can catch.

This adds some extra data to the event with respect to cursor position and
selected nodes and edges.
@param {string} eventType                          Name of event to send
@param {Event}  event
@param {{x: number, y: number}} pointer            Object with the x and y screen coordinates of the mouse
@param {object | undefined} oldSelection             If present, selection state before event occured
@param {boolean|undefined} [emptySelection]  Indicate if selection data should be passed