-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[Lens] Remove Over time suggestions for numeric intervals #78442
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] Remove Over time suggestions for numeric intervals #78442
Conversation
|
@dej611 I'm interested in coming up with a solution that doesn't involve the XY chart at all. Could you take a look at the logic in |
…rvals-suggestions
…rvals-suggestions
|
Reworked the logic to tune the data table at |
|
@elasticmachine merge upstream |
|
@dej611 This is looking closer, but it seems like this is still generating suggestions to insert the time field in cases where inserting the time field is not helpful. What do you think about my previous comment:
|
…rvals-suggestions
|
Talked offline, not sure to find a consensus on what it should show in this scenario. |
…1/kibana into feature/lens/intervals-suggestions
|
@elasticmachine merge upstream |
wylieconlon
left a comment
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.
I tested this out locally and it did what I expected, but also seems to do other unrelated things. Can you clarify the parts that are directly related here?
|
|
||
| const hasNumericDimension = | ||
| buckets.length === 1 && | ||
| buckets.some((columnId) => layer.columns[columnId].dataType === 'number'); |
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.
Instead of looking for numeric operations, which can include the number range aggregation too, could you filter for any existing column.scale === 'interval'? This should allow the timestamp to be added when it's a "Custom ranges" option, which is currently not added.
| ); | ||
| }); | ||
|
|
||
| it('does not create an over time suggestion if tables with numeric buckets with time dimension', async () => { |
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.
Can you also add a test when the aggregation is the "Custom ranges" mode?
| defaultMessage: 'Over time', | ||
| }), | ||
| changeType: 'extended', | ||
| changeType: shouldSwitchTimeWithBuckets ? 'reorder' : 'extended', |
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 suggestion should always be extended because it should always add a new column. Calling it a reorder will affect how the XY charts use the suggestion, which I don't think is intentional.
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.
You're right. All the code in this function needs to be removed as it was shaped to make it work the initial way.
| case 'bar': | ||
| return 'bar_horizontal'; | ||
| case 'bar_horizontal_stacked': | ||
| return 'bar_stacked'; |
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 doesn't look right to me, why was this removed?
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.
It's a duplicate. At line 116 there's exactly the same case.
| columnOrder: shouldSwitchTimeWithBuckets | ||
| ? // in this case the order is very important to assign the split accessor! | ||
| [newId, ...buckets, ...metrics] | ||
| : [...buckets, newId, ...metrics], |
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.
Is this necessary? If so, can you please write a test for it?
…1/kibana into feature/lens/intervals-suggestions
|
@elasticmachine merge upstream |
|
Pinging @elastic/kibana-app (Team:KibanaApp) |
wylieconlon
left a comment
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!
|
@elasticmachine merge upstream |
💚 Build SucceededMetrics [docs]async chunks size
History
To update your PR or re-run it, just comment with: |
) Co-authored-by: Kibana Machine <[email protected]>
) Co-authored-by: Kibana Machine <[email protected]>
) (#81118) Co-authored-by: Kibana Machine <[email protected]> Co-authored-by: Kibana Machine <[email protected]>
…) (#81117) Co-authored-by: Kibana Machine <[email protected]> Co-authored-by: Kibana Machine <[email protected]>
Summary
Current state
After some discussion there wasn't a clear consensus on the value of having a
Over timesuggestion for numeric histograms type of charts.Therefore the current state is to detect this scenario and avoid to push a
Over timesuggestion for it.Previous state
The aim of this PR is to improve the suggestion system for histograms not date-based, providing better
Over timesuggestions.This is the continuation of #76121 .
The current state of suggestions for the
Over timeoption is to add a newintervaldate dimension to the break down section of the panel, keeping other dimensions on their place.This PR makes a distinction between
intervaltype operations, making the suggestion system aware of the data type, pushing for a swap of thexandsplitBydimensions to propose adate histogrambased chart:This is a first attempt with it: so far I couldn't find another route than the
dataTypeto detect the different type ofintervals.Checklist