DamianPendrak opened a new pull request, #31308:
URL: https://github.com/apache/superset/pull/31308

   <!---
   Please write the PR title following the conventions at 
https://www.conventionalcommits.org/en/v1.0.0/
   Example:
   fix(dashboard): load charts correctly
   -->
   Fixes #30877
   
   ### SUMMARY
   This PR resolves an issue where annotation layers data were not updated when 
the chart orientation changed to horizontal. Previously, while x and y axis 
chart data were swapped, the annotation layers data were not transformed 
accordingly.
   
   I decided to change the data in transform annotation functions based on the 
new `orientation` optional prop. I could use `isHorizontal`, but I think the 
`orientation` prop will provide better readability with 
`OrientationType.Horizontal` instead of `true`.
   
   I created tests specifically for the changes, focusing on the chart data 
transform and the data changes when chart is horizontal.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   Before
   ![Screenshot 2024-12-05 at 17 56 
14](https://github.com/user-attachments/assets/bb6f1000-269e-48e3-a785-23363f725e7a)
   
   After
   ![Screenshot 2024-12-05 at 17 50 
47](https://github.com/user-attachments/assets/e6940177-748c-4a56-aa6e-3958845f90a7)
   
   ### TESTING INSTRUCTIONS
   1. Create a horizontal bar chart.
   2. Add any annotation to the chart.
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [ x] Has associated issue: #30877
   - [ ] Required feature flags:
   - [ ] 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]

Reply via email to