message: Add stage events to events example
diff: @@ -13,10 +13,13 @@ const logsDOM = document.getElementById("sigma-logs") as HTMLElement;
  const graph = new Graph();
  graph.import(data);
  -function logEvent(event: string, itemType?: "node" | "edge", item?: string): void {
  +function logEvent(event: string, itemType?: "node" | "edge" | "positions", item?: string | MouseEvent): void {
  const div = document.createElement("div");
  let message = `Event "${event}"`;
  if (item && itemType) {
  + if (itemType === "positions") {
  + message += `, x ${item.x}, y ${item.y}`;
  + } else {
  const label = itemType === "node" ? graph.getNodeAttribute(item, "label") : graph.getEdgeAttribute(item, "label");
  message += `, ${itemType} ${label || "with no label"} (id "${item}")`;
  @@ -27,6 +30,7 @@ function logEvent(event: string, itemType?: "node" | "edge", item?: string): voi
  )}`;
  }
  }
  + }
  div.innerHTML = `<span>${message}</span>`;
  logsDOM.appendChild(div);
  logsDOM.scrollTo({ top: logsDOM.scrollHeight });
  @@ -61,3 +65,24 @@ renderer.on("leaveEdge", ({ edge }) => {
  hoveredEdge = null;
  renderer.refresh();
  });
  +
  +
  +renderer.on("downStage", ({ event }) => {
  + logEvent("downStage", "positions", event);
  +});
  +
  +renderer.on("clickStage", ({ event }) => {
  + logEvent("clickStage", "positions", event);
  +});
  +
  +renderer.on("doubleClickStage", ({ event }) => {
  + logEvent("doubleClickStage", "positions", event);
  +});
  +
  +renderer.on("rightClickStage", ({ event }) => {
  + logEvent("rightClickStage", "positions", event);
  +});
  +
  +renderer.on("wheelStage", ({ event }) => {
  + logEvent("wheelStage", "positions", event);
  +});
  