-
Notifications
You must be signed in to change notification settings - Fork 16.3k
Add Calendar view for Dag #54252
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
Add Calendar view for Dag #54252
Conversation
feat(ui): Add Github style grid for Calendar tab fix(ui): Fix time format for importing dag runs to calendar
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.
Translation-wise, it looks good to me. would appreciate on a second pair of eyes
jscheffl
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.
Looks good to me in general. Thanks for the work!
I was also fearing a bit that the view is too large but find it very cool that you added a control to adjust cell size. This is then cool to adjust to individual screen size!
Some small layout nit, can you fix this up before merge?
(1) In some zoom levels the days are wrapped on the hourly view:

(2) Colors need some adjustment for dark mode... the colors especially on days w/o execution look a bit strange. Also the legend font colors are probably too dark gray for readability.

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/Calendar.tsx
Outdated
Show resolved
Hide resolved
airflow-core/src/airflow/ui/src/pages/Dag/Calendar/constants.ts
Outdated
Show resolved
Hide resolved
|
Here's a demo video of filter & show total filter_showtotal.mp4 |
Very cool! |
|
@RoyLee1224 You've missed one crucial use case: Seeing when the Dag will run. Not so useful with a daily or hourly scheduler, but crucial for more complex scheduling patterns, and was the original reason Calendar view was added to Airflow 2's UI |
Nice. What do the "Daily" and "Hourly" buttons do? How does a dag behave if it runs once a day? What about when it's 4 times a day? |
bbovenzi
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.
I appreciate the filters you added but I think those are not the ones we need. I feel like we're trying to make this calendar heatmap do too much at once
I would still like to remove:
- showing the count in the cell
- changing the cell size
What we do need:
- Let's just have a toggle between total count and failure count with a tooltip that always gives you the full breakdown. Both should be sequential colors just like the github commit history heatmap is only shades of green. Plus "planned" as a distinctly different color to be colorblind friendly.
- We can then simplify the legend and have it take up less screen space
- (Future PR) Clicking on a cell should link to a list of dagruns filtered to that date range and with state=failed if we were only showing the failed count. Or link directly to the dagrun if the count for that period is 1
airflow-core/src/airflow/ui/src/pages/Dag/Calendar/Calendar.tsx
Outdated
Show resolved
Hide resolved
|
(Future PR) We probably want to add better bar charts to the overview page too so that this calendar view is not trying to do too much. |
|
@bbovenzi Sure, sounds good! Those filters were just my experiment on a different branch, and I agree that simplifying is the right way to go. I've updated the PR with the changes you suggested:
The current static thresholds for
Please let me know what you think! calendar_v4.mp4 |
jscheffl
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.
For me this is looking very good (still) - LGTM so that we get this in 3.1!
(mini nit: The yearly view is a bit large, needs almost FHD screen to see the panel w/o scrolling. Might it make sense to make cell sizing a nit smaller? Non blocking though!)
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/DailyCalendarView.tsx
Outdated
Show resolved
Hide resolved
|
With 14px cell size, the 10px font (2xs) is a bit tight. Here are the options:
For now, I've implemented Option B in the latest commit, but I'm happy to change it depending on your preference. Let me know what you think!
|
For me both is OK |
bbovenzi
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.
LGTM
Great work and thanks for being so patient with so many comments. I think people will really enjoy this!
|
Oh and #protm |
|
Great work! #protm as well |
* feat(ui): WIP - Add initial scaffold for DAG Calendar view feat(ui): Add Github style grid for Calendar tab fix(ui): Fix time format for importing dag runs to calendar * feat(ui): enhance Dag Calendar with hourly/daily view * feat(ui): Implement state and Success Rate Spectrum for calendar view * feat(ui): implement debounced tooltip for calendar grid * feat(ui): enhance calendar view UX with improved loading and button * feat(ui): modify Success Rate Spectrum layout in hourly calender view * perf(ui): optimize calendar data processing * feat(ui): refactor calendar legend layout and improve hourly view positioning * feat(ui): improve calendar cellSize controls and hourly view text display * feat(ui): enhance calendar dark mode support and replace hardcoded RGB colors * refactor(ui): optimize calendar date state management * refactor(ui): Extract calendar tooltip logic into useDelayedTooltip hook * refactor(ui): reduce duplication in CalendarLegend * style(ui): improve calendar UI consistency and accessibility * fix(i18n): modify translations * fix(ui): remove cellsize changing function * feat(ui): GitHub-style heatmap, default to hourly. * fix(ui): Rename calendar colorMode to viewMode to avoid confusion with theme settings * style(calendar): reduce cell size to 14x14px and simplify weekday labels to single letters * refactor(ui): consolidate calendar cells * style(ui): modify calendar cell gap and legend size
* feat(ui): WIP - Add initial scaffold for DAG Calendar view feat(ui): Add Github style grid for Calendar tab fix(ui): Fix time format for importing dag runs to calendar * feat(ui): enhance Dag Calendar with hourly/daily view * feat(ui): Implement state and Success Rate Spectrum for calendar view * feat(ui): implement debounced tooltip for calendar grid * feat(ui): enhance calendar view UX with improved loading and button * feat(ui): modify Success Rate Spectrum layout in hourly calender view * perf(ui): optimize calendar data processing * feat(ui): refactor calendar legend layout and improve hourly view positioning * feat(ui): improve calendar cellSize controls and hourly view text display * feat(ui): enhance calendar dark mode support and replace hardcoded RGB colors * refactor(ui): optimize calendar date state management * refactor(ui): Extract calendar tooltip logic into useDelayedTooltip hook * refactor(ui): reduce duplication in CalendarLegend * style(ui): improve calendar UI consistency and accessibility * fix(i18n): modify translations * fix(ui): remove cellsize changing function * feat(ui): GitHub-style heatmap, default to hourly. * fix(ui): Rename calendar colorMode to viewMode to avoid confusion with theme settings * style(calendar): reduce cell size to 14x14px and simplify weekday labels to single letters * refactor(ui): consolidate calendar cells * style(ui): modify calendar cell gap and legend size







Related issues, discussions and PRs
closes: #54138
related issue: #52008
discussions: #50907
backend: #52748
Changes
success.400andsuccess.500in the theme for better readability. I've confirmed this change won't affect other parts of the UI. The lime green we see in the current UI is usingrunning.600.Discussions and suggestions on the UI design are highly welcome.
To-Do
getColorlogic to reflect the final run states (e.g., success -> green, failed -> red, mixed -> yellow, planned -> brown).GridTI.tsxto prevent performance issues.Screenshots
calendar_v2.mp4
Hourly View
Daily View
^ 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.