Skip to content
Snippets Groups Projects
Unverified Commit f21c7c21 authored by metabase-bot[bot]'s avatar metabase-bot[bot] Committed by GitHub
Browse files

Improving axes grouping/splitting in static viz. (#28295) (#29148)


* WIP for better axes grouping in static viz.

Double x-axis and single x-axis are different, but both can have situations where grouping might occur, so the
implementation is a tad confusing. I'm trying to build test cases that represent both scenarios reasonably, and build
an implementation that's not too confusing.

* Fix reflection warnings in render test utils

* Overlap calcs don't fail with BigDecimal inputs now.

* Continuing to clean up overlaps calcs and impl for single/double in progress

* WIP version that works for single-x multi-series and double-x multi

There's a lot to think about here...

But basically, handle rows of shape:

double-x:

[[x1 x2] [y]]

and single-x:

[[x] [y1 y2 y3]]

* Single and Multi X axis now use same axes grouping strategy

* Cover some overlap scoring cases.

This may need improving in future still, but the overlap calculation is at least used for both single-x and multi-x
axis scenarios now, which is a definitie improvement.

* Missed these unused bindings in test let body

* overlap calc won't fail if we pass in `[nil nil]`

* Clean up grouping axes implementation addressing review feedback.

- overlap and nearness split into two functions
- add the fn 'axis-group-score' to call overlap/nearness appropriately, and handle condition checks (eg. nil vals)
- removed old group-axes and now unnecessasry default-y-axis-pos fn -> handled by group-axes-at-once fn
- axis group threshold not passed as arg anymore

* Fixed some alignment mistakes

Co-authored-by: default avataradam-james <21064735+adam-james-v@users.noreply.github.com>
parent 2edaa563
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment