Group Axes for Multi-series static viz (#26145)
* First pass at grouping axes This PR uses the results_metadata key to look at fingerprints for numerical axes to try determine if each series on the Y axis can be sanely represented on the same axis. This is done by calculating an overlap (some value between 0 and 1) and grouping all axes on the LEFT if they pass the threshold, which is some value between 0 and 1. The overlap is always calculated when there is SOME overlap between the ranges of each axis, and is calculated as: ```clojure (/ (- (max maximums) (min minimums)) (- (min maxiumums) (max minimums))) ``` This is done to try catch situations where one column's range is entirely inside the other, but is much smaller (- max min); such a case would have a small percent overlap by the above calculation, and implies that it might be better to split the axes. * Address feedback. * Fix shape of data in tests of 2 private fns * Add test for split axes * Fixed error in test util * render-utils does with-redef, disallows parallel tests. Makes sense
Showing
- dev/src/dev/render_png.clj 2 additions, 2 deletionsdev/src/dev/render_png.clj
- src/metabase/pulse/render/body.clj 76 additions, 10 deletionssrc/metabase/pulse/render/body.clj
- test/metabase/pulse/render/body_test.clj 33 additions, 11 deletionstest/metabase/pulse/render/body_test.clj
- test/metabase/pulse/render/test_util.clj 31 additions, 7 deletionstest/metabase/pulse/render/test_util.clj
Please register or sign in to comment