-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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] Extend bounds for Interval operation #132619
Conversation
@@ -624,6 +624,7 @@ export function LayerPanel( | |||
render={layerDatasource.renderDimensionEditor} | |||
nativeProps={{ | |||
...layerDatasourceConfigProps, | |||
activeData: props.framePublicAPI.activeData, |
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.
Needs this bit here to prepopulate the bounds field on first enabling.
layer={state.layers[layerId]} | ||
layerId={layerId} | ||
activeData={props.activeData} | ||
{...paramEditorProps} |
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.
While debugging some missing props, I've noticed this duplication here. I can be moved into a separate PR, but it's well isolated already.
[maxBarsValue] | ||
[onMaxBarsChange] | ||
); | ||
const { inputValue: maxBarsValue, handleInputChange: setMaxBarsValue } = |
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've taken the opportunity here to refactor this with the useDebounceValue
hook.
rows: [], | ||
formattedColumns: {}, | ||
}; | ||
for (const row of table.rows) { |
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.
while testing the formatting solution, I've noticed here some time iterating on the formattedRows
at each execution. With this mutable version it should save some time for big tables.
); | ||
// This special function will override partial rows value to empty strings | ||
// to make it work for the renderer. | ||
const partialRowsOverride: ExpressionAstFunction[] = shouldEnablePartialRows |
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.
As discussed offline, this solution seems the "cleanest" so far: the table values gets overridden only in some specific cases and the rest of the logic remains the same.
It might be arguable that the final result produced makes the empty values for the partial rows fall into the (empty)
category.
Notes for reviewersThis feature is enabled on the datasource side, so it will show up in all charts that support the |
Pinging @elastic/kibana-vis-editors @elastic/kibana-vis-editors-external (Team:VisEditors) |
@elasticmachine merge upstream |
💚 Build SucceededMetrics [docs]Module Count
Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: |
@flash1293 I've hard time following what is happening, can we discuss this online and find a solution? |
Another approach would be to pass the meta information of the chosen domain to the chart directly instead of inferring it from the data table. This would require us to implement this logic per visualization. |
It is an option to evaluate to be honest.
I think the general idea of disabling the feature in some specific case can be a possible solution: there are also other scenarios, like with partition charts where this feature does not bring any value and it does not make much sense to show it.
Probably the best solution here: the meta information can be optional and when this feature is enabled it is passed over. |
It's a good point, that brings us back to implementing this as part of the individual chart types instead of data modelling (sorry for pushing you in the wrong direction with this initially) |
Closing in favour of #134020 |
Summary
Fixes #129308
This PR introduces the ability to extend the data bounds for the interval operation ( numeric histogram ) in a similar way to Visualize.
By default it is disabled:
When enabled a new range input is shown, with current data bounds already filled in and some explanation about lack of support of filtering:
The field has some basic validation:
When
Include empty rows
is disabled the feature is disabled:In case of no data available, then the field is shown with empty values:
Checklist
Delete any items that are not applicable to this PR.
Risk Matrix
Delete this section if it is not applicable to this PR.
Before closing this PR, invite QA, stakeholders, and other developers to identify risks that should be tested prior to the change/feature release.
When forming the risk matrix, consider some of the following examples and how they may potentially impact the change:
For maintainers