Skip to content

[Pie] Split chart "order by" control doesn't work for metrics#123810

Merged
DianaDerevyankina merged 4 commits intoelastic:mainfrom
DianaDerevyankina:issues/121092
Jan 31, 2022
Merged

[Pie] Split chart "order by" control doesn't work for metrics#123810
DianaDerevyankina merged 4 commits intoelastic:mainfrom
DianaDerevyankina:issues/121092

Conversation

@DianaDerevyankina
Copy link
Copy Markdown
Contributor

@DianaDerevyankina DianaDerevyankina commented Jan 26, 2022

Closes #121092

Summary

Set GroupBy sort value to "dataIndex" to respect source data columns order.

pie order by

For maintainers

@DianaDerevyankina DianaDerevyankina self-assigned this Jan 26, 2022
@DianaDerevyankina DianaDerevyankina added Feature:Pie Chart Pie chart visualization feature release_note:skip Skip the PR/issue when compiling release notes Team:Visualizations Team label for Lens, elastic-charts, Graph, legacy editors (TSVB, Visualize, Timelion) t// v8.1.0 labels Jan 26, 2022
return spec.id;
}}
sort={sort}
sort="dataIndex"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It make sense to me, @dej611 could you please confirm that it's ok

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems fine. But I could not find any documentation about the sorting predicate in the charting library. Maybe @markov00 or @nickofthyme could clarify its usage.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the dataIndex predicate means: don't sort, take as it comes from the dataset, FIFO.
Please @alexwizp use the enum Predicate.DataIndex rather then a string there

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok.... in that case it exactly what we need. Thank you all

@DianaDerevyankina DianaDerevyankina marked this pull request as ready for review January 28, 2022 10:02
@DianaDerevyankina DianaDerevyankina requested a review from a team as a code owner January 28, 2022 10:02
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/kibana-vis-editors @elastic/kibana-vis-editors-external (Team:VisEditors)

import React from 'react';
import { Accessor, AccessorFn, GroupBy, GroupBySort, SmallMultiples } from '@elastic/charts';
import { Accessor, AccessorFn, GroupBy, SmallMultiples } from '@elastic/charts';
import { Predicate } from '@elastic/charts/dist/common/predicate';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like @elastic/charts does not export directly the Predicate type. Maybe this should be fixed upstream?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, sorry about that. Let me export it and I can fix on a subsequent PR ok?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DianaDerevyankina
Copy link
Copy Markdown
Contributor Author

@elasticmachine merge upstream

@kibana-ci
Copy link
Copy Markdown

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
expressionPie 39.6KB 39.3KB -271.0B

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
expressionPie 11.3KB 11.3KB +47.0B

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @dziyanadzeraviankina

Copy link
Copy Markdown
Contributor

@dej611 dej611 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally with Safari 👍

@DianaDerevyankina DianaDerevyankina merged commit 8c0d75f into elastic:main Jan 31, 2022
@kibanamachine kibanamachine added the backport:skip This PR does not require backporting label Jan 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting Feature:Pie Chart Pie chart visualization feature release_note:skip Skip the PR/issue when compiling release notes Team:Visualizations Team label for Lens, elastic-charts, Graph, legacy editors (TSVB, Visualize, Timelion) t// v8.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Pie] Split chart "order by" control doesn't work for metrics

7 participants