Opened 3 years ago

Closed 3 years ago

#6318 closed enhancement (wontfix)

Adding automatic diagram size option

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

Description (last modified by 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 (6)

comment:1 Changed 3 years ago by ceraolo

  • Description modified (diff)

comment:2 Changed 3 years ago by ceraolo

  • Milestone changed from NeedsInput to 1.18.0
  • Priority changed from high to normal
  • Type changed from defect to enhancement

comment:3 Changed 3 years ago by ceraolo

  • Description modified (diff)

comment:4 Changed 3 years ago by casella

@ceraolo, would you mind opening a similar ticket on the Modelica Specification issue tracker?

I guess that's the right venue to discuss it.

comment:5 Changed 3 years ago by ceraolo

I can try but with zero or very little hopes to have some success.
I have had very bad experiences there.

That's why I tried to follow a different path.
In this ticket description I considered opening a ticket on the modelica specification at a later stage.

comment:6 Changed 3 years ago by ceraolo

  • Resolution set to wontfix
  • Status changed from new to closed

This ticket is now obsolete since ticket #5849 basically is going to solve this ticket's issue

Note: See TracTickets for help on using tickets.