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] Auto generate legends and styles from mvt data #94811

Merged
merged 92 commits into from
Jul 8, 2021

Conversation

thomasneirynck
Copy link
Contributor

@thomasneirynck thomasneirynck commented Mar 17, 2021

Closes #76549, #92672 (for ES-data)


Generate correct legends for doc-data:

doctiles

Generate correct style-rules for agg data:

gridtiles


This PR also removes the edge-case where the "get-from-data-switch" could be disabled. This only arose (before this PR) when mvt-backed ES-data (such as avg, min, max-aggs) was used for by-value styling. The style-meta could be retrieved only by a back-end call to ES for extended stats. This split is no longer needed, since the tiles contain the metadata as well. This client-side determination can now be made as well.

ie. the toggle now works for all ES-data, regardless of scaling-type

e.g.: using extended-stats:
image

e.g.: using tile-meta
image


This adds tile metadata inside the mvt so the map can correctly bootstrap style and legend information.

on the server-side:

Add a metadata-feature to the mvt responses containing information about:

  • whether the tile shows complete data
  • how many features are inside a tile
  • what shape-types are inside a tile
  • domain of the values inside the tile for agg-data

on the client-side:

  • legend-icon can now be correctly generated
    • adjust icon based on shape-type
    • show appropriate tooltip content
    • show incomplete-results icon
    • show no-results icon
  • layer can now autogenerate color-ramps for countable data (counts/sums-aggs)

Other improvement can be extracted to other PRs:

  • show bounds of tile outline with incomplete results rather than ugly no-data tile
  • select initial color based on middle of color-ramp

@thomasneirynck thomasneirynck added [Deprecated-Use Team:Presentation]Team:Geo Former Team Label for Geo Team. Now use Team:Presentation WIP Work in progress labels Mar 17, 2021
@thomasneirynck thomasneirynck added v7.13.0 v8.0.0 enhancement New value added to drive a business result labels Apr 8, 2021
@nreese
Copy link
Contributor

nreese commented Apr 15, 2021

@elasticmachine merge upstream

@spalger spalger added v7.14.0 and removed v7.13.0 labels Apr 21, 2021
Copy link
Contributor

@nreese nreese left a comment

Choose a reason for hiding this comment

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

LGTM getting style meta for tiles is a huge achievement. Thanks for making all the changes to handle both categorical and ordinal styles and making the code changes clean.

Just one minor nit about where to put some if logic that you can take or leave.

x-pack/plugins/maps/server/mvt/get_tile.ts Outdated Show resolved Hide resolved
@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
maps 740 742 +2

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
maps 200 203 +3

Async chunks

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

id before after diff
maps 3.1MB 3.1MB +6.3KB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
maps 64.6KB 65.0KB +457.0B
Unknown metric groups

API count

id before after diff
maps 201 204 +3

History

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

@thomasneirynck thomasneirynck merged commit 9134bc0 into elastic:master Jul 8, 2021
@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label Jul 12, 2021
@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create backports run node scripts/backport --pr 94811 or prevent reminders by adding the backport:skip label.

thomasneirynck added a commit to thomasneirynck/kibana that referenced this pull request Jul 12, 2021
@kibanamachine kibanamachine removed the backport missing Added to PRs automatically when the are determined to be missing a backport. label Jul 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Maps] Show legend preview icon for vector tile scaling
6 participants