-
- Downloads
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:
adam-james <21064735+adam-james-v@users.noreply.github.com>
Showing
- src/metabase/pulse/render/body.clj 131 additions, 69 deletionssrc/metabase/pulse/render/body.clj
- test/metabase/pulse/render/body_test.clj 68 additions, 48 deletionstest/metabase/pulse/render/body_test.clj
- test/metabase/pulse/render/test_util.clj 81 additions, 46 deletionstest/metabase/pulse/render/test_util.clj
Loading
Please register or sign in to comment