[Lens] Refactor handling of empty values #68060
Labels
Feature:Lens
Team:Visualizations
Visualization editors, elastic-charts and infrastructure
technical debt
Improvement of the software architecture and operational architecture
Currently, empty values in data table cells are handled by the
rename_columns
expression function. They will be replaced by the string(empty)
. This is convenient because all charts will handle it correctly, but there are a few downsides to this approach:rename_columns
isn't really the expected place for this functionality(empty)
string when filtering (e.g. see [Lens] When filtering for empty field, the filter doesn't filter data correctly #66536 )Possible solutions
Handle this in each renderer
Have a
sanitizeValue
function in the renderer itself. This is easy to implement, but leads to code redundancy.Handle this in the field formatter
We have the ability to pass formatting hints along with the data. This formatter could handle empty values in the same way. If this is implemented as part of the existing field formatters, it would also change behaviors in other apps using the infrastructure (Visualize and Discover) - I'm not sure whether this is a good thing, but consistency could be beneficial. Another approach would be a wrapping formatter just for lens handlings this - e.g
{ id: 'string', params: { transform: 'lowercase' } }
becomes{ id: 'lens_default', params: { id: 'string', params: { transform: 'lowercase' } } }
The text was updated successfully, but these errors were encountered: