Skip to content

Commit

Permalink
feat: Add larger invisible touch target for nodes in visualization
Browse files Browse the repository at this point in the history
  • Loading branch information
sanity committed Dec 6, 2024
1 parent 267fb9e commit a076d5c
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,12 @@
.attr("transform", (d) => `translate(${d.x},${d.y})`)
.attr("id", (d) => `node-${d.data.id}`);

// Add invisible larger circle for better touch targets
node.append("circle")
.attr("r", params.nodeSize * 1.5) // 50% larger than visible node
.attr("fill", "transparent")
.style("cursor", "pointer");

// Initialize node colors and event handlers
node.each(function (d) {
const nodeGroup = d3.select(this);
Expand Down

0 comments on commit a076d5c

Please sign in to comment.