Skip to content

Conversation

0x0f0f0f
Copy link
Contributor

Related to xyflow/xyflow#5441

Copy link

vercel bot commented Sep 10, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
example-apps Ready Ready Preview Comment Sep 23, 2025 11:03am
4 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
reactflow-website Ignored Ignored Preview Sep 23, 2025 11:03am
svelteflow-website Ignored Ignored Preview Sep 23, 2025 11:03am
ui-components Ignored Ignored Preview Sep 23, 2025 11:03am
xyflow-website Ignored Ignored Preview Sep 23, 2025 11:03am

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the markers example to demonstrate color changing functionality when edges are selected. The changes add a custom edge component that dynamically changes its color and marker when selected.

Key changes:

  • Adds a custom edge component with selection-based styling
  • Creates a new selected marker definition in SVG
  • Includes proper null checking for DOM container

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
index.tsx Adds null check for DOM container before creating React root
index.css Adds styling for custom edge labels (unused in current implementation)
CustomEdge.tsx New custom edge component that changes color and marker when selected
App.tsx Integrates custom edge type, adds new node/edge, and defines selected marker SVG

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@0x0f0f0f
Copy link
Contributor Author

0x0f0f0f commented Sep 15, 2025

Idea from meeting

  • Use the marker SVG directly as a child of the edge, try to see if its a performance drawdown
  • Try to explain on the Edge Markers docs what is happening

@0x0f0f0f
Copy link
Contributor Author

As discussed, reporting the performance comparison of the stress example with markers defined normally vs in a custom edge:

Current marker usage:

image

Marker defined in custom edge:

image

It seems like there is a small but relevant performance drawdown on re-mount

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@0x0f0f0f 0x0f0f0f marked this pull request as ready for review September 30, 2025 09:22
@moklick moklick merged commit d176d82 into main Oct 1, 2025
6 checks passed
@moklick moklick deleted the markers-color-selection-example branch October 1, 2025 09:33
@moklick
Copy link
Member

moklick commented Oct 1, 2025

good stuff! thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants