- Home
- Forum
- Angular - EJ 2
- SVGs in the diagram do not load
SVGs in the diagram do not load
I'm having a problem after saving the diagram, more precisely when using the loadDiagram function. My nodes are svgs and I have one node that renders normally and the others only after clicking on them. Before saving they render normally.
getDiagram(diagramProject: string) {
if (this.diagram) {
try {
this.diagram.refresh();
const parsedDiagram = JSON.parse(diagramProject); // Tenta parsear a string JSON
this.diagram.loadDiagram(parsedDiagram); // Carrega o diagrama
this.diagram.dataBind(); // Aplica as mudanças no diagrama
this.schemDiagramService.setDiagram(this.diagram);
} catch (error) {
console.error('Erro ao carregar o diagrama: ', error);
}
} else {
console.log('O diagrama ainda não foi carregado.');
}
}
Attachment: diagram_db292cae.zip
Hi,
We can replicate the reported issue with your JSON. we will validate and update you as earlier as possible.
Regards,
Moulidharan
ok, I'm waiting
Hi,
We tested the sample you shared and found that nodes are assigned the same zIndex. Each diagram element should have a unique zIndex. In your sample, all the 3 nodes has same "z-index" values which is causing the issue.
zIndex is typically calculated automatically by the diagram, and it is not recommended to set it manually in the application. Could you please confirm whether the zIndex values were set by you or if they were generated by saveDiagram? Understanding your reason for manually setting the zIndex will help us provide the most appropriate solution.
In the meantime, please assign different zIndex values to these nodes to resolve the issue. please refer the modified Json
Regards,
Moulidharan
Attachment: diagramsyncfusion_993f98ef.zip
Thanks, it worked by removing zindex!
Hi Natália Pereira Almeida Ferreira,
You're welcome.
We are glad that the provided response meets your requirement. Please let us know if you need further assistance. As always, we are happy to help you out.
Regards,
Preethi R
- 5 Replies
- 3 Participants
-
NP Natália Pereira Almeida Ferreira
- Oct 8, 2024 08:21 PM UTC
- Oct 14, 2024 06:37 AM UTC