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

CSSTUDIO-1812: Fix width of columns in the "Statistics"-tab #2524

Merged
merged 4 commits into from
Jan 31, 2023

Conversation

abrahamwolk
Copy link
Collaborator

The primary purpose of this merge-request is to increase the width of the columns containing doubles in the "Statistics"-tab so that the full value is shown. The intent is to prevent the user from mistakenly reading the wrong order of magnitude since the exponent is shown using a postfix-notation at the end of the printable representation of the double in question. E.g., if the number to be shown is 1.234E8, then, if this output is truncated, the user may only be shown 1.23..., and mistakenly think that the order of magnitude is eight powers of ten less than it actually is.

To prevent this, this merge-request increase the minWidth- and prefWidth-properties of the columns containing doubles to high enough values so that any double should be printable.

Other changes that are introduced in this merge-request are:

  • The width-fields of the columns "indicatorColumn", "displayNameColumnn", and "countColumn" are also updated in this merge-request, to improve the user-experience.
  • In "StatisticsTab.fxml", the "GridPane" was changed to "VBox" and a "ScrollPane" was added around the "TableView". This is to enable scrolling in the TableView when the window is too small to show the entire TableView.
  • The types in the view model of the "TableView" in "StatisticsTab.fxml" (i.e., the variables of type TableColumn<S, T> in the class StatisticsTabController) were changed so that the content of the cells in the table (i.e., the T in TableColumn<S, T>) is typed according to the data that it represents.
  • The types in the data model of the "TableView" in "StatisticsTab.fxml" (i.e., the class ModelItemStatistics) were updated so that the types of the elements reflect the types of the data that they hold. (In other words, the S in TableColumn<S, T> was also updated.)

Copy link
Collaborator

@georgweiss georgweiss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure I agree to change String -> Double. Reason is that initial values in the columns become 0.0, which is in a sense incorrect. With String setting values to null would simply not render anything.

@kasemir, what's your take on this?

Screenshot 2023-01-31 at 15 30 41

@kasemir
Copy link
Collaborator

kasemir commented Jan 31, 2023

Reason is that initial values in the columns become 0.0, which is in a sense incorrect.

Using Double for numbers seems better than String, but the side effect of starting out with all "0.0" when you really have no data is indeed incorrect. "Count=0" is good for not having any data, but the other stats should then be "NaN" or empty, not "0.0". So maybe keep the Double, but reset some columns to Double.NaN instead of 0.0? Or do go back to String if that was easier to use.

@abrahamwolk
Copy link
Collaborator Author

Those are good points. I have updated the code to initialize the doubles to Double.NaN instead of 0.0.

@abrahamwolk abrahamwolk merged commit 86e2788 into master Jan 31, 2023
@abrahamwolk abrahamwolk deleted the CSSTUDIO-1812 branch January 31, 2023 15:24
@kasemir
Copy link
Collaborator

kasemir commented Jan 31, 2023

Thanks, fixes #2508

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 this pull request may close these issues.

3 participants