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

Graduated zeroes error #1170

Merged
merged 12 commits into from
Mar 6, 2024

Conversation

AlexanderGeere
Copy link
Contributor

@AlexanderGeere AlexanderGeere commented Mar 5, 2024

When the value on graduated theme is zero the style is never set, even if there is a zero category.

This PR will set the style if one has not been set.

Using graduated_theme in bugs_testing, the polygon over birmingham will be blank on main, and will fill with green correctly on this PR.


@simon-leech simon-leech added the Bug A genuine bug. There must be some form of error exception to work with. label Mar 5, 2024
Copy link
Member

@dbauszus-glx dbauszus-glx left a comment

Choose a reason for hiding this comment

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

This doesn't seem right.

The three polygons have respective values of 0, 0.4, 0.6 and should display as the first three categories.

image

@dbauszus-glx
Copy link
Member

@AlexanderGeere Please check my last commit. I think this can be done with array methods.

  if (!isNaN(catValue) && catValue !== null) {

    const isLassThan = cat => catValue <= cat.value;

    let index = theme.cat_arr.findIndex(isLassThan)

    let cat = theme.cat_arr.at(index)

    let catStyle = structuredClone(cat.style || cat)

    delete catStyle.label

    mapp.utils.merge(feature.style, catStyle)
  }

@AlexanderGeere
Copy link
Contributor Author

AlexanderGeere commented Mar 6, 2024

@dbauszus-glx Works in the graduated_theme work space as well, looks a lot cleaner too. Nice!

I fixed a small typo, and merged main.

Copy link

sonarcloud bot commented Mar 6, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@dbauszus-glx dbauszus-glx self-requested a review March 6, 2024 09:31
Copy link
Contributor

@simon-leech simon-leech left a comment

Choose a reason for hiding this comment

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

Working for me too!

@RobAndrewHurst RobAndrewHurst merged commit db9ef6e into GEOLYTIX:main Mar 6, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A genuine bug. There must be some form of error exception to work with.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants