[Lens as code] Merge metrics into a single property for Metric chart#249533
[Lens as code] Merge metrics into a single property for Metric chart#249533dej611 merged 9 commits intoelastic:mainfrom
Conversation
|
Pinging @elastic/kibana-visualizations (Team:Visualizations) |
Co-authored-by: Andreana Malama <andreana.malama@elastic.co>
| addLayerColumn(trendLineLayer, `${ACCESSOR}_trendline`, columns); | ||
| addLayerColumn(trendLineLayer, HISTOGRAM_COLUMN_NAME, columns); | ||
| addLayerColumn(trendLineLayer, `${ACCESSOR}_trendline`, newPrimaryColumns); | ||
| addLayerColumn(trendLineLayer, HISTOGRAM_COLUMN_NAME, newPrimaryColumns); |
There was a problem hiding this comment.
I think here we have an issue that pre-existed and we should pass a date histogram column instead of the newPrimaryColumns here.
| addLayerColumn(defaultLayer, columnName, newSecondaryColumns); | ||
| if (trendLineLayer) { | ||
| addLayerColumn(trendLineLayer, `${columnName}_trendline`, newColumn, false, 'X0'); | ||
| addLayerColumn(trendLineLayer, `${columnName}_trendline`, newSecondaryColumns, false, 'X0'); |
There was a problem hiding this comment.
Similar pre-existing issue, in line 191 we set
trendlineSecondaryMetricAccessor: '${ACCESSOR}_secondary_trendline', but here we are adding the 'X0' suffix to the layer name. I think we should remove the suffix.
andrimal
left a comment
There was a problem hiding this comment.
Approving to unblock, as the trendline issue was not caused by this PR.
💚 Build Succeeded
Metrics [docs]Async chunks
Page load bundle
Unknown metric groupsESLint disabled line counts
Total ESLint disabled count
History
|
…lastic#249533) ## Summary Fix elastic#244506 This PR fixes few Metric chart API shortcomings: * Breakdown dimension can be ranked by secondary metric now * due to `schema` library lack of tuple support, while the `metrics` property can be an array, the introduction of the `type` discrimination property had to be done to avoid random default injections. * Fixed background chart schema for ES|QL version * Added more E2E tests (both from SO and API versions) ### Checklist - [x] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios --------- Co-authored-by: Andreana Malama <andreana.malama@elastic.co>
Summary
Fix #244506
This PR fixes few Metric chart API shortcomings:
schemalibrary lack of tuple support, while themetricsproperty can be an array, the introduction of thetypediscrimination property had to be done to avoid random default injections.Checklist