[Lens] Decouple visualizations from specific operations #75703
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is both cleaning up tech debt in Lens and setting us up for the date ranges and a combined number histogram/range function. The main issue is that we are coupling the data type and expected display behavior. The nice thing is that we already have a second parameter on
OperationMetadata
which should be used instead:The main difference is that histograms are
interval
type, and other bucket aggregations areordinal
type. Here are the places that I have identified as needing to change:dataType === 'date'
to determine the X axis. It should instead useoperationMetadata.scaleType === 'interval'
, so that number histograms are placed on the X axis.dataType === 'date'
in suggestions, but instead they should rejectscaleType === 'interval'
dataType === 'date'
when building titles. It probably shouldhandleFilterClick
function on datatables is looking up the time field only for date histograms, but not date functions in general.Closes #75702
Checklist