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] geo line source #76572

Merged
merged 29 commits into from
Dec 3, 2020
Merged

[Maps] geo line source #76572

merged 29 commits into from
Dec 3, 2020

Conversation

nreese
Copy link
Contributor

@nreese nreese commented Sep 2, 2020

Fixes #31396

This PR adds a new source that uses geo_line aggregation to create tracks from points.

Screen Shot 2020-09-03 at 9 32 50 AM

geo_line aggregation is gold so the layer wizard card is disabled when there is not a gold license.

Screen Shot 2020-09-02 at 12 55 50 PM

@nreese nreese added release_note:enhancement WIP Work in progress [Deprecated-Use Team:Presentation]Team:Geo Former Team Label for Geo Team. Now use Team:Presentation v8.0.0 v7.10.0 labels Sep 2, 2020
@nreese nreese requested a review from a team as a code owner September 2, 2020 20:52
@elasticmachine
Copy link
Contributor

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

@kmartastic
Copy link
Contributor

@nreese
Will this work if my sequence is not a timestamp/datetime field? For instance, what if I have a field with the values 1,2,3,4,5 each with corresponding locations. Would I be able to connect these locations 1-2-3-4-5?

@nreese nreese added v7.11.0 and removed v7.10.0 labels Oct 5, 2020
@nreese
Copy link
Contributor Author

nreese commented Nov 2, 2020

@miukimiu Would it be possible to create an icon for tracks source? The source connects points into lines so maybe an icon that shows two or three tracks

Screen Shot 2020-11-02 at 7 55 26 AM

@miukimiu
Copy link
Contributor

miukimiu commented Nov 2, 2020

@nreese,

Yes. I'll add it to this list: #82076.

@jsanz
Copy link
Member

jsanz commented Nov 3, 2020

Tested this with the opensky realtime dataset and works really well. I like how easy it is to add metrics to the geo_line source and use them for thematic mapping.

image

@nreese @kmartastic do you think it would make sense to add the ability to include also a new documents layer at the same time? Not a big deal since it's a couple of clicks away but I guess it will be a common use case where people want to also have access to the individual points even if it's to render the last point with the top hit per entity option that would leverage the wizard parameter as well.

@kmartastic
Copy link
Contributor

kmartastic commented Nov 3, 2020

@nreese @kmartastic do you think it would make sense to add the ability to include also a new documents layer at the same time? Not a big deal since it's a couple of clicks away but I guess it will be a common use case where people want to also have access to the individual points even if it's to render the last point with the top hit per entity option that would leverage the wizard parameter as well.

I think it would be great if the line could have an end-cap. That's a reasonable and often better substitute for adding a second layer of documents in order to show "last point". The direction of the line matters and end-caps solve it.

My 2 cents @jsanz @nreese

@nreese
Copy link
Contributor Author

nreese commented Nov 3, 2020

do you think it would make sense to add the ability to include also a new documents layer at the same time? Not a big deal since it's a couple of clicks away but I guess it will be a common use case where people want to also have access to the individual points even if it's to render the last point with the top hit per entity option that would leverage the wizard parameter as well.

Sounds like a reasonable enhancement but I would leave that out of the initial PR. Lets get the bare minimum out and then work on enhancements.

@miukimiu
Copy link
Contributor

@nreese the icon for this new layer type will be merged on #83503. It is called TracksLayerIcon and you can find it in x-pack/plugins/maps/public/classes/layers/icons/tracks_layer_icon.tsx.

@nreese
Copy link
Contributor Author

nreese commented Nov 30, 2020

@elasticmachine merge upstream

Copy link
Contributor

@thomasneirynck thomasneirynck left a comment

Choose a reason for hiding this comment

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

this is such a great PR!

The slimmed-down wizard is very intuitive.

One issue is that the bounding-box filter applies to all the documents. The result is that the geo_line agg may "skip" points that are consecutive in time but outside the bounds, in favor of points that are older but inside the bounds. This causes lines to get a "flicker" effect when panning/zooming since non-consecutive points get connected. Maps has the same issue with pew-pew maps fwiw (#59106).

to address, consider a few work-arounds:

  • add "dynamic query in bounding box" switch, similar to how ES-documents layer have this switch
  • run the term agg first for last-known entity with bounding-box included, then run a filters-agg (one filter per entity) and accumulate geo_line.

@nreese
Copy link
Contributor Author

nreese commented Dec 1, 2020

@elasticmachine merge upstream

@nreese
Copy link
Contributor Author

nreese commented Dec 1, 2020

@talevy @thomasneirynck I added complete flag to the tooltip so users can see if the track is trimmed or not. Let me know if you think the label should be changed.

Screen Shot 2020-12-01 at 1 40 59 PM

@nreese
Copy link
Contributor Author

nreese commented Dec 2, 2020

@thomasneirynck

One issue is that the bounding-box filter applies to all the documents. The result is that the geo_line agg may "skip" points that are consecutive in time but outside the bounds, in favor of points that are older but inside the bounds. This causes lines to get a "flicker" effect when panning/zooming since non-consecutive points get connected.

This has been addressed. The request has been split into 2 _search calls. The first fetches entities and is filtered by map buffer. The second fetches tracks for those entities and is not filtered by map buffer.

@nreese
Copy link
Contributor Author

nreese commented Dec 2, 2020

@elasticmachine merge upstream

Copy link
Contributor

@thomasneirynck thomasneirynck left a comment

Choose a reason for hiding this comment

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

This is really amazing.

Added some discussion items wrt. some of the defaults.

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
maps 637 654 +17

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.8MB 2.8MB +28.3KB

Distributable file count

id before after diff
default 43486 43487 +1

Page load bundle

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

id before after diff
maps 151.1KB 151.1KB +42.0B

History

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

Copy link
Contributor

@thomasneirynck thomasneirynck left a comment

Choose a reason for hiding this comment

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

😱 Congratulations!

@nreese nreese merged commit e72d174 into elastic:master Dec 3, 2020
nreese added a commit to nreese/kibana that referenced this pull request Dec 3, 2020
* [Maps] geo line source

* update editor with metrics

* show track name in tooltip

* fix styling by category

* avoid killing ES, limit to 100 tracks

* better source tooltip message

* fix imports

* increase max tracks

* use tracks icon

* tslint

* Making layer wizard select tooltip flex

* tslint and jest snapshot updates

* clean up

* add trimmed property to tooltip

* change complete label to 'track is complete'

* show incomplete data icon if tracks are trimmed

* add jest test for getSourceTooltipContent

* clean up areResultsTrimmed logic

* split request into 2 fetches

* review feedback

* do not allow selecting split field as sort field

* reduce number of tracks to 250

* tslint

Co-authored-by: Kibana Machine <[email protected]>
Co-authored-by: miukimiu <[email protected]>
gmmorris added a commit to gmmorris/kibana that referenced this pull request Dec 4, 2020
* master: (28 commits)
  [Actions] fixes bug where severity is auto selected but not applied to the action in PagerDuty (elastic#84891)
  Only attempt to rollover signals index if version < builtin version (elastic#84982)
  skip flaky suite (elastic#84978)
  skip lens rollup tests
  Add geo containment tracking alert type (elastic#84151)
  Changed rollup tests to use test user rather than elastic super user. (elastic#79567)
  skip 'should allow creation of lens xy chart' elastic#84957
  [APM] Add log_level/sanitize_field_names config options to Python Agent (elastic#84810)
  [Maps] geo line source (elastic#76572)
  [data.search] Move search method inside session service and add tests (elastic#84715)
  skip lens drag and drop test.  elastic#84941
  [Ingest Node Pipelines] Integrate painless autocomplete (elastic#84554)
  [Lens] allow drag and drop reorder on xyChart for y dimension (elastic#84640)
  [Lens] Fix error when selecting the current field again (elastic#84817)
  [Metrics UI] Add metadata tab to node details flyout (elastic#84454)
  [CI] Enables APM collection (elastic#81731)
  [Workplace Search] Migrate Sources Schema tree (elastic#84847)
  Disable checking for conflicts when copying saved objects (elastic#83575)
  [SECURITY_SOLUTION] delete advanced Policy fields when they are empty (elastic#84368)
  y18n 4.0.0 -> 4.0.1 (elastic#84905)
  ...
nreese added a commit that referenced this pull request Dec 4, 2020
* [Maps] geo line source

* update editor with metrics

* show track name in tooltip

* fix styling by category

* avoid killing ES, limit to 100 tracks

* better source tooltip message

* fix imports

* increase max tracks

* use tracks icon

* tslint

* Making layer wizard select tooltip flex

* tslint and jest snapshot updates

* clean up

* add trimmed property to tooltip

* change complete label to 'track is complete'

* show incomplete data icon if tracks are trimmed

* add jest test for getSourceTooltipContent

* clean up areResultsTrimmed logic

* split request into 2 fetches

* review feedback

* do not allow selecting split field as sort field

* reduce number of tracks to 250

* tslint

Co-authored-by: Kibana Machine <[email protected]>
Co-authored-by: miukimiu <[email protected]>

Co-authored-by: Kibana Machine <[email protected]>
Co-authored-by: miukimiu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Maps][Request]Draw line between geo points on map
7 participants