-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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
[Lens] Time scaling without date histogram #140107
Conversation
Pinging @elastic/kibana-vis-editors @elastic/kibana-vis-editors-external (Team:VisEditors) |
@elasticmachine merge upstream |
Pinging @elastic/uptime (Team:uptime) |
@elasticmachine merge upstream |
@@ -128,6 +128,7 @@ export const countOperation: OperationDefinition<CountIndexPatternColumn, 'field | |||
isBucketed: false, | |||
scale: 'ratio', | |||
sourceField: field.name, | |||
timeScalingMode: 'optional', |
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.
The time scaling mode is defined on the operation, no need to define it on each individual column. We also don't do this in other places (and you are not reading the time scaling mode from the column anywhere, only from the operation definition)
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.
good point!
@elasticmachine merge upstream |
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.
This code is removing the time scale on every change if there is no date histogram:
kibana/x-pack/plugins/lens/public/indexpattern_datasource/operations/time_scale_utils.ts
Line 81 in 316b1a0
timeScale: undefined, |
Kapture.2022-09-12.at.11.43.10.mp4
Thank you, @flash1293. I didn't find any regression on removing that Plus it fixes that case Screen.Recording.2022-09-12.at.13.27.40.mov |
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
@elasticmachine merge upstream |
@elasticmachine merge upstream |
@elasticmachine merge upstream |
💚 Build Succeeded
Metrics [docs]Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: cc @alexwizp |
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 everything works as expected now, LGTM
Closes: #79656
Summary
In #77811 the option to apply a time unit to the value of a time series is discussed (e.g. per hour, per day independent of the underlying Elasticsearch interval).
The same function could also be provided for non-timebased charts as long as a time range filter can be applied because the used index pattern has a configured default timefield.
In this case the time scaling would behave as if the complete time range is a single large bucket and scaled accordingly.
A visualization which can be realized using this is to show the rate of ingested documents per hour for the complete current time range by using a metric visualization on count with time scale applied to it.
Which operations suppport
Normalize by unit
?Screens
Screen.Recording.2022-09-07.at.15.39.12.mov