Skip to content
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

changed label setting to match 11.2.7 behavior #624

Merged
merged 1 commit into from
Sep 28, 2023
Merged

Conversation

ennerf
Copy link
Collaborator

@ennerf ennerf commented Sep 28, 2023

I double checked the automatic axis-label setting, and the 11.2.7 behavior was that each renderer tries to use the first dataset. Once the labels get set, a boolean state ensures that the labels do not get overwritten later.

This PR changes the behavior to match the 11.2.7 release.

@sonarcloud
Copy link

sonarcloud bot commented Sep 28, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@pr-explainer-bot
Copy link

Pull Request Report

Hey there! I've analyzed the pull request and here's the report for you:

Changes

  1. Removed the import statement for io.fair_acc.chartfx.axes.spi.CategoryAxis in XYChart.java (line 5).
  2. Removed the code block that updates categories for CategoryAxis in XYChart.java (lines 15-34).
  3. Modified the condition in the updateCategories method of CategoryAxis.java (line 8).
  4. Removed the isUsingAxis method from Renderer.java (lines 18-23).
  5. Modified the updateAxes method in AbstractRendererXY.java to update categories for CategoryAxis (lines 14-19).
  6. Removed the isUsingAxis method from AbstractRendererXY.java (lines 24-29).
  7. Removed the isUsingAxis method from AbstractRendererXYZ.java (lines 6-10).

Suggestions

  1. Consider adding comments to explain the purpose of the removed code blocks and methods.

Bugs

  1. No bugs found.

Improvements

  1. The code in XYChart.java (lines 15-34) can be refactored for better readability. Here's an improved version:
if (axis instanceof CategoryAxis catAxis) {
    for (Renderer renderer : getRenderers()) {
        if (renderer.isUsingAxis(axis) && !renderer.getDatasets().isEmpty()) {
            catAxis.updateCategories(renderer.getDatasets().get(0));
            break;
        }
    }
}

Rating

I would rate the code a 7 out of 10. The code is generally readable and performs well. However, there are some areas that could be improved for better readability and maintainability.

That's it for the report! Let me know if you need any further assistance. Cheers!

@codecov
Copy link

codecov bot commented Sep 28, 2023

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (9508d3c) 48.09% compared to head (5db1a9b) 48.09%.

Additional details and impacted files
@@            Coverage Diff            @@
##               main     #624   +/-   ##
=========================================
  Coverage     48.09%   48.09%           
- Complexity     6213     6215    +2     
=========================================
  Files           374      374           
  Lines         38299    38288   -11     
  Branches       6110     6105    -5     
=========================================
- Hits          18419    18416    -3     
- Misses        18721    18725    +4     
+ Partials       1159     1147   -12     
Files Coverage Δ
...art/src/main/java/io/fair_acc/chartfx/XYChart.java 58.13% <ø> (+1.10%) ⬆️
...in/java/io/fair_acc/chartfx/renderer/Renderer.java 59.25% <ø> (+2.11%) ⬆️
..._acc/chartfx/renderer/spi/AbstractRendererXYZ.java 70.96% <ø> (+2.21%) ⬆️
...ava/io/fair_acc/chartfx/axes/spi/CategoryAxis.java 23.45% <0.00%> (-7.41%) ⬇️
...r_acc/chartfx/renderer/spi/AbstractRendererXY.java 83.60% <25.00%> (-0.77%) ⬇️

... and 4 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@wirew0rm wirew0rm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, looks good 👍

@wirew0rm wirew0rm merged commit 0c30d6a into main Sep 28, 2023
11 of 12 checks passed
@wirew0rm wirew0rm deleted the ennerf/cat-axes branch September 28, 2023 11:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants