Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plotting order #3475

Closed
HansOlsson opened this issue Feb 5, 2024 · 5 comments · Fixed by #3483
Closed

Plotting order #3475

HansOlsson opened this issue Feb 5, 2024 · 5 comments · Fixed by #3483
Milestone

Comments

@HansOlsson
Copy link
Collaborator

The discussion in #3473 (comment) made me re-run EngineV6 in MSL and plotting the relevant variables - and I then noticed a minor issue:

How does the figure annotation deal with "plotting order"?

Specifically the plot will only be easy to understand if you plot filteredEngineTorque on top of/later than engineTorque; and I couldn't find the order specified - in contrast to the graphical primitives where an order is specified in section 18.6 .

(I know that there's no figure annotation yet for that example, but planning ahead.)

@henrikt-ma
Copy link
Collaborator

Do you mean that we should explicitly say that the Figure.plots is an array where the order matters? To me, this goes without saying, similar to that the Plot.curves is an array where the order matters.

However, a related feature we don't have is to define the order of figure groups. For comparison, we have some sort of rule for the dialog tabs and groups, but I must say it's a pretty bad rule we have (to reorder tabs and groups, one needs to alter the declaration order, which could degrade source code readability, lead to unexpected and hard to understand commit diffs, and in the worst case affecting heuristics of model translation). I can clearly see how a group of figures mainly for showing variables used in correctness testing, called Regression Testing should be at the end of the group list.

It would be possible to say that groups are ordered according to order of first appearance, and it would probably not be as bad as the current design for dialog tabs and groups, as reordering Documentation.figures would never affect model translation heuristics. However, first-encounter principle would only work for models without inherited figures; even if we don't care about the order among the base class figures, it would be annoying that the figures groups used or added in the present model cannot be positioned in relation to the inherited groups.

@HansOlsson
Copy link
Collaborator Author

Do you mean that we should explicitly say that the Figure.plots is an array where the order matters? To me, this goes without saying, similar to that the Plot.curves is an array where the order matters.

Yes, and specifically in what orders they are drawn - or something similar.

However, a related feature we don't have is to define the order of figure groups. For comparison, we have some sort of rule for the dialog tabs and groups, but I must say it's a pretty bad rule we have (to reorder tabs and groups, one needs to alter the declaration order, which could degrade source code readability, lead to unexpected and hard to understand commit diffs, and in the worst case affecting heuristics of model translation). I can clearly see how a group of figures mainly for showing variables used in correctness testing, called Regression Testing should be at the end of the group list.

It would be possible to say that groups are ordered according to order of first appearance, and it would probably not be as bad as the current design for dialog tabs and groups, as reordering Documentation.figures would never affect model translation heuristics. However, first-encounter principle would only work for models without inherited figures; even if we don't care about the order among the base class figures, it would be annoying that the figures groups used or added in the present model cannot be positioned in relation to the inherited groups.

The obvious solution would be to define an explicit ordering member, but that also has disadvantages.

@henrikt-ma
Copy link
Collaborator

Yes, and specifically in what orders they are drawn - or something similar.

What about legend order? Should it also be specified, or can we leave that for the tools to decide, so that drawing order is the only thing determined by the specification?

@HansOlsson
Copy link
Collaborator Author

Yes, and specifically in what orders they are drawn - or something similar.

What about legend order? Should it also be specified, or can we leave that for the tools to decide, so that drawing order is the only thing determined by the specification?

Leave it to the tools I say; as there are also a number of different placements of the legend.

@HansOlsson HansOlsson added this to the 2024-1 milestone Feb 15, 2024
@HansOlsson
Copy link
Collaborator Author

HansOlsson commented Feb 20, 2024

Modelica Phone Meeting:
Alternative is to have z-depth; discussion about graphical contents of diagram - separate control of legend and plot order can be useful (where legend order is independent of z-depth).
Proposal:
Order based on Z-order (high value close to viewer), and in case of tie use order of appearance. Legend order based on declaration order.

-> @henrikt-ma

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants