Politur: nodePointerAreaPaint fuer pixelgenaues Hovern und Klicken im Graphen implementiert
This commit is contained in:
@@ -154,9 +154,15 @@ export function GraphView({ data, selectedNodeId, onNodeSelect }: {
|
||||
backgroundColor="rgba(0,0,0,0)"
|
||||
cooldownTicks={120}
|
||||
|
||||
// Hit-Detection an die gezeichnete Knotengröße anpassen
|
||||
nodeVal={(node: any) => {
|
||||
return 6 + Math.min(degree[node.id] || 0, 15) * 0.8
|
||||
// Exakte Hit-Map auf unsichtbarem Canvas zeichnen für 100% zuverlässiges Hovern und Klicken
|
||||
nodePointerAreaPaint={(node: any, color: string, ctx: CanvasRenderingContext2D) => {
|
||||
const x = node.x ?? 0
|
||||
const y = node.y ?? 0
|
||||
const size = 6 + Math.min(degree[node.id] || 0, 15) * 0.8
|
||||
ctx.fillStyle = color
|
||||
ctx.beginPath()
|
||||
ctx.arc(x, y, size + 5, 0, 2 * Math.PI, false) // 5px Puffer für einfaches Treffen
|
||||
ctx.fill()
|
||||
}}
|
||||
|
||||
// Hover- und Klick-Logik
|
||||
|
||||
Reference in New Issue
Block a user