Issues with Exporting JointJS Graph to SVG - Unexpected Elements #2730
Answered
by
kumilingus
VADDIJASWANT
asked this question in
Q&A
-
Beta Was this translation helpful? Give feedback.
Answered by
kumilingus
Aug 6, 2024
Replies: 1 comment
-
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
VADDIJASWANT
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The element with id
8447566d-4e8b-4bcb-854e-3ec47e90469d
is located in the negative coordinatey
.You can test the graph bounding box before calling SVG export. You should see that
graph.getBBox()
gives you a bbox containing the 2 extra elements at the top.You're probably just no displaying the contents of the paper with negative coordinates, but they are there (either
Paper
orPaperScroller
configuration).Ideally, you make sure not to have elements outside viewport. A quick solution is to use the
area
option oftoSVG()
and specify the area you want to be exported.