-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[ML] DF Analytics results view: ensure boolean values in charts shown without formatting #78888
[ML] DF Analytics results view: ensure boolean values in charts shown without formatting #78888
Conversation
Pinging @elastic/ml-ui (:ml) |
This looks good. But as part of this work would be nice to look at the behavior of the tooltip for the data grid histogram for boolean types to also show true / false rather than 1 / 0 currently: @walterra suggested the easiest approach might be to adapt the data we pass on to the chart instead of fiddling with custom formatting in the tooltip. |
Regarding #78888 (comment), it looks like the schema change has changed the axis labelling for boolean types. On master, it labels the columns as 'true' / 'false' rather than '2 categories' (although the tooltip still says 1 / 0): @peteharverson - thanks for taking a look! 🙏 I was able to fix the tooltip issue but it requires keeping the |
a26d021
to
4fb581d
Compare
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.
Functional test changes LGTM
e8c0224
to
e0dbfbe
Compare
@@ -231,11 +231,13 @@ export const useColumnChart = ( | |||
if (isOrdinalChartData(chartData)) { | |||
data = chartData.data.map((d: OrdinalDataItem) => ({ | |||
...d, | |||
key_as_string: d.key_as_string || d.key, |
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.
if d.key_as_string
could be undefined
this should probably be a ??
check.
also, should key_as_string
be optional in the interface?
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.
Yes, d.key_as_string
is not defined in some items this point so we are checking for undefined
. Great suggestion for updating to use ??
check.
As key_as_string
will now always be defined (since we're setting it as key
when it isn't) I left it as required in the interface. Though it will be less flexible and doesn't really reflect the original item - I think leaving it as optional is the better option. Good catch! 🙏
Updated in df3142a
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.
Tested and LGTM.
Formatting true
in the table cell rather than True
might be best done eventually in the EUI data grid itself.
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.
LGTM
💚 Build SucceededMetrics [docs]async chunks size
History
To update your PR or re-run it, just comment with: |
… without formatting (elastic#78888) * add functional test for searchBar filters. remove boolean schema from datagrid * always use string version of key for charts * add schema back in for histogram label * use ?? instead of || for undefined check
…ts shown without formatting (elastic#78888)" This reverts commit 4c65b6d.
Summary
Related meta issue: #77182
key_as_string
property and use them in the charts so that values like booleans show up as 'true'/'false' vs 1/0Checklist
Delete any items that are not applicable to this PR.