-
Notifications
You must be signed in to change notification settings - Fork 16.3k
feat(ui): implement dynamic legend system for calendar #55155
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
pierrejeambrun
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, tested locally and working. That's a cool addition.
Just a few suggestion, mainly to make the code more readable because there is a lot of computation, cases to handle and it can be hard to read in the current state.
airflow-core/src/airflow/ui/src/pages/Dag/Calendar/Calendar.tsx
Outdated
Show resolved
Hide resolved
airflow-core/src/airflow/ui/src/pages/Dag/Calendar/calendarUtils.ts
Outdated
Show resolved
Hide resolved
airflow-core/src/airflow/ui/src/pages/Dag/Calendar/calendarUtils.ts
Outdated
Show resolved
Hide resolved
|
Hi @pierrejeambrun, I've pushed the updates addressing your comments. The code should be cleaner now. Please let me know what you think. Thanks! |
* feat(ui): implement dynamic legend system for calendar * refactor(ui): simplify calendar data handling * refactor(ui): extract calendar color constants
* feat(ui): implement dynamic legend system for calendar * refactor(ui): simplify calendar data handling * refactor(ui): extract calendar color constants
* feat(ui): implement dynamic legend system for calendar * refactor(ui): simplify calendar data handling * refactor(ui): extract calendar color constants
* feat(ui): implement dynamic legend system for calendar * refactor(ui): simplify calendar data handling * refactor(ui): extract calendar color constants
* feat(ui): implement dynamic legend system for calendar * refactor(ui): simplify calendar data handling * refactor(ui): extract calendar color constants
* feat(ui): implement dynamic legend system for calendar * refactor(ui): simplify calendar data handling * refactor(ui): extract calendar color constants
* feat(ui): implement dynamic legend system for calendar * refactor(ui): simplify calendar data handling * refactor(ui): extract calendar color constants
* feat(ui): implement dynamic legend system for calendar * refactor(ui): simplify calendar data handling * refactor(ui): extract calendar color constants
* feat(ui): implement dynamic legend system for calendar * refactor(ui): simplify calendar data handling * refactor(ui): extract calendar color constants
* feat(ui): implement dynamic legend system for calendar * refactor(ui): simplify calendar data handling * refactor(ui): extract calendar color constants
* feat(ui): implement dynamic legend system for calendar * refactor(ui): simplify calendar data handling * refactor(ui): extract calendar color constants
* feat(ui): implement dynamic legend system for calendar * refactor(ui): simplify calendar data handling * refactor(ui): extract calendar color constants
* feat(ui): implement dynamic legend system for calendar * refactor(ui): simplify calendar data handling * refactor(ui): extract calendar color constants
* feat(ui): implement dynamic legend system for calendar * refactor(ui): simplify calendar data handling * refactor(ui): extract calendar color constants
* feat(ui): implement dynamic legend system for calendar * refactor(ui): simplify calendar data handling * refactor(ui): extract calendar color constants
* feat(ui): implement dynamic legend system for calendar * refactor(ui): simplify calendar data handling * refactor(ui): extract calendar color constants
* feat(ui): implement dynamic legend system for calendar * refactor(ui): simplify calendar data handling * refactor(ui): extract calendar color constants
Closes #54951
Summary
Replaced the hardcoded color scale in the Calendar view with a dynamic system. The new scale is generated based on the true min/max of the data.
Key Changes:
Dynamic Legend: The legend now intelligently adjusts its labels and display type (gradient vs. single value) to match the data distribution.
Fixes Low-Variance Display: Correctly handles cases where run counts are uniform (e.g., all days have 5 runs). The view now shows an appropriate medium-intensity color and a single-value legend, instead of a misleading maximum color.
Screenshots:
dynamic_legend.mp4
UI in different scenario (with mock data)
^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named
{pr_number}.significant.rstor{issue_number}.significant.rst, in airflow-core/newsfragments.