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

[Maps] scale marker size by area #131911

Merged
merged 6 commits into from
May 11, 2022
Merged

[Maps] scale marker size by area #131911

merged 6 commits into from
May 11, 2022

Conversation

nreese
Copy link
Contributor

@nreese nreese commented May 10, 2022

Fixes #131698

This PR updates the maplibre style expression to interpolate over the square root of value instead of value to avoid distorting proportions when styling marker areas.

This has the visual effect of making markers for smaller values larger by reducing the interpolation range.
For example, with a marker size range of [8, 32] and a data range of [0, 100]

  • before the change, the interpolation stops would be 0, 8, 100, 32,
  • after the change, the interpolation stops are 1, 8, 10.04987562112089, 32. Notice how the data range was reduced from [0, 100] to [1, 10.04987562112089] (there is also a value shift to avoid taking square root of zero or a negative number).
Before

Screen Shot 2022-05-10 at 6 46 53 AM

After

Notice the larger circles for the values in Alaska
Screen Shot 2022-05-10 at 6 47 06 AM

@nreese nreese added release_note:enhancement [Deprecated-Use Team:Presentation]Team:Geo Former Team Label for Geo Team. Now use Team:Presentation backport:skip This commit does not require backporting v8.3.0 labels May 10, 2022
@nreese
Copy link
Contributor Author

nreese commented May 10, 2022

@elasticmachine merge upstream

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
maps 792 793 +1

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
maps 2.5MB 2.5MB -153.0B

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@nreese nreese marked this pull request as ready for review May 10, 2022 14:29
@nreese nreese requested a review from a team as a code owner May 10, 2022 14:29
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-gis (Team:Geo)

@nreese nreese requested review from jsanz and gvnmagni May 10, 2022 14:29
@jsanz
Copy link
Member

jsanz commented May 10, 2022

This is looking great, showing side to side between this PR on the left and current view (8.2.0) on the right, as in the PR description, the size of the smaller points improves.

image

I wonder, and it would go a follow up PR for sure, if we could improve the way the symbol size is communicated in the legend so users understand better the mapping between values and symbol size.

This wikipedia example shows a very classic way to display point sizes, but even just showing the actual max/min point sizes in the current legend, maybe adding a midpoint, could already improve a lot. @gvnmagni what do you think?

image

@gvnmagni
Copy link

gvnmagni commented May 11, 2022

This wikipedia example shows a very classic way to display point sizes, but even just showing the actual max/min point sizes in the current legend, maybe adding a midpoint, could already improve a lot. @gvnmagni what do you think?

image

I love that idea Jorge, it would help a lot our users understanding the proportion and it will guide then in reading values even without hovering with the cursor 👍

Copy link
Member

@jsanz jsanz left a comment

Choose a reason for hiding this comment

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

Tested locally on Chrome

@nreese nreese merged commit 71c17a4 into elastic:main May 11, 2022
academo pushed a commit to academo/kibana that referenced this pull request May 12, 2022
* [Maps] scale marker size by area

* icon size

* clean up

* more clean-up

* add tests

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting [Deprecated-Use Team:Presentation]Team:Geo Former Team Label for Geo Team. Now use Team:Presentation Feature:Maps release_note:enhancement v8.3.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Maps] Dots area vs dots radius
7 participants