Skip to content

Issue: Canvas Staining When Using Custom Rectangular Nodes #583

Description

@SujalDhiman

I am using react-force-graph-2d and have implemented custom rendering for nodes using rectangles via the nodeCanvasObject callback. However, I'm facing an issue where staining or ghosting appear on the canvas during renders—especially when the graph is animating (i.e., before stabilization).

This behavior typically occurs when I apply custom borders or background fills to the rectangles. The canvas seems to retain trails or stains of previous frames. Once the simulation stabilizes, the stains disappear, and the graph appears normal again.

Any possible fixes for it?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions