Comments (9)
Dynamically instantiated SVG elements don't work: https://issues.chromium.org/issues/40656725
svg may needs an appropriate namespace.
It is worth trying this:
- <svg className="react-flow__marker">
+ <svg xmlns="http://www.w3.org/2000/svg" className="react-flow__marker">
There seem to be other svg's in the codebase with no namespace defined.
from react-flow.
I found a workaround. This works fine in Chrome:
https://codesandbox.io/p/sandbox/focused-morse-8wm7s5
Add a custom edge marker, and set it in thedefaultEdgeOptions
:
<svg style={{ position: `absolute`, width: 0, height: 0 }}>
<defs>
<marker
id="default-edge-marker"
viewBox="0 0 0 0"
markerHeight={0}
markerWidth={0}
></marker>
</defs>
</svg>
<ReactFlow
defaultEdgeOptions={{
markerStart: `default-edge-marker`,
markerEnd: `default-edge-marker`,
}}
/>
from react-flow.
Don't mutate objects in your setter function, that's where the issue comes from.
Replace this
if (edge.id === "e1-2") {
edge.markerStart = markerStart;
}
with this
if (edge.id === "e1-2") {
return {
...edge,
markerStart,
};
}
Here's your sandbox corrected.
from react-flow.
Thanks, but that Sandbox still doesn't seem to work correctly.
- Go to the https://codesandbox.io/p/sandbox/misty-wave-6yl8t3?file=%2FApp.js%3A31%2C9-36%2C10 (should reload the page)
- Click the "Arrow" checkbox
- Marker is not rendered
from react-flow.
The sandbox I linked seems to work completely fine. I open the sandbox, click the checkbox and see a red marker appearing without having to click/drag or do anything at all.
Even the one you linked works completely fine 😄
from react-flow.
Is it possible that this is environmentally dependent? I am having problems in my environment described in the ticket.
2024-05-21.20.28.41.mov
from react-flow.
Mh... what browser is that? Chrome?
from react-flow.
Interesting, in Chrome it doesn't work but in FF it does 😄
Seems to be a bug somewhere, that's strange
from react-flow.
Interesting find!
from react-flow.
Related Issues (20)
- Node Position Changes Cause All Nodes To Disappear HOT 3
- Provide helper to create an edge from edge params or `Connection` HOT 9
- Large Data React-Window Virtualization HOT 7
- prevent outcoming edge from target handle HOT 5
- accept array of classes in noPanClassName HOT 5
- snap guidelines HOT 2
- Extra Objects needed HOT 2
- Node position not matching the nodes list and rendered node HOT 5
- defining a fixed markerEnd (or Start) in custom Edge doesn't work? HOT 2
- I face a bug to align center expand and collapse flow HOT 1
- Export type definitions for individual methods and variables of `useSvelteFlow` functionality HOT 4
- add edge mouseenter event HOT 1
- dynamic handle HOT 6
- lavaProps useControl HOT 5
- There is an error in client site
- Removing extent attribute onNodeDragStart doesn't allows for free roam until after onNodeDragStop HOT 7
- Multiple dragging doesn't trigger onNodeDragStop event. HOT 2
- Class for connecting from node HOT 1
- How automatically enabled the lock viewport of controls in ReactFlow HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-flow.