schizophrenicmaniac opened a new pull request, #21850: URL: https://github.com/apache/echarts/pull/21850
<!-- Please fill in the following information to help us review your PR more efficiently. --> ## Brief Information This pull request is in the type of: - [x] bug fixing - [ ] new feature - [ ] others ### What does this PR do? Takes `axis.inverse` into account when `layOutGridByOuterBounds` computes the label proportion, so an inverted axis no longer collapses the grid. ### Fixed issues - #21839: [Bug] Inverse axis collapses the grid with outerBoundsContain when a tick is near the axis edge ## Details ### Before: What was the problem? With `outerBoundsContain` set, the label proportion comes from `axis.scale.normalize()`, which ignores `inverse`. On an inverted axis a tick that is right at one edge was treated as being at the opposite edge, so `applyProportion` divided its few pixels of overflow by ~0.001 and the grid shrank to its minimum. With the option from the issue in a 600×400 container the grid was about 64px tall instead of 237px. ### After: How does it behave after the fixing? The proportion is flipped for inverted axes before the existing y-axis flip, so the grid gets the same size with or without `inverse: true`. Added a unit test in `test/ut/spec/component/grid/outerBounds.test.ts` covering both an inverted y axis and an inverted x axis. ## Document Info One of the following should be checked. - [x] This PR doesn't relate to document changes - [ ] The document should be updated later - [ ] The document changes have been made in apache/echarts-doc#xxx ## Misc ### Security Checking - [ ] This PR uses security-sensitive Web APIs. <!-- PLEASE CHECK IT AGAINST: <https://github.com/apache/echarts/wiki/Security-Checklist-for-Code-Contributors> --> ### ZRender Changes - [ ] This PR depends on ZRender changes (ecomfe/zrender#xxx). ### Related test cases or examples to use the new APIs N.A. ### Merging options - [ ] Please squash the commits into a single one when merging. ### Other information -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
