message: [examples] Fixes hovered edge coloring in 'events'
diff: @@ -25,8 +25,6 @@ function logEvent(event: string, itemType?: "node" | "edge", item?: string): voi
  item,
  "label",
  )}`;
  -
  - if (event === "enterEdge") graph.setEdgeAttribute(item, "color", "#1E2F97");
  }
  }
  div.innerHTML = `<span>${message}</span>`;
  @@ -36,15 +34,31 @@ function logEvent(event: string, itemType?: "node" | "edge", item?: string): voi
  if (logsDOM.children.length > 50) logsDOM.children[0].remove();
  }
  +let hoveredEdge = null;
  const renderer = new Sigma(graph, container, {
  enableEdgeClickEvents: true,
  enableEdgeWheelEvents: true,
  enableEdgeHoverEvents: "debounce",
  + edgeReducer(edge, data) {
  + const res = { ...data };
  + if (edge === hoveredEdge) res.color = "#cc0000";
  + return res;
  + },
  });
  ["enterNode", "leaveNode", "clickNode", "rightClickNode", "doubleClickNode", "wheelNode"].forEach((eventType) =>
  renderer.on(eventType, ({ node }) => logEvent(eventType, "node", node)),
  );
  -["enterEdge", "leaveEdge", "clickEdge", "rightClickEdge", "doubleClickEdge", "wheelEdge"].forEach((eventType) =>
  +["clickEdge", "rightClickEdge", "doubleClickEdge", "wheelEdge"].forEach((eventType) =>
  renderer.on(eventType, ({ edge }) => logEvent(eventType, "edge", edge)),
  );
  +renderer.on("enterEdge", ({ edge }) => {
  + logEvent("enterEdge", "edge", edge);
  + hoveredEdge = edge;
  + renderer.refresh();
  +});
  +renderer.on("leaveEdge", ({ edge }) => {
  + logEvent("leaveEdge", "edge", edge);
  + hoveredEdge = null;
  + renderer.refresh();
  +});
  