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
[Bug]: Safari doesn't render link arrow markers after loading data #2328
Comments
When you are using Safari, there is a bug where SVG Markers are not rendered if they are added asynchronously in the next animation frame. Here is the minimal reproducible case: https://jsfiddle.net/kumilingus/k90h2Lt1/ The issue has been reported. We are currently waiting for the Safari team to address it. In the meantime, you need to apply a workaround - there are a lot of ways, but it's important to somehow trigger the browser update of the SVG again.
paper.freeze();
graph.fromJSON(graphJSON);
paper.unfreeze({
afterRender: function() {
paper.el.style.display = 'none';
requestAnimationFrame(() => paper.el.style.display = '');
paper.unfreeze();
}
}); |
The above code doesn't fire |
If the graph is empty, the You need to check if the graph is empty or check if there are any updates scheduled. |
Am I misunderstanding this? paper.freeze();
graph.fromJSON(graphJSON);
console.log(graph.getCells()); // <- correctly logs the cells
paper.unfreeze({
afterRender: function() {
paper.el.style.display = 'none';
requestAnimationFrame(() => paper.el.style.display = '');
paper.unfreeze();
}
}); |
No. Empty in the sense of |
Eh... so it should work in the above example if the graph has cells? I am not using the |
The hasScheduledUpdates() method has been already added to JointJS. if (paper.hasScheduledUpdates()) {
paper.unfreeze({
afterRender: function() {
paper.el.style.display = 'none';
requestAnimationFrame(() => paper.el.style.display = '');
paper.unfreeze();
}
});
} else {
paper.el.style.display = 'none';
requestAnimationFrame(() => paper.el.style.display = '');
paper.unfreeze();
} If this is not helping, please provide steps to reproduce. |
Sadly, that doesn't work. Same problem: gets to the I will try to come up with a case to reproduce. |
I narrowed down the problem: It doesn't fire because there is another call coming in right after the load to set the router (the call may or may not happen but in my test cases it always happens) so it is:
// ... some other stuff that doesn't matter
paper.freeze();
links.forEach(link => {
link.findView(paper).requestConnectionUpdate();
});
paper.unfreeze(); This blocks the |
paper.unfreeze({ afterRender: () => console.log('Hello'); });
paper.unfreeze();
|
What happened?
Hi,
There is some issue with the markers (not) rendering on Safari, take a look at this image directly from the demo page:
The markers appear again when you reconnect the link (or create a new one) but it doesn't work after loading the data. Any ideas?
(Safari Version 16.6)
Version
3.7
What browsers are you seeing the problem on?
Safari
What operating system are you seeing the problem on?
Mac
The text was updated successfully, but these errors were encountered: