-
Notifications
You must be signed in to change notification settings - Fork 4
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
Improve filter based on feedback #27
Conversation
…ically (particles and links)
|
I've just tested this using the CLD simulation and it works well. The simulator statuses are varied (other than 0). |
Nice, can we also have a filter for generator status? |
For a very nitpicky comment, the fields that take numerical values should have units on them to not be confusing. |
Can you make the filter trigger on hitting enter? |
Also, remove the exclamation marks from ¡Welcome to dmX! :) |
Hey @kjvbrt, I've implemented your suggestions (remove exclamation marks and filter on enter press). Also, I want to show you how would the filter look making it more condensed. (Sorry, I took too much time, but one event listener was being removed. Never using |
js/menu/filter/parameters.js
Outdated
const bitFieldDisplayValues = { | ||
23: "BitOverlay", | ||
24: "BitStopped", | ||
25: "BitLeftDetector", | ||
26: "BitDecayedInCalorimeter", | ||
27: "BitDecayedInTracker", | ||
28: "BitVertexIsNotEndpointOfParent", | ||
29: "BitBackscatter", | ||
30: "BitCreatedInSimulation", | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice. The one "complaint" I have about this is that now the BitfieldCheckbox
is now very tightly tied to these bitfield values and names. However, these are only correct for the MCParticle.simulationStatus
. Hence, I think it would be nice to make the BitfieldCheckbox
slightly more generic, such that this map can be passed on construction. Then when we construct the specific filter box for the simulationStatus
in the MCParticle
page, we can pass in this list and get the dedicated filter box for that. For other bit field checkboxes we would then just need to pass another map and would not have to re-implement this again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, right! I'm changing this now.
js/menu/filter/parameters.js
Outdated
23: "BitOverlay", | ||
24: "BitStopped", | ||
25: "BitLeftDetector", | ||
26: "BitDecayedInCalorimeter", | ||
27: "BitDecayedInTracker", | ||
28: "BitVertexIsNotEndpointOfParent", | ||
29: "BitBackscatter", | ||
30: "BitCreatedInSimulation", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
23: "BitOverlay", | |
24: "BitStopped", | |
25: "BitLeftDetector", | |
26: "BitDecayedInCalorimeter", | |
27: "BitDecayedInTracker", | |
28: "BitVertexIsNotEndpointOfParent", | |
29: "BitBackscatter", | |
30: "BitCreatedInSimulation", | |
23: "Overlay", | |
24: "Stopped", | |
25: "LeftDetector", | |
26: "DecayedInCalorimeter", | |
27: "DecayedInTracker", | |
28: "VertexIsNotEndpointOfParent", | |
29: "Backscatter", | |
30: "CreatedInSimulation", |
js/menu/filter/builders.js
Outdated
} | ||
|
||
setCheckBoxes() { | ||
this.checkBoxes = Array.from(this.uniqueValues).map( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should map over the dictionary. Even if that would mean that all the boxes are always there regardless of the values that are found in the file.
If you want to do this dynamically, you would have to put in a bit more logic here, because the uniqueValues
will be integers, but you would actually have to check in those uniqueValues
which are the unique bits that are set (in all of them) and then only display the bit field values that you found. That is also a possibility, but for code simplicity and maintanability, I would (at least for now) do the the easy thing and just take the dictionary
.
let parametersRange = [ | ||
{ | ||
property: "momentum", | ||
unit: "GeV", | ||
}, | ||
{ | ||
property: "mass", | ||
unit: "GeV", | ||
}, | ||
{ | ||
property: "charge", | ||
unit: "e", | ||
}, | ||
{ | ||
property: "vertex", | ||
unit: "mm", | ||
}, | ||
{ | ||
property: "time", | ||
unit: "ns", | ||
}, | ||
]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be the same for all types in EDM4hep, but we might have to check again. Maybe put a comment on top that states that this might need checking again, so that we don't forget?
js/menu/filter/filter.js
Outdated
bitsCheckbox.forEach((checkbox) => checkbox.render(filters)); | ||
|
||
apply.addEventListener("click", () => { | ||
const bitFieldDisplayValues = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const bitFieldDisplayValues = { | |
const SimStatusBitFieldDisplayValues = { |
Just so that it is immediately clear which bit field display values we are talking about here.
js/menu/filter/filter.js
Outdated
|
||
const bits = new BitFieldBuilder( | ||
"simStatus", | ||
"Simulator status", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Simulator -> Simulation
I like the current version a lot. I have just a few nitpicky comments on the appearance.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good. @kjvbrt anything from your side still?
Hi @tmadlener, I'm merging this, because #36 needs to be updated with these changes (#27). I hope @kjvbrt checks when he wants and gives some feedback. |
Nice work @brauliorivas |
BEGINRELEASENOTES
simStatus
options are now populated based on the data, meaning that options are extracted from the json.ENDRELEASENOTES
These improvements were discussed at the meeting on May 31.