-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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] support legendStats
along with valuesInLegend
in preparation for legend statistics
#180917
[Lens] support legendStats
along with valuesInLegend
in preparation for legend statistics
#180917
Conversation
4bdd7ae
to
b818a90
Compare
436148c
to
bfa79b2
Compare
0e41043
to
63c8ec8
Compare
legendStats
along with valuesInLegend
in preparation for legend statistics
5f01d9d
to
b1936c9
Compare
b1936c9
to
8655045
Compare
64abf10
to
7feb827
Compare
7feb827
to
cb566db
Compare
fea3cc3
to
2a5c6e7
Compare
Pinging @elastic/kibana-visualizations (Team:Visualizations) |
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.
Obs Ux Infra changes LGTM.
@mbondyra We are passed FF, should this be targeted to 8.15
instead?
Pinging @elastic/obs-ux-infra_services-team (Team:obs-ux-infra_services) |
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.
Done a first code review pass. Left some comments.
Will check locally in a bit...
src/plugins/chart_expressions/expression_xy/public/components/xy_chart.tsx
Outdated
Show resolved
Hide resolved
src/plugins/vis_types/pie/public/convert_to_lens/configurations/index.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/lens/public/visualizations/partition/render_helpers.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/lens/public/visualizations/partition/toolbar.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/lens/public/visualizations/partition/visualization.tsx
Outdated
Show resolved
Hide resolved
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.
Looks good overall. I just have some ideas on how to support future migrations we want to add. Using some kind of pass-through migration, similar to flow
, that migrates something and passes it to the next migration. Both converting to and from persitableState
, while avoiding multiple deep clones of the state.
...ins/chart_expressions/expression_partition_vis/public/components/partition_vis_component.tsx
Show resolved
Hide resolved
src/plugins/chart_expressions/expression_xy/public/components/xy_chart.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/lens/public/visualizations/partition/persistence.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/lens/public/visualizations/partition/persistence.tsx
Outdated
Show resolved
Hide resolved
...rvability_solution/ux/public/components/app/rum_dashboard/charts/visitor_breakdown_chart.tsx
Show resolved
Hide resolved
96a22d4
to
1592b96
Compare
💚 Build Succeeded
Metrics [docs]Module Count
Public APIs missing comments
Async chunks
Page load bundle
Unknown metric groupsAPI count
References to deprecated APIs
To update your PR or re-run it, just comment with: |
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 locally and it works great! 🥳
…ration for legend statistics (#181953) ## Summary To the code owners, This PR updates the saved object of Lens with the following changes: the property `valuesInLegend: boolean` is converted to the new property `legendStats: ["currentAndLastValue"]` (cartesian) or `legendStats: ["value"]`(partition) to accommodate displaying additional legend statistics in the future. There are no user-facing changes introduced. I have updated all saved object shapes in the code to adhere to the new structure. While the old structure will continue to function properly, this update ensures cleaner code. Fixes #181035 (phase 2). It's is a continuation of #180917. In comparison to the phase 1, we've removed the conversion of legendStats to valuesInLegend which was initially added in the previous PR to ensure backward compatibility for serverless applications. <img width="807" alt="Screenshot 2024-04-25 at 10 51 50" src="https://github.com/elastic/kibana/assets/4283304/6c23d035-f64d-4fb1-96c6-d30392ae6752"> I won't merge till the end of the week as it has to be released separately from phase 1. --------- Co-authored-by: Cauê Marcondes <[email protected]> Co-authored-by: Alex Szabo <[email protected]>
Summary
This PR addresses phase one of #181035.
Doesn't introduce any user facing changes.
It starts supporting a new saved object property
legendStats
while supporting a oldvaluesInLegend
property. In this PR,legendStats: ['values']
andvaluesInLegend:true
are treated as equal. When loading the saved object,valuesInLegend:true
is transformed tolegendStats:['values']
. After loading the document, the Lens app logic is built around the newlegendStats
property.When user saves the saved object, we do a reverse operation- we save the runtime state
legendStats:['values']
asvaluesInLegend: true
to ensure backwards compatibility.Changes for runtime state:
For xyCharts, the
valuesInLegend?: boolean
property is replaced with a more extensiblelegend.legendStats?: LegendStats[]
interfaceFor partition charts, the
showValuesInLegend?: boolean
property is replaced withlegendStats?: LegendStats[]
.after loading - in initialize function:
before saving :
In the future the
legendStats
prop would contain also other types of stats -see the issue.