Opened 4 years ago

Last modified 4 years ago

#6318 closed enhancement

Adding automatic diagram size option — at Version 3

Reported by: massimo ceraolo Owned by: somebody
Priority: normal Milestone: 1.18.0
Component: *unknown* Version: 1.16.0
Keywords: Cc:

Description (last modified by massimo ceraolo)

After many years of Modelica usage, the more I use it, the more I don't understand the reasons to always specify diagram size.
The majority of libraries use default size (100x100) for their models except when they need to be larger.
But very often models diagrams have an "unsymmetrical" shape: they lay horizontally (thus for optimal view require a desktop space more large than tall) or vertically (vice-versa).

Many, many library models from many libraries just span vertical from, say, -40 to + 60, or -60 to + 60, but carry the default 100x100 diagram size.

Tools, correctly, by default visualize the whole diagram size, thus wasting useful desktop space for blank bands on top and bottom of diagrams (e.g. for the above example of a model vertically spanning from -60 to +60) or, less frequently, on left and right.
Obviously, the user can zoom (in OMEdit with the Zoom in button), but the next time they open that model they must zoom again.
They can modify the diagram size, but every time they change their models they have to update it.

My idea is that OpenModelica could implement something to avoid this with a Vendor-Specific annotation. People could test it for a long period and eventually if a large consensus emerges an addition to the Modelica standard can be proposed.

For instance the model annotation __OpenModelica_useAutoDiagramSize could be introduced.
When a model has this annotation, the white part of the diagram canvas should be unlimited.
When the OMEdit window is resized (and the shown model is not zoomed) presently the diagram area is resized to stay visible; when we are in useAutoDiagramSize, instead, it will be the model that will be resized: in this way, if the model is wide/tall we can use a wide/tall OMEdit window, so that the model is the size we want, without the need to waste desktop space to accommodate a square diagram size (the 100x100 default) or to change manually the diagram size every time we build as new or change a model.

Honestly, I don't see drawbacks to this behavior: I see only advantages.
And from my standpoint, it seems not difficult to implement.

Change History (3)

comment:1 by massimo ceraolo, 4 years ago

Description: modified (diff)

comment:2 by massimo ceraolo, 4 years ago

Milestone: NeedsInput1.18.0
Priority: highnormal
Type: defectenhancement

comment:3 by massimo ceraolo, 4 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.