Skip to content

Commit

Permalink
[Maps] Add support for geohex_grid aggregation (#127170)
Browse files Browse the repository at this point in the history
* [Maps] hex bin gridding

* remove console.log

* disable hexbins for license and geo_shape

* fix jest tests

* copy cleanup

* label

* update clusters SVG with hexbins

* show as tooltip

* documenation updates

* copy updates

* add API test for hex

* test cleanup

* eslint

* eslint and functional test fixes

* eslint, copy updates, and more doc updates

* fix i18n error

* consolidate isMvt logic

* copy review feedback

* use 3 stop scale for hexs

* jest snapshot updates

* Update x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/es_geo_grid_source.tsx

Co-authored-by: Nick Peihl <[email protected]>

Co-authored-by: Kibana Machine <[email protected]>
Co-authored-by: Nick Peihl <[email protected]>
  • Loading branch information
3 people authored Mar 23, 2022
1 parent 7c31c87 commit 75f8ac4
Show file tree
Hide file tree
Showing 30 changed files with 739 additions and 297 deletions.
18 changes: 10 additions & 8 deletions docs/maps/maps-aggregations.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -42,22 +42,24 @@ image::maps/images/grid_to_docs.gif[]

[role="xpack"]
[[maps-grid-aggregation]]
=== Grid aggregation
=== Clusters

Grid aggregation layers use {ref}/search-aggregations-bucket-geotilegrid-aggregation.html[GeoTile grid aggregation] to group your documents into grids. You can calculate metrics for each gridded cell.
Clusters use {ref}/search-aggregations-bucket-geotilegrid-aggregation.html[Geotile grid aggregation] or {ref}/search-aggregations-bucket-geohexgrid-aggregation.html[Geohex grid aggregation] to group your documents into grids. You can calculate metrics for each gridded cell.

Symbolize grid aggregation metrics as:
Symbolize cluster metrics as:

*Clusters*:: Creates a <<vector-layer, vector layer>> with a cluster symbol for each gridded cell.
*Clusters*:: Uses {ref}/search-aggregations-bucket-geotilegrid-aggregation.html[Geotile grid aggregation] to group your documents into grids. Creates a <<vector-layer, vector layer>> with a cluster symbol for each gridded cell.
The cluster location is the weighted centroid for all documents in the gridded cell.

*Grid rectangles*:: Creates a <<vector-layer, vector layer>> with a bounding box polygon for each gridded cell.
*Grids*:: Uses {ref}/search-aggregations-bucket-geotilegrid-aggregation.html[Geotile grid aggregation] to group your documents into grids. Creates a <<vector-layer, vector layer>> with a bounding box polygon for each gridded cell.

*Heat map*:: Creates a <<heatmap-layer, heat map layer>> that clusters the weighted centroids for each gridded cell.
*Heat map*:: Uses {ref}/search-aggregations-bucket-geotilegrid-aggregation.html[Geotile grid aggregation] to group your documents into grids. Creates a <<heatmap-layer, heat map layer>> that clusters the weighted centroids for each gridded cell.

To enable a grid aggregation layer:
*Hexbins*:: Uses {ref}/search-aggregations-bucket-geohexgrid-aggregation.html[Geohex grid aggregation] to group your documents into H3 hexagon grids. Creates a <<vector-layer, vector layer>> with a hexagon polygon for each gridded cell.

. Click *Add layer*, then select the *Clusters and grids* or *Heat map* layer.
To enable a clusters layer:

. Click *Add layer*, then select the *Clusters* or *Heat map* layer.

To enable a blended layer that dynamically shows clusters or documents:

Expand Down
2 changes: 1 addition & 1 deletion docs/maps/maps-getting-started.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ traffic. Larger circles will symbolize grids with
more total bytes transferred, and smaller circles will symbolize
grids with less bytes transferred.

. Click **Add layer**, and select **Clusters and grids**.
. Click **Add layer**, and select **Clusters**.
. Set **Data view** to **kibana_sample_data_logs**.
. Click **Add layer**.
. In **Layer settings**, set:
Expand Down
2 changes: 1 addition & 1 deletion docs/maps/vector-layer.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ To add a vector layer to your map, click *Add layer*, then select one of the fol

*Choropleth*:: Shaded areas to compare statistics across boundaries.

*Clusters and grids*:: Geospatial data grouped in grids with metrics for each gridded cell.
*Clusters*:: Geospatial data grouped in grids with metrics for each gridded cell.
The index must contain at least one field mapped as {ref}/geo-point.html[geo_point] or {ref}/geo-shape.html[geo_shape].

*Create index*:: Draw shapes on the map and index in Elasticsearch.
Expand Down
1 change: 1 addition & 0 deletions x-pack/plugins/maps/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ export enum RENDER_AS {
HEATMAP = 'heatmap',
POINT = 'point',
GRID = 'grid',
HEX = 'hex',
}

export enum GRID_RESOLUTION {
Expand Down
1 change: 1 addition & 0 deletions x-pack/plugins/maps/kibana.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"presentationUtil"
],
"optionalPlugins": [
"cloud",
"customIntegrations",
"home",
"savedObjectsTagging",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,24 @@ export const ClustersLayerIcon: FunctionComponent = () => (
xmlns="http://www.w3.org/2000/svg"
width="49"
height="25"
fill="none"
viewBox="0 0 49 25"
className="mapLayersWizardIcon"
>
<circle cx="17.867" cy="5.032" r="2.045" className="mapLayersWizardIcon__highlight" />
<circle cx="13.367" cy="11.717" r="2.045" className="mapLayersWizardIcon__highlight" />
<circle cx="14.594" cy="19.901" r="3.273" className="mapLayersWizardIcon__highlight" />
<circle cx="4.776" cy="18.398" r="2.662" className="mapLayersWizardIcon__highlight" />
<circle cx="6.619" cy="5.649" r="2.662" className="mapLayersWizardIcon__highlight" />
<path className="mapLayersWizardIcon__highlight" d="M31.114 7.454h5.455v5.455h-5.455z" />
<path fill="#98A2B3" d="M31.114 12.909h5.455v5.455h-5.455z" />
<path fill="#69707D" d="M42.023 12.909h5.455v5.455h-5.455z" />
<path fill="#69707D" d="M42.023 12.909h5.455v5.455h-5.455z" />
<path fill="#69707D" d="M42.023 12.909h5.455v5.455h-5.455z" />
<path fill="#69707D" d="M42.023 12.909h5.455v5.455h-5.455zm-5.454-5.455h5.455v5.455h-5.455z" />
<path fill="#69707D" d="M36.569 7.454h5.455v5.455h-5.455z" />
<path fill="#69707D" d="M36.569 7.454h5.455v5.455h-5.455z" />
<path fill="#69707D" d="M36.569 7.454h5.455v5.455h-5.455z" />
<path fill="#98A2B3" d="M42.023 7.454h5.455v5.455h-5.455z" />
<path fill="#98A2B3" d="M36.569 1.999h5.455v5.455h-5.455z" />
<path className="mapLayersWizardIcon__highlight" d="M36.569 12.909h5.455v5.455h-5.455z" />
<path fill="#D3DAE6" d="M36.569 18.363h5.455v5.455h-5.455z" />
<path
fill="#69707D"
d="M37.864 5.114v2.84l2.227 1.137 2.227-1.136V5.114l-2.227-1.137-2.227 1.137zM22.273 5.682h4.454v4.545h-4.454V5.682zM22.273 10.227v4.546h-4.455v-4.546h4.455zM31.182 14.773h-4.455v4.545h4.455v-4.545zM44.545 17.045v2.841l2.228 1.137L49 19.886v-2.84l-2.227-1.137-2.228 1.136zM37.864 15.91v-2.842l2.227-1.136 2.227 1.136v2.841l-2.227 1.136-2.227-1.136z"
/>
<path
className="mapLayersWizardIcon__highlight"
d="M11.693 3.41c.923 0 1.67-.764 1.67-1.705 0-.942-.747-1.705-1.67-1.705-.922 0-1.67.763-1.67 1.705 0 .94.748 1.704 1.67 1.704zM3.898 6.818c1.537 0 2.784-1.272 2.784-2.84 0-1.57-1.247-2.842-2.784-2.842-1.538 0-2.784 1.272-2.784 2.841 0 1.57 1.246 2.841 2.784 2.841zM9.466 13.068c1.23 0 2.227-1.017 2.227-2.272 0-1.256-.997-2.273-2.227-2.273S7.239 9.54 7.239 10.796c0 1.255.997 2.272 2.227 2.272zM2.227 18.182c1.23 0 2.228-1.018 2.228-2.273 0-1.255-.998-2.273-2.228-2.273C.997 13.636 0 14.654 0 15.91c0 1.255.997 2.273 2.227 2.273zM10.023 25c1.845 0 3.34-1.526 3.34-3.41 0-1.882-1.495-3.408-3.34-3.408-1.845 0-3.341 1.526-3.341 3.409 0 1.883 1.496 3.409 3.34 3.409zM17.818 5.682h4.455v4.545h-4.455V5.682zM26.727 10.227h4.455v4.546h-4.455v-4.546zM26.727 14.773v4.545h-4.454v-4.545h4.454zM40.09 17.046v2.84l2.228 1.137 2.227-1.137v-2.84l-2.227-1.137-2.227 1.136zM35.636 11.932V9.09l2.228-1.136L40.09 9.09v2.84l-2.227 1.137-2.228-1.136zM42.318 5.114v2.84l2.227 1.137 2.228-1.136V5.114l-2.228-1.137-2.227 1.137z"
/>
<path
fill="#98A2B3"
d="M40.09 1.136v2.841l2.228 1.137 2.227-1.137v-2.84L42.318 0l-2.227 1.136zM26.727 1.136h-4.454v4.546h4.454v4.545h-4.454v4.546h-4.455v4.545h4.455v-4.545h4.454v-4.546h4.455V5.682h-4.455V1.136zM40.09 9.09v2.842l2.228 1.136 2.227-1.136V9.09l-2.227-1.136-2.227 1.136zM37.864 23.864v-2.841l2.227-1.137 2.227 1.137v2.84L40.091 25l-2.227-1.136z"
/>
<path
fill="#D3DAE6"
d="M44.545 3.977v-2.84L46.773 0 49 1.136v2.841l-2.227 1.137-2.228-1.137zM42.318 13.068v2.841l2.227 1.136 2.228-1.136v-2.84l-2.228-1.137-2.227 1.136zM26.727 19.318h-4.454v4.546h4.454v-4.546zM42.318 21.023v2.84L44.545 25l2.228-1.136v-2.841l-2.228-1.137-2.227 1.137z"
/>
</svg>
);

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 75f8ac4

Please sign in to comment.