-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Maps] add Top term aggregation (#57875)
* [Maps] add Top term aggregation * update pew-pew source to handle terms agg * make helper function for pulling values from bucket * update terms source * better join labels * categoricla meta * remove unused constant * remove unused changes * remove unused constant METRIC_SCHEMA_CONFIG * update jest expect * fix auto complete suggestions for top term * get category autocomplete working with style props from joins * pluck categorical style meta with real field name * mock MetricsEditor to fix jest test * review feedback * es_agg_utils.js to es_agg_utils.ts * typing updates * use composit agg to avoid search.buckets limit * i18n update and functional test fix * stop paging through results when request is aborted * remove unused file * do not use composite agg when no terms sub-aggregations * clean up * pass indexPattern to getValueAggsDsl * review feedback * more review feedback * ts-ignore for untyped imports in tests * more review feedback * add bucket.hasOwnProperty check Co-authored-by: Elastic Machine <[email protected]>
- Loading branch information
1 parent
2ea4bdf
commit 3212754
Showing
35 changed files
with
726 additions
and
416 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,7 @@ import sprites1 from '@elastic/maki/dist/[email protected]'; | |
import sprites2 from '@elastic/maki/dist/[email protected]'; | ||
import { DrawControl } from './draw_control'; | ||
import { TooltipControl } from './tooltip_control'; | ||
import { clampToLatBounds, clampToLonBounds } from '../../../elasticsearch_geo_utils'; | ||
|
||
mapboxgl.workerUrl = mbWorkerUrl; | ||
mapboxgl.setRTLTextPlugin(mbRtlPlugin); | ||
|
@@ -234,12 +235,12 @@ export class MBMapContainer extends React.Component { | |
//clamping ot -89/89 latitudes since Mapboxgl does not seem to handle bounds that contain the poles (logs errors to the console when using -90/90) | ||
const lnLatBounds = new mapboxgl.LngLatBounds( | ||
new mapboxgl.LngLat( | ||
clamp(goto.bounds.min_lon, -180, 180), | ||
clamp(goto.bounds.min_lat, -89, 89) | ||
clampToLonBounds(goto.bounds.min_lon), | ||
clampToLatBounds(goto.bounds.min_lat) | ||
), | ||
new mapboxgl.LngLat( | ||
clamp(goto.bounds.max_lon, -180, 180), | ||
clamp(goto.bounds.max_lat, -89, 89) | ||
clampToLonBounds(goto.bounds.max_lon), | ||
clampToLatBounds(goto.bounds.max_lat) | ||
) | ||
); | ||
//maxZoom ensure we're not zooming in too far on single points or small shapes | ||
|
@@ -306,9 +307,3 @@ export class MBMapContainer extends React.Component { | |
); | ||
} | ||
} | ||
|
||
function clamp(val, min, max) { | ||
if (val > max) val = max; | ||
else if (val < min) val = min; | ||
return val; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.