-
Notifications
You must be signed in to change notification settings - Fork 185
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
Add default tips for the geo mark #2087
Comments
Don't know how expensive SDF or similar would be comparison to centroid calculations, but if it is too costly, in my experience taking the centroid of the largest polygon in a multi polygon almost always captures a representative centre point. The more problematic cases can be heavily concave features (e.g. a 'C' shape mostly surrounding a different convex polygon). There a midpoint from some kind of skeletonisation might be more meaningful, but won't be cheap. |
The best solution IMO would be to use the “pole of inaccessibility” transform (discussed in #1587 — which I had failed to mention yesterday), as implemented in mapbox/polylabel. This could be the default for #2088 — it is a pragmatic approach that would make interactive tips behave nicely in general (and could also result in better placement for labels). More speculatively, I also want to suggest a new geo option value for Plot.pointer (besides x, y and xy), which would point to the closest geometry. The way I would do this:
|
If the geo mark has no x and y channels, it would be nice if the tip option worked. It could create x and y with a centroid initializer. However, a system that tracks the closest geometry, relying on distance to the shape rather than to its centroid, would arguably be better. The difference in strategy is striking if you consider France, whose centroid is in the Atlantic, because Guyane. But centroids show the small features better.
(Note: this is a duplicate of #1743)
The text was updated successfully, but these errors were encountered: