-
Notifications
You must be signed in to change notification settings - Fork 0
Implement layout.barbase (closes issue 475) #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
* Simplified algorithm to identify overlapping bars. * Removed the closure setBarCenter. * Checked that jasmine tests still pass.
* Converted the closure that groups vertical and horizontal bars into a function. * This change will help split setPositions into functions for each barmode.
* Moved code to group bars from setGroupPositions to setPositions.
* Converted closure `barpositions` into function `setOffsetAndWidth`. * This change will help split setPositions into functions for each barmode.
* Don't assume the position axis is `xa` in the calculation of `barDelta` in `bar/hover.js`. * Updated `tests/bar_test.js` to account for the replacement of `t.bar` with `t.bargroupwidth`. * Updated the group case in `tests/bar_test.js` to test the use of `layout.bargroupgap`.
* Refactored the code to set bar positions in overlay mode into function `setGroupPositionsInOverlayMode`.
* Refactored the code for setting bar positions into setGroupPositionsInOverlayMode, setGroupPositionsInGroupMode and setGroupPositionsInStackOrRelativeMode. * Refactored code for stacking bars and computing minDiff into helper class Sieve.
* Renamed setBaseAndSize to stackBars. * Refactor code to normalize bars into function normalizeBars.
* Fix: do not normalise bars with no size * Fix: update minDtick if barmode is group and bars overlap. Closes plotly#475
@n-riesco your refactoring commits are looking good. 🎉 Thanks! I apologise again for the I'm a little concerned about merging this in though as Thanks again for your hard work. |
I'm working on issues plotly#475 and plotly#80 . Both require changes in
set_positions.js
. For this reason, this PR not only implementslayout.barbase
(issue plotly#475), but also refactors the code inset_positions.js
into functions for eachlayout.barmode
. This change will help me with the next PR to implement issue plotly#80.I think it's best to review each commit separately.