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

Use isobands in the "smooth" representation (so that the fillOpacity parameter makes sense) #111

Open
mthh opened this issue Mar 16, 2023 · 1 comment

Comments

@mthh
Copy link
Member

mthh commented Mar 16, 2023

Currently, the contour polygons generated by d3.contours include all points above a given threshold value (instead of isobands which include all points between two given values).
This causes the different features in your contour layer to overlap.

So, when I set fillOpacity to 0.3 (for example to see, by transparency, the administrative units below) it makes a weird rendering, since the entities overlap, and it makes it impossible to see the entities under the smooth representation (where the lowest class does take transparency into account, but due to the overlap between entities in the contour layer, it becomes impossible to see through entities in higher classes).
See for example your Cholera Map in https://observablehq.com/@neocartocnrs/smooth (where we can't see through the polygons, except for the lowest level in green, despite a fillOpacity of 0.3)

You could consider turf-isobands rather than d3 contours to generate the contours.

@mthh mthh changed the title Use isobands in the *smooth* representation (so that the fillOpacity parameter makes sense) Use isobands in the "smooth" representation (so that the fillOpacity parameter makes sense) Mar 16, 2023
@Fil
Copy link
Contributor

Fil commented Mar 16, 2023

d3/d3-contour#71

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants