rahul37wallst-sudo opened a new pull request, #21668: URL: https://github.com/apache/echarts/pull/21668
<!-- 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? Fixes slider dataZoom data shadow rendering for single-point time-axis series by avoiding NaN shadow coordinates. ### Fixed issues - #21649: dataZoom slider `showDataShadow` renders nothing when the shadow-source series has a single data point on a time axis. ## Details ### Before: What was the problem? For slider dataZoom with `showDataShadow: true` on a time axis, a single-point shadow-source series produced a zero-width data extent. That made the time-axis shadow coordinate normalization divide by zero: ```ts size[0] / (thisDataExtent[1] - thisDataExtent[0]) ``` The resulting `Infinity` could then produce `NaN` shadow coordinates, causing the slider data shadow to disappear. ### After: How does it behave after the fixing? The time-axis proportional coordinate path is now used only when the data extent span is positive and finite. For single-point time-axis data, the slider data shadow falls back to the existing step-based coordinate path, keeping polygon/polyline points finite and allowing the shadow to render. A regression test was added for a single-point time-axis slider dataZoom case. ## 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 Added unit regression test: - `test/ut/spec/component/dataZoom/SliderZoomView.test.ts` Validation run: - `npx jest --config test/ut/jest.config.cjs --coverage=false test/ut/spec/component/dataZoom/SliderZoomView.test.ts --runInBand` - `npx eslint src/component/dataZoom/SliderZoomView.ts test/ut/spec/component/dataZoom/SliderZoomView.test.ts` - `git --no-pager diff --check` - `npm run checktype` ### 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]
