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

Geocentroid / tilemap bug fixes #10871

Merged

Conversation

thomasneirynck
Copy link
Contributor

@thomasneirynck thomasneirynck commented Mar 23, 2017

Summary:

Kibana now uses the geo-centroid of the results to place results on a map. The result is a more natural looking map with fewer visual artifacts. It avoids the "gridded"-look from earlier versions. The map now also supports panning&zooming with touchscreens, as well as bug fixes that improve stability.

image

image

image


New PR, without the vector map. This is so we can resolve the blocker for X-pack quicker.



todos:

  • update test code
  • shouldn't use zoom level 0 for WMS

@ppisljar
Copy link
Member

functionality wise it looks great! i also gave a quick look at the code and can't find anything. im gonna give it another run later today.

Copy link
Contributor

@kobelb kobelb left a comment

Choose a reason for hiding this comment

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

I copied over the relevant comments from the previous PRs, so a lot of this is the same, but a few things are new.

import KibanaMapLayer from './kibana_map_layer';
import _ from 'lodash';
import { EventEmitter } from 'events';
import Heatmap from './heatmap';
Copy link
Contributor

Choose a reason for hiding this comment

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

Thank you for splitting this file up. It might be worthwhile to put all of the Layers into a folder.

return _.sortBy(this, function (agg) {


const aggregations = _.sortBy(this, function (agg) {
Copy link
Contributor

Choose a reason for hiding this comment

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

There's currently an extension point in the AppConfig to allow each individual item to customize the responseAggs, I added one for the requestAggs as well so that we can do the geohash logic there and it seems to work: kobelb@fd6b344

That way we don't have to hard-code the logic for specific aggregations here.

We should add unit-tests for this, regardless of which direction we go.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oki, changed it using this approach, thx!

break;
case 'Heatmap':
this._geohashMarkers = new Heatmap(this._geohashGeoJson, {
radius: +this._geohashOptions.heatmap.heatRadius,
Copy link
Contributor

Choose a reason for hiding this comment

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

The + before this is to ensure that they're positive numbers, right? When were we seeing this? It seems like something that should be caught by our validation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it coerces it to the number type. It was like that before. Agreed it looks weird and is probably not necessary, I will change it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, forgot you could do it that way in Javascript...

* @param geoJson {geoJson Object}
* @param params {Object}
*/
export default class Heatmap extends EventEmitter {
Copy link
Contributor

Choose a reason for hiding this comment

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

The heatmap still has this empty legend highlighted by the red rectangle below:

screen shot 2017-03-24 at 8 30 18 am

Copy link
Contributor

Choose a reason for hiding this comment

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

The empty legend is still showing up, when it isn't in 5.2.2. Obviously, not a blocker, but just FYI.

status: Joi.object({
allowAnonymous: Joi.boolean().default(false)
}).default(),
vectormap: Joi.object({
Copy link
Contributor

Choose a reason for hiding this comment

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

This config section snuck in here, even though we won't be adding vectormap support with this PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good catch, thanks

@@ -0,0 +1,507 @@
import { EventEmitter } from 'events';
Copy link
Contributor

Choose a reason for hiding this comment

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

On tilemaps you're currently able to zoom out all the way, and then there are multiple earths but only one of them has the data on it:

multiple-earths

Copy link
Contributor

Choose a reason for hiding this comment

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

The same zoom issue on save is still there as well. If you zoom in a bunch, and then hit save, it zooms you out all the way.

tilemap-zoom-on-save

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the data on just a single earth is normal. it is a limitation of leaflet.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

zoom on save is fixed now

Copy link
Contributor

@kobelb kobelb Mar 24, 2017

Choose a reason for hiding this comment

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

The snapping back to the map is better, but the data can be empty when it happens:

multiple-earths

}

.vis-option-item {
Copy link
Contributor

Choose a reason for hiding this comment

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

This applies to a number of visualizations and IMO looks rather awkward:

screen shot 2017-03-24 at 8 47 11 am

screen shot 2017-03-24 at 8 47 23 am

@thomasneirynck
Copy link
Contributor Author

jenkins, test this

@ppisljar
Copy link
Member

not sure if this is even related but if i zoom out completely using wms maps it shows white screen (Seems that zoom level is not available ? )

ibana20170327091131

@ppisljar
Copy link
Member

is CI broken or are the unit test failures related to this PR ?

@thomasneirynck
Copy link
Contributor Author

@ppisljar tests are broken due to this PR.

@tbragin tbragin added the Feature:Visualizations Generic visualization features (in case no more specific feature label is available) label Mar 27, 2017
@thomasneirynck thomasneirynck force-pushed the feature/tilemap_improvements branch from ad1e852 to 9ba3894 Compare March 27, 2017 22:00
Copy link
Member

@ppisljar ppisljar left a comment

Choose a reason for hiding this comment

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

LGTM

@thomasneirynck thomasneirynck merged commit 556bfab into elastic:master Mar 29, 2017
thomasneirynck added a commit to thomasneirynck/kibana that referenced this pull request Mar 29, 2017
- adds the geo-centroid metric as the new default for visualizations
- various bug fixes and improvements
    - avoid unnecessary calls to manifest
    - avoid map flicker when zooming
    - enable scroll/pinch/touch zooming
    - avoid heatmap errors
    - ensure map fills screen in dashboard
    - ensure fit works consistently
    - relax tilemap constraints
    - remove support for multi-maps
- this refactor sets the stage for new vector map visualization which will reuse the same map components
thomasneirynck added a commit that referenced this pull request Mar 29, 2017
due to merge conflicts, this also required backporting the resize_checker components

* Geocentroid / tilemap bug fixes (#10871)

- adds the geo-centroid metric as the new default for visualizations
- various bug fixes and improvements
    - avoid unnecessary calls to manifest
    - avoid map flicker when zooming
    - enable scroll/pinch/touch zooming
    - avoid heatmap errors
    - ensure map fills screen in dashboard
    - ensure fit works consistently
    - relax tilemap constraints
    - remove support for multi-maps
- this refactor sets the stage for new vector map visualization which will reuse the same map components
@epixa epixa added the v5.4.0 label Apr 10, 2017
@epixa epixa added the v6.0.0 label May 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Visualizations Generic visualization features (in case no more specific feature label is available) v5.4.0 v6.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants