Closed asbates closed 1 year ago
Agree regarding NA/Inf. Also can we reduce the spacing between the two and right-align a bit more? To leave more space for the actual selected values
Hesitant about using arrow on the selected range though. We simply don't tend to see that type of notation typically.
I think maybe instead of the short dash - (which is the same as the negative sign), perhaps using a longer em dash — is better?
eg. -2.7 - -1.85
vs -2.7 — -1.85
Also would like to add some conditional handling in the summary for categorical variables (checkbox groups UI)
M, F
for variable SEX)For NA/Inf, I don't think displaying just "NA" or "Inf" conveys much information. What I mean is I don't think "NA" conveys to the user that missing values are kept. We should rethink not just the alignment here but how the message is conveyed.
Yes agree, I thought it was something still WIP, so I didn't comment. So can we go back to this? Originally posted to #181
We can right align the text to show Includes: NA, Inf
with a check or cross mark behind the NA/Inf. If there are no NA/Inf values in the data, then don't show in "Includes"
Also would like to add some conditional handling in the summary for categorical variables (checkbox groups UI)
- If all available levels are selected (basically no filtering applied), then display "All levels selected".
- If only 1-2 levels are selected (for variable with more than 2 levels available), display the full selected value (eg.
M, F
for variable SEX)- If >=3 or more levels selected, then keep display as-is
I think we talked about this issue before, and it has to do with variables that have really long values. For example, the RACE variable has options like "American Indian or Alaska Native" and "Native Hawaiian or Other Pacific Islander." If someone picks both of these options, it might be hard to fit them both on one line when we show them on a card.
One idea we had was to cut off the variable at a certain length. But we realized that this might not be the best solution if the first option is really long, because then the second option might not show up.
For NA/Inf, I don't think displaying just "NA" or "Inf" conveys much information. What I mean is I don't think "NA" conveys to the user that missing values are kept. We should rethink not just the alignment here but how the message is conveyed.
Yes agree, I thought it was something still WIP, so I didn't comment. So can we go back to this? Originally posted to #181 We can right align the text to show
Includes: NA, Inf
with a check or cross mark behind the NA/Inf. If there are no NA/Inf values in the data, then don't show in "Includes"
Couple thoughts on this:
I'm trying to determine whether adding the word "Include" would enhance clarity. At present, we're employing the term "Keep" in the selection. Should we keep it the same way?
Currently, we display both the "from" and "to" values for dates. However, having an "NA" on the right side does not appear visually appealing to me.
Should we consider providing a sentence instead? "Data includes NA and infinite values"
Should the information about NA and Inf added on the new line after "x levels selected" label?
Should we use tooltip to show the rest of information between user hover over "x levels selected" label?
This is a research ticket and we will execute on different issue.
I will try to draft up some more harmonized and standardized filter card designs. Please help to identify all the possible combinations of filter class/type/state that we may have. Following are the list of the top of my head.
By filter class
By filter variable type
By filter card state
Any more I missed?
I think you covered most of them. The only one that I think of is logical
variable type.
By filter class
- [ ] Interactive (with default set by API)
- [ ] Interactive (user created in-app)
- [ ] Fixed
- [ ] Grouped?
This no longer reflects our design. There are no separate classes for interactive/fixed filter states and no separate classes for filters created with API on start-up or by the user during runtime.
There is FilterState
class (with subclasses for different data types).
A FilterState
object defines subsetting on one variable only.
A FilterState
can be created on start-up, by the API (as defined by the app developer) or during runtime, by the user.
A FilterState
can be disabled and re-enabled by the user.
A disabled FilterState
cannot be modified.
A FilterState
created by the API can be created disabled. This can be changed by the user.
A FilterState
created by the API can be created fixed, which means none of its properties can be modified. It can still be disabled.
By filter variable type
- [ ] Numeric
- [ ] Dates/datetime
- [ ] Logical
- [ ] Factors
- [ ] Characters (eg. more than 5 factors?)
All variable types except logical
create a ChoicesFilterState
if there are less than N unique values, N being defined by a teal
option nad being constant throughout the session. ChoicesFilterStates
always converts data to a factor allows choosing values with checkboxes. When >N unique values are present in the data, selection defines ranges, whether the data is numeric, date, or datetime.
( If a factor is passed that has >N unique values, a drop-down is used instead.)
By filter card state
- [ ] Card expanded
- [ ] Card collapsed
Any more I missed?
Finalized the filter card summary design and shared general thoughts with @donyunardi
Sorry for all the screenshots, I did this in PPT and not able to share an internal doc here. I will send gSlide link via group chat.
Design updated on Apr 21, 2023 Changes from previous version, based on Apr 20 discussion
Currently the summary of a disabled filter card spells "Disabled". Are we to depart from that? Please confirm.
Currently the summary of a disabled filter card spells "Disabled". Are we to depart from that? Please confirm.
Thank you very much for pointing it out! Let's go with active/inactive when we talk about state of the filter cards. Modified in the mockup above as well.
IMO while Potential solution 2 looks nicer, it will get messy when more complex filter are applied.
Imagine group filters to be nested, so the parts of group filers might be grouped filters, like: (SEX = M AND AGE > 45) OR ((SEX = K OR (SEX = M AND AGE < 15)) AND (SCORE > 15)) It will look terrible on solution 2.
Potential solution 1 is more robust, and you can fit everything you want, plus we expect users and "receivers" to know what &
, |
and brackets mean.
I'd like to make a few comments on the use of color here.
AESER == 'Y'
) information so would use the "info" color here if any (non-gray) color at all.Example of clash that results from hard-coded colors that don't respect the theme. This Bootstrap version 5 with Bootswatch theme of "Journal". Note the color for the radio buttons. The buttons themselves are the primary theme color. The label background however is based on the default Shiny colors. The result is a pretty stark visual clash.
4. I think for now we should focus on content.
Agree focus should be on content and content arrangement as priority. Coloring per bootstrap theming is nice to have at this point, perhaps can be tackled together with the theming of the UI component (eg. progress bar/distribution) later. Will open a separate issue.
I can't remember if this was discussed but I think displaying "NA" in the selected value section is redundant.
I'd recommend sticking with just the one 'NA' on the right side, like so.
@lcd2yyz is that OK with you?
@asbates Yes agree - should display NA right-aligned only. Thanks!
@asbates Sorry one more minor detail... if the NA is an explicit data point as a character string "NA"
, not the missing data point NA
or NA_character
, then it should still show up in the selected value section (in addition to the right-aligned NA-checkmark if there is missing data). Hope that make sense?
That would be the intended behavior for a character/factor.
@lcd2yyz can you provide some examples of input and output regarding numeric values and scientific notation?
@lcd2yyz can you provide some examples of input and output regarding numeric values and scientific notation?
Added an example in this issue https://github.com/insightsengineering/teal.slice/issues/251. We can continue discussion about numeric value and scientific notation there?
Review and improve the design of the filter card summary.
Some comments from @nikolas-burkoff
Arrow would be better for displaying selected range of numeric columns.
If there aren't any NA/Inf maybe we shouldn't show NA/Inf