-
Notifications
You must be signed in to change notification settings - Fork 76
[#449] - Improve coloring of tree maps #455
Conversation
Codecov Report
@@ Coverage Diff @@
## master #455 +/- ##
============================================
+ Coverage 72.78% 72.79% +0.01%
- Complexity 1014 1025 +11
============================================
Files 87 88 +1
Lines 3770 3816 +46
Branches 437 439 +2
============================================
+ Hits 2744 2778 +34
- Misses 878 891 +13
+ Partials 148 147 -1
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
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.
Would it help to use white as text color?
| <st:header name="Content-Type" value="text/html;charset=UTF-8"/> | ||
|
|
||
| <bs:page it="${it}" class="fluid-container d-flex flex-column"> | ||
| <bs:page it="${it}" class="fluid-container d-flex flex-column h-100"> |
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.
This breaks the visualization on smaller displays.
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.
Can we remove these unrelated changes? Then we can merge the color PR and create a new release.
| </ul> | ||
|
|
||
| <div class="tab-content"> | ||
| <div class="tab-content h-100"> |
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.
See above
plugin/src/main/webapp/js/charts.js
Outdated
| gapWidth: 2, | ||
| borderColorSaturation: 0.7 | ||
| gapWidth: 3, | ||
| borderColorSaturation: 0.8 |
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.
In total I think the greens look better, but the reds not.
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.
the tree map is shown on the whole screen now
The problem with that approach is, that you then need to scroll on small displays. I found no way yet to always use the whole visible screen only for the trees. Maybe the problem is that the side panel is too large.
Okay, well I do not have a small screen and when I try it by resizing the window, it fills just the visible screen due to the resize event, but this might behave differently on a real small screen.
I totally agree - I tried some different approaches and found a better solution. I am not available for two weeks now, so I would update the code afterwards - but maybe you can already give me some feedback on the new approach? |
I would rather prefer to create different views for small and large screens. This shouldn't be too hard with Bootstraps classes. See https://github.com/jenkinsci/code-coverage-api-plugin/blob/master/plugin/src/main/resources/coverage/coverage-table.jelly#L14 for an example (See https://getbootstrap.com/docs/5.2/layout/grid/ for a documentation of all responsive classes)
The new colors look better now. I wonder if we should use the red, orange and green colors of Jenkins as well here? |
So you mean we can add
Yes of course, so you mean to change the currently used colors in |
Yes, that shouldn't be too hard to implement.
Getting them dynamically should work for the charts if we change the proxy methods: So rather than using we could use and fill (See https://weekly.ci.jenkins.io/design-library/Colors/ for the available colors). You can get the colors then via: Then the colors automatically will be adapted to the selected theme. |
I agree, this looks like a good solution.
Thanks for the explanation. |
It works the other was round: there is no way for the server to call the client (and there is no API on the client side). You need to wrap all information in an existing Ajax call from the client to the server: In Jenkins processing is started on the client where the user selects the HTTP address. This is mapped on the server side into a jelly view. This jelly view is then rendered as HTML and send to the client that will render it. In this view we can invoke an associated JS file and call back to the server using Ajax. I.e., when the client currently starts a request to get the coverage data (the chart is empty in the jelly view) the client can provide an additional parameter (that is the reason that I am proposing a JSON object on the JS side, where we can put everything into what we want. I use the same thing in the trend chart configuration). This JSON can be interpreted on the server side to extract the colors. An enum will not work as it is constant on the server side, but actually each client might have its own colors. Maybe we can setup a call to discuss this part in more detail? |
|
Yes, this would be perfect! I sent you an email. |
# Conflicts: # plugin/src/main/resources/io/jenkins/plugins/coverage/model/CoverageViewModel/index.jelly
|
@uhafner I finished the color rework. |
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 like the new design! The only mandatory changes are the viewpoint adjustments which are unrelated to this PR and should be changed in a different PR.
plugin/src/main/java/io/jenkins/plugins/coverage/model/CoverageTableModel.java
Outdated
Show resolved
Hide resolved
...ava/io/jenkins/plugins/coverage/model/visualization/colorization/CoverageColorJenkinsId.java
Outdated
Show resolved
Hide resolved
| <st:header name="Content-Type" value="text/html;charset=UTF-8"/> | ||
|
|
||
| <bs:page it="${it}" class="fluid-container d-flex flex-column"> | ||
| <bs:page it="${it}" class="fluid-container d-flex flex-column h-100"> |
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.
Can we remove these unrelated changes? Then we can merge the color PR and create a new release.
plugin/src/main/resources/io/jenkins/plugins/coverage/model/CoverageViewModel/index.jelly
Outdated
Show resolved
Hide resolved
plugin/src/main/resources/io/jenkins/plugins/coverage/model/CoverageViewModel/index.jelly
Outdated
Show resolved
Hide resolved
plugin/src/main/resources/io/jenkins/plugins/coverage/model/CoverageViewModel/index.jelly
Outdated
Show resolved
Hide resolved
plugin/src/main/resources/io/jenkins/plugins/coverage/model/CoverageViewModel/index.jelly
Outdated
Show resolved
Hide resolved
plugin/src/main/resources/io/jenkins/plugins/coverage/model/CoverageViewModel/index.jelly
Outdated
Show resolved
Hide resolved
plugin/src/main/resources/io/jenkins/plugins/coverage/model/CoverageViewModel/index.jelly
Outdated
Show resolved
Hide resolved
|
Nice to hear and thanks for the review! |
In order to make the tree map easier to read, I changed the colors handling.
Now, the Jenkins colors from the Design Library are used and loaded dynamically for the table and the tree view.
Examples:
before:


after:
before:


after: