Unit Conversion

I want to draw a rectangle(Rectangle with a specification of 297 x 210 mm).
If you draw a rectangle with width, height, or desiredSize, what is the value?
What is the unit of Size?How do you convert units?

Depending on the device you are displaying on, you will need to do your own unit conversion. GoJS units are by default roughly corresponding to CSS pixels.

To make rectangles that are of those dimensions proprotionally, simply set the width and height of a Shape. https://codepen.io/simonsarris/pen/EEJrBg

There are no “world” coordinates. You can pretend that a unit in document coordinates is whatever you want and do conversions accordingly. See the Floor Planner sample project, for example.

Remember that the display used to render will have its own transformations. After all if your screen is projected onto a wall, each pixel can be pretty big.