Replies: 2 comments 1 reply
-
It's similar to the width and height of the viewBox attribute in SVG and defines the dimension of a shape viewport https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/viewBox |
Beta Was this translation helpful? Give feedback.
-
Outcome on this issue was that I never got to the bottom of what draw.io is trying to do with these custom shape sizes. The reason it's important, in my mind, is that I want to create a library of shapes where there is some compatibility between them. So you want them to align nicely on a grid, etc. And to do that you need to know the relationship between coordinates and elements specified in the x,y on the shape and the grid it is being inserted into. But I can't make head or tail of what the x,y get translated to when you insert them into the diagram. It doesn't seem to make sense. Perhaps it does make sense, if you are given the documentation that describes it. But I could not find such documentation. And so conclusion is that I've simply given up and moved on. For now. |
Beta Was this translation helpful? Give feedback.
-
I am creating a custom shape for the first time.
Consider the following basic shape, which is just a 100x100 square with nothing on the foreground:
My question is regarding the h="100" and w="100" attributes. 100 what?
It's not mm. If I insert the shape onto my canvas and select it, the "Arrange" tab tells me it is 30.5mm x 30.5mm.
So it's not inches either, as 100 inches would be 25.4mm.
The documentation states:
Unfortunately, it does not state what is meant by "height" and "width" in terms of units.
I thought: well, for sure a unit of 1 == 0.305mm. So I will have to create my shape with that in mind. But to test it, I created a square shape with a size of 1:
I inserted it into my diagram, and it measures: 30.5mm x 30.5mm, despite being defined as 100x smaller than the first shape.
So now I am even more confused about what the shape size units are.
If someone is able to enlighten me, I will very much appreciate it, and I thank you in advance for any personal time spent on my question.
Beta Was this translation helpful? Give feedback.
All reactions