[Lens] Add median operation#79453
Conversation
|
Pinging @elastic/kibana-app (Team:KibanaApp) |
|
Just like we discussed, one of the options would be to overwrite eui Maybe Caroline know better tricks here. Apart from that, I love how simple this PR is 👏 |
wylieconlon
left a comment
There was a problem hiding this comment.
There is a bug when using the Median as the sort order for the Terms aggregation, and it causes the visualization to throw an Elasticsearch error:
reason: "Invalid aggregation order path [5910a8af-b666-4c2c-84d2-8c9560b1628e]. When ordering on a multi-value metrics aggregation a metric name must be specified."
type: "aggregation_execution_exception"
I'm fine with this workaround to the column spacing. The root cause of the issue appears to be the vertical centering logic in EuiListGroupItem, so without a PR to EUI this looks like one of the cleaner solutions.
There
|
Great catch @wylieconlon - I checked and this is a shortcoming of the AggType.
@mbondyra Seems like this PR is about to get a little more complex, sorry ;-) |
| listItems={ | ||
| // add a padding item containing a non breakable space if the number of operations is not even | ||
| // otherwise the column layout will break within an element | ||
| sideNavItems.length % 2 === 1 ? [...sideNavItems, { label: '\u00a0' }] : sideNavItems |
There was a problem hiding this comment.
This solution is fine with me so long as it doesn't create an item that behaves inertactable with a blank label.
|
I set up a separate PR to fix the median ordering here: #79839 This PR is blocked till then. |
|
@elasticmachine merge upstream |
|
@elasticmachine merge upstream |
💚 Build SucceededMetrics [docs]async chunks size
History
To update your PR or re-run it, just comment with: |
* master: (51 commits) [Discover] Unskip flaky test (elastic#80670) Fix security solution template label (elastic#80754) [Ingest]: ignore 404, check if there are transforms in results. (elastic#80721) Moving loader to logo in header, add a slight 250ms pause (elastic#78879) [Security Solution][Cases] Fix bug with case connectors (elastic#80642) Update known-plugins.asciidoc (elastic#75388) [Lens] Add median operation (elastic#79453) Fix navigateToApp logic when navigating to the current app. (elastic#80809) [Visualizations] Fix bad color mapping with multiple split series (elastic#80801) [ILM] Add esErrorHandler for the new es js client (elastic#80302) Fix codeowners (elastic#80826) skip flaky suite (elastic#79463) [Timelion] Remove kui usage (elastic#80287) [Ingest Manager] add skipIfNoDockerRegistry to package_install_complete test (elastic#80779) [Alerting UI] Disable "Save" button for Alerts with broken Connectors (elastic#80579) Allow the default space to be accessed via `/s/default` (elastic#77109) Add script to identify plugin dependencies for TS project references migration (elastic#80463) [Search] Client side session service (elastic#76889) feat: 🎸 add separator for different context menu groups (elastic#80498) Lazy load reporting (elastic#80492) ...
Fixes #74889
This PR adds a median operation similar to min and max to Lens.
As this makes the number of operations odd for the y axis dimension group of the xy chart, I had to add some logic to add a dummy item in there (https://github.com/elastic/kibana/pull/79453/files#diff-5c0e534b2b688cca97714cf5500805b4R268-R270) - otherwise the css column layout would break within an operation item like this:

I tried to prevent this on the CSS level (
-webkit-column-break-inside: avoid) but didn't have any luck. @cchaos maybe you know a better option.