Closed john012343210 closed 3 years ago
I too was wondering this.
Testing from Lucid chart, the CSV export contains connections, but when exporting as vsdx and importing back in to lucid chart, all the relevant information I am looking to retain is present EXCEPT connections are no longer snapped to the shapes.
This is either a manifestation of the vsdx format, or import. Any guidance would be greatly appreciated.
OK I have delved into the VSDX file format... There is no actual data construct which "snaps" the line to the object.
Basically you have the Shapes XY coordinates, as well as heigh and width. You also have a start xy and end xy for each of the line shapes.
I suspect it is as simple as getting each of the shapes, compute the edge boundry, and then check each line to see if it's start or end coordinates are on the edge of the shape.
"I suspect it is as simple as getting each of the shapes, compute the edge boundry, and then check each line to see if it's start or end coordinates are on the edge of the shape."
This is a possible guess, as I am sure that a line is also a shape, they probably just check whether the boundary of the line touches any shape.........
Of course, I am not 100% sure.
OK I have delved into the VSDX file format... There is no actual data construct which "snaps" the line to the object.
Basically you have the Shapes XY coordinates, as well as heigh and width. You also have a start xy and end xy for each of the line shapes.
I suspect it is as simple as getting each of the shapes, compute the edge boundry, and then check each line to see if it's start or end coordinates are on the edge of the shape.
actually if we try to read the source code of drawio, we might know how to get the connecting information, since drawio accepts import vsdx format graph, and drawio could perfectly read that connection information such that when you drag some shape, the connected line with other shapes will move too. However, the source code base is huge. I couldn't even locate where does this import function exist.
I am still digging into this, #4 is a bit of a bigger issue as right now this module does not properly implement the masters files which are used for deduplication within the file format. Basically shapes can be defined in the page directly, or they can be defined in master and then referenced within the page with overrides. Its pretty a ingenious solution, and it uses the same methodology of the pages directory. I hope to have something soon which that specific limitation. Then I will look into solving for the connector issue.
Hi - I think you are both right on the connectors/line shapes. There is a relationship defined in Connects/Connect element and the module should move the line shapes that are mapped to any other shape that are being moved (I imagine it will be more complex than that but its a start). Regards master files - you are right, I have not needed to look at that element.
Hi - I have add a couple of properties to Shape class. Shape.connected_shapes provides list of Shape objects (so connectors, or shapes if you query the connector) Shape.connects provides a list of Connect objects which describe the relationship
v0.2.5 pushed to PyPI now
I hope that helps address the initial question :)
I'll leave this issue open for now in case it doesn't.
Closing after v0.2.5 push
thanks for the 3 test vsdx and the well written test file.
May I know how to get the connection information from vsdx?