-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Timeline for visualizing jobs #15165
base: dev
Are you sure you want to change the base?
Conversation
Added 4 random colors to the bars
…istakely applied to entire app, got rid of patches and related dependency
…center mistakely applied to entire app, got rid of patches and related dependency" This reverts commit 13f1549.
Gitdependency for gantt | Bug fixes
…istakely applied to entire app, got rid of patches and related dependency
…ory. fix: No more failing API calls, Code doesn't break if History is still not loaded, refactoring and code enhancements
Dev to Gantt
…r based on the tag name hash value. The css class is generated and assigned dynamically to achieve this.
BarColours with random colours using keyedColorScheme and code cleanup
…Added the KeyedColorScheme to the buttons
…ainsitions when swithcing between histories
… config for gantt testing in jest config. test: add first test case for gant.vue
…buttons when loading; refactor: disable buttons when pressed
… hisory clears gantt; fix: client-lint fix
client/src/components/History/GanttVisualisation/DateTimeModal.vue
Outdated
Show resolved
Hide resolved
Some comments from a discussion in IWC, after sharing my own implementation of similar, based around workflow invocations specifically
hope it gets picked up again / merged someday!! |
Visualizing jobs on a timeline
As we know that Histories contains of Jobs, and these jobs have a start time and end time as returned by the Job Metrics, This visualization takes all these jobs and adds them to a timeline graph so-called "Gantt Chart".
For implementing the Gantt Chart we are using the so-called Frappe-Gantt. src: https://github.com/frappe/gantt
The main benefit for a user to use this feature is that they can easily study the gantt-chart and make out which jobs took long, which ones were short, which tasks overlapped, when did they start and when did they end etc. Apart from that the users can switch between different views to find out which jobs they have performed over a month, a week, in a day, or over the span of a few minutes. The different views that the user can switch between are:
Because of these changes to the original library, we will be using this modified version of frappe-gantt from https://github.com/MOHITRAJANI/gantt-advanced
Histories can be easily switched over and user will immediately see gantt chart for the new current history
Gantt visualization also shows a spanned message for indicating when the History is empty, i.e. It doesn't have any jobs. Also for empty history, the buttons become disabled.
The tasks for this feature are performed by Me and @shubham4315 as a part of our Masters Project.
Details about all changes made in the original frappe/gantt library
As already mentioned that there were many additional functionalities that we needed which were unfortunately not present in the library, so I (Mohit Rajani) went ahead and started adding the functionalities in the library. Hence for this project, the src of frappe/gantt is not the original github of the library but rather it's my fork to the library with all the additional functionalities and improvements. This description also mentions the filenames where these particular changes can be found.
Hour scale was added as a view-mode to the library, For adding this functionality all the changes were made in the index.js file inside the src directory of the library, I had to work on the following tasks:
Minute Scale was added to the View-mode. All changes for this functionality were done in src/index.js. The tasks for the functionality are same as above, but here the calculations were much more complex. Also, the start time before the first chronological task for minute scale is just another Minute so that the user does not have to scroll a lot only for finding the first task.
Addition of a new SVG i.e the Diamond SVG to the library, this functionality was added because in most of the original scales provided by the library, the tasks were too small as compared to the scales, and due to this, the bar would look as small as a dot in that scale, hence to have a unique indication for a very small task on a comparatively big scale this feature was added. The changes for this feature were made in the src/Bar.js file. The changes for this functionality involved these tasks:
Dynamically deciding the position of the popover on the tasks. This functionality was added because of an observation made by @itisAliRH that when the tasks are quiet long, some or most part of the bar goes outside the screen and you have to scroll until the end of the task to see its popup as originally the popup was made on the right side by the library. The changes for this functionality were made in the src/popup.js and the changes are as under:
The original library had additional feature of dragging and dropping the tasks, and to resize them, but we did't want this functionality as our tasks were fixed and hence this functionality was removed from the sec/index.js file. Also now that we didn't want the drag and drop feature.
Some CSS changes were also done in the src/gantt.scss file. The main additions in css were:
How to test the changes?
License