[Lens] Implement null instead of zero switch#127731
Conversation
|
@ghudgins Do you think the upsides are worth the downsides? |
|
@elasticmachine merge upstream |
|
Pinging @elastic/kibana-vis-editors @elastic/kibana-vis-editors-external (Team:VisEditors) |
|
Pinging @elastic/kibana-app-services (Team:AppServicesSv) |
kertal
left a comment
There was a problem hiding this comment.
DataDiscovery.team code LGTM, code owners review, just tests were changed. didn't test
|
@elasticmachine merge upstream |
| return ( | ||
| <EuiFormRow display="rowCompressed" hasChildLabel={false}> | ||
| <EuiSwitch | ||
| label={i18n.translate('xpack.lens.indexPattern.cardinality.hideZero', { |
There was a problem hiding this comment.
This copy is tricky... @KOTungseth could you help here?
I'd suggest 'don't display zero values', hide zero values, exclude zero values from visualization.
mbondyra
left a comment
There was a problem hiding this comment.
It works great and I think it solves a lot of mentioned problems for our users (apart from the ones in the description, in the datatable users sometimes also want to thave - instead of 0). I am just not sure if the copy is clear enough and if we shouldn't put this setting into the advanced popover.
|
@MichaelMarcialis Aside the copy, it's a bit annoying to have a new setting that visible in the sidebar which is not relevant in a lot of cases. Do you have another idea how to handle it? |
If we're confident that the majority of cases would not need/desire to use such a setting, then moving under advanced options (as @mbondyra mentions above) makes sense to avoid adding another ever-present item to the form. Another thought might be whether or not such a setting needs to be managed at the individual dimension configuration level, or if it can/should be managed globally for all relevant dimensions in the visualization. If there is a desire to explore a global-level setting, it could be moved out of the configuration flyouts entirely and placed in one of the toolbar menus (perhaps under appearance). |
|
@MichaelMarcialis what about this?
I would like to do that separately, I put it on the agenda for 8.3
It felt weird to me because the switch would either disappear on disabling the setting or it would stick around forever after being added once which is both slightly unexpected to me. |
That works for the interim, until we take the accordion approach. Not super keen about the switch throwing off the text alignment, but not sure moving the switch to the right side would look much better. |
💚 Build SucceededMetrics [docs]Public APIs missing comments
Async chunks
Public APIs missing exports
Page load bundle
History
To update your PR or re-run it, just comment with: |



Fixes #119478
This PR adds a swtich for count/unique count and sum to show null instead of 0 in case of missing data.
Old behavior: zero is just another value and rendered as color

New behavior: Empty is distinctly different
* Setting is disabled for formula because otherwise common calculations won't work anymore (e.g. `sum(kql="A") + sum(kql="B")` will stop working if one of these sums is null because nulls can't be added) which slightly changes behavior between formula and quick functions