Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add proper marker usage description in documentation #477

Open
1 task done
maliyshock opened this issue Aug 20, 2024 · 1 comment
Open
1 task done

Add proper marker usage description in documentation #477

maliyshock opened this issue Aug 20, 2024 · 1 comment
Labels
react-docs Issues belonging to the reactflow website svelte-docs Issues belonging to the svelteflow website

Comments

@maliyshock
Copy link

Code of Conduct

Which site are you suggesting a change for?

reactflow.dev

What content is affected by this change?

https://reactflow.dev/examples/edges/markers
and
https://reactflow.dev/examples/edges/custom-edges
and
https://reactflow.dev/api-reference/components/base-edge

What part(s) of the article would you like to see updated?

So basically there might be a case of customer edge with custom marker.
So we need an example of BaseEdge component for this case

Right now it says: "markerEnd | stringThe id of the SVG marker to use at the end of the edge. This should be defined in a element in a separate SVG document or element."

But it is not exactly the truth, because if you put just an id it will not work.
These examples will not work:
<BaseEdge id={id} markerEnd="#marker" path={edgePath} style={{ strokeWidth: "4px" }} />
<BaseEdge id={id} markerEnd="marker" path={edgePath} style={{ strokeWidth: "4px" }} />

Instead you have to use "url(#marker)" in markerEnd prop.
This will work

<BaseEdge id={id} markerEnd="url(#marker)" path={edgePath} style={{ strokeWidth: "4px" }} />

Additional information

No response

@moklick moklick added react-docs Issues belonging to the reactflow website svelte-docs Issues belonging to the svelteflow website labels Sep 11, 2024
@moklick
Copy link
Member

moklick commented Sep 11, 2024

This is good feedback! We could extend our existing examples and give some more context here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
react-docs Issues belonging to the reactflow website svelte-docs Issues belonging to the svelteflow website
Projects
None yet
Development

No branches or pull requests

2 participants