villebro opened a new pull request, #45955: URL: https://github.com/apache/superset/pull/45955
### SUMMARY Reverts the bar-width half of #44628, as agreed on #45474. #44628 capped each bar's width at one time-grain bucket, measured across the full date span of the data (`getGrainBarMaxWidth`). That assumes each row is one grain bucket and that the chart always shows the full date span, and both assumptions break in common cases: - **Rows spaced further apart than the grain.** Yearly rows at the default Day grain get bars about 1/1826 of the plot wide, i.e. hairlines (#45474). - **Zoom.** The cap is a fixed pixel value computed for the full range, so zooming in only spreads the bars apart and never widens them: 4.6px versus 30.5px on 6.1 for a dense hourly chart zoomed to about 17 hours, as measured on #45474. This removes `getGrainBarMaxWidth`, its call sites in `Timeseries/transformProps.ts` and `MixedTimeseries/transformProps.ts`, and the constants #44628 added for it (`ONE_DAY_MS` and the sub-hour `TIMEGRAIN_TO_TIMESTAMP` entries), restoring the `barMaxWidth: 100` that 6.1 shipped. The sub-hour `TIMEGRAIN_TO_TIMESTAMP` entries also fed the time axis's `minInterval`/`maxInterval` for sub-hour grains, so those return to their 6.1 behavior too. Sparse sub-daily data, the case #44628 targeted, is better served by Advanced Analytics -> Null Imputation, which gives the chart the empty buckets it needs. The other half of #44628, the `coltypes`/`is_dttm` fallback that keeps a temporal x-axis from being mislabeled with raw epoch values, is kept along with its tests. Those tests move from `sparseSubDailyBarGeometry.test.ts` to `xAxisTemporalFallback.test.ts` to match what they cover; the bar-width tests and the `getGrainBarMaxWidth` unit tests are removed with the code. This supersedes #45519, which limited the cap to sub-daily grains but left the zoom problem and the sub-daily spacing mismatch in place. ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF See the measurements and renders in https://github.com/apache/superset/issues/45474#issuecomment (the 6.1 column is the behavior this restores). ### TESTING INSTRUCTIONS - `npm run test -- plugins/plugin-chart-echarts`: 1562 tests pass. - Manually: a bar chart of yearly data at the default Day grain renders full-width bars again (as on 6.1), and zooming into a dense hourly bar chart widens the bars. ### ADDITIONAL INFORMATION - [x] Has associated issue: Fixes #45474 - [ ] Required feature flags: - [x] Changes UI - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351)) - [ ] Migration is atomic, supports rollback & is backwards-compatible - [ ] Confirm DB migration upgrade and downgrade tested - [ ] Runtime estimates and downtime expectations provided - [ ] Introduces new feature or API - [ ] Removes existing feature or API -- 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]
