-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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] Add super-fine option to grid/cluster layers #76526
Closed
Closed
Changes from all commits
Commits
Show all changes
58 commits
Select commit
Hold shift + click to select a range
64d439b
boilerplate
thomasneirynck c21d565
more boilerplate
thomasneirynck abf23ca
even more boilerplate
thomasneirynck d5e882d
add round-trip boilerplate
thomasneirynck 416ed56
Merge branch 'master' of github.com:elastic/kibana into maps/es_mvt_g…
thomasneirynck 6b04156
move to common
thomasneirynck 3f42ffe
move more files
thomasneirynck 46e162a
move more utils
thomasneirynck 3a67982
reuse existing implementation
thomasneirynck 0df9b29
fix autodomain
thomasneirynck b1aa692
minor fixes
thomasneirynck 2d84c57
undo typo
thomasneirynck 9bb547f
enable grids
thomasneirynck a63d8a7
add shape support
thomasneirynck ee0f4d0
Merge branch 'master' of github.com:elastic/kibana into maps/es_mvt_g…
thomasneirynck 2342a35
create util folder
thomasneirynck b986964
remove some dupe
thomasneirynck 86105f4
not done
thomasneirynck 9693042
add new api extension
thomasneirynck 3d28a58
Merge branch 'master' of github.com:elastic/kibana into maps/es_mvt_g…
thomasneirynck 01ed2d3
reuse implementation
thomasneirynck eecef6c
ts fixes
thomasneirynck 9aa2038
type fixes
thomasneirynck 9428aa1
more type fixes
thomasneirynck 16f26d2
more type fixes
thomasneirynck b3bd0f1
remove cruft
thomasneirynck a148f5c
remove log
thomasneirynck db23dc5
remove dupes
thomasneirynck 1ed2b67
simplification
thomasneirynck 270f82c
reuse existing tile parsing
thomasneirynck 751a39b
Merge branch 'master' of github.com:elastic/kibana into maps/es_mvt_g…
thomasneirynck 989f767
Merge branch 'master' of github.com:elastic/kibana into maps/es_mvt_g…
thomasneirynck 4e71f48
review feedback
thomasneirynck 348a7ab
remove param
thomasneirynck 0d5d0b6
remove fluffy try-catch
thomasneirynck 7c642bf
Merge branch 'master' of github.com:elastic/kibana into maps/es_mvt_g…
thomasneirynck a3946de
Add deprecation message to coordinate map and region map
nreese bbf755f
clean up text
nreese 8c61d70
Merge branch 'master' of github.com:elastic/kibana into maps/es_mvt_g…
thomasneirynck b773bb3
remove interfaces
thomasneirynck 1e672ad
Merge branch 'master' of github.com:elastic/kibana into deprecation_m…
nreese 1b5a900
add default distro link and view in maps link
nreese 7571e3d
move url generation into onClick handler
nreese 7ab105b
create tile map layer descritor
nreese a18083c
set metrics and color and scaling
nreese 820acb3
lazy load createTileMapLayerDescriptor
nreese c9fa756
tslint fixes
nreese 33f205e
Merge branch 'master' of github.com:elastic/kibana into maps/es_mvt_g…
thomasneirynck 99ca7d8
remove things
thomasneirynck fbecaf8
Merge branch 'master' of github.com:elastic/kibana into maps/es_mvt_g…
thomasneirynck cfc4d21
add unit tests
thomasneirynck bb478aa
add unit tests
thomasneirynck 45d587b
tslint cleanup for OSS code
nreese 9fce05d
add snapshot
thomasneirynck 070fac2
Merge branch 'deprecation_message' of https://github.com/nreese/kiban…
thomasneirynck 5ad5585
Merge branch 'master' of github.com:elastic/kibana into maps/es_mvt_g…
thomasneirynck debec1e
feedback
thomasneirynck 0b9fe76
make use of currentLayerType consistent
thomasneirynck File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
112 changes: 112 additions & 0 deletions
112
src/plugins/tile_map/public/get_deprecation_message.tsx
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 |
---|---|---|
@@ -0,0 +1,112 @@ | ||
/* | ||
* Licensed to Elasticsearch B.V. under one or more contributor | ||
* license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright | ||
* ownership. Elasticsearch B.V. licenses this file to you under | ||
* the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
import React from 'react'; | ||
import { EuiButton, EuiLink } from '@elastic/eui'; | ||
import { FormattedMessage } from '@kbn/i18n/react'; | ||
import { getCoreService, getQueryService, getShareService } from './services'; | ||
import { indexPatterns } from '../../data/public'; | ||
import { Vis } from '../../visualizations/public'; | ||
|
||
export function getDeprecationMessage(vis: Vis) { | ||
const mapsTileMapUrlGenerator = getShareService().urlGenerators.getUrlGenerator( | ||
'MAPS_APP_TILE_MAP_URL_GENERATOR' | ||
); | ||
|
||
let action; | ||
if (!mapsTileMapUrlGenerator) { | ||
action = ( | ||
<FormattedMessage | ||
id="tileMap.vis.defaultDistributionMessage" | ||
defaultMessage="To get Maps, upgrade to the {defaultDistribution} of Elasticsearch and Kibana." | ||
values={{ | ||
defaultDistribution: ( | ||
<EuiLink | ||
color="accent" | ||
external | ||
href="https://www.elastic.co/downloads/kibana" | ||
target="_blank" | ||
> | ||
default distribution | ||
</EuiLink> | ||
), | ||
}} | ||
/> | ||
); | ||
} else { | ||
action = ( | ||
<div> | ||
<EuiButton | ||
onClick={async (e: React.MouseEvent<HTMLButtonElement>) => { | ||
e.preventDefault(); | ||
|
||
const query = getQueryService(); | ||
const createUrlParams = { | ||
title: vis.title, | ||
mapType: vis.params.mapType, | ||
colorSchema: vis.params.colorSchema, | ||
indexPatternId: vis.data.indexPattern?.id, | ||
metricAgg: 'count', | ||
filters: query.filterManager.getFilters(), | ||
query: query.queryString.getQuery(), | ||
timeRange: query.timefilter.timefilter.getTime(), | ||
}; | ||
|
||
const bucketAggs = vis.data?.aggs?.byType('buckets'); | ||
if (bucketAggs?.length && bucketAggs[0].type.dslName === 'geohash_grid') { | ||
createUrlParams.geoFieldName = bucketAggs[0].getField()?.name; | ||
} else if (vis.data.indexPattern) { | ||
// attempt to default to first geo point field when geohash is not configured yet | ||
const geoField = vis.data.indexPattern.fields.find((field) => { | ||
return ( | ||
!indexPatterns.isNestedField(field) && | ||
field.aggregatable && | ||
field.type === 'geo_point' | ||
); | ||
}); | ||
if (geoField) { | ||
createUrlParams.geoFieldName = geoField.name; | ||
} | ||
} | ||
|
||
const metricAggs = vis.data?.aggs?.byType('metrics'); | ||
if (metricAggs?.length) { | ||
createUrlParams.metricAgg = metricAggs[0].type.dslName; | ||
createUrlParams.metricFieldName = metricAggs[0].getField()?.name; | ||
} | ||
|
||
const url = await mapsTileMapUrlGenerator.createUrl(createUrlParams); | ||
getCoreService().application.navigateToUrl(url); | ||
}} | ||
size="s" | ||
> | ||
<FormattedMessage id="tileMap.vis.viewInMaps" defaultMessage="View in Maps" /> | ||
</EuiButton> | ||
</div> | ||
); | ||
} | ||
|
||
return ( | ||
<FormattedMessage | ||
id="tileMap.vis.deprecationMessage" | ||
defaultMessage="Coordinate map will migrate to Maps in 8.0. With Maps, you can add multiple layers and indices, plot individual documents, symbolize features from data values, and more. {action}" | ||
values={{ action }} | ||
/> | ||
); | ||
} |
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
32 changes: 32 additions & 0 deletions
32
src/plugins/visualize/public/application/components/deprecated_vis_info.tsx
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* Licensed to Elasticsearch B.V. under one or more contributor | ||
* license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright | ||
* ownership. Elasticsearch B.V. licenses this file to you under | ||
* the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
import React, { ReactElement } from 'react'; | ||
import { EuiCallOut } from '@elastic/eui'; | ||
|
||
export function DeprecatedVisInfo({ message }: { message: ReactElement<any> }) { | ||
return ( | ||
<EuiCallOut | ||
className="hide-for-sharing" | ||
data-test-subj="deprecatedVisInfo" | ||
size="s" | ||
title={message} | ||
/> | ||
); | ||
} |
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
11 changes: 11 additions & 0 deletions
11
x-pack/plugins/maps/common/elasticsearch_util/convert_to_geojson.d.ts
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { Feature } from 'geojson'; | ||
import { RENDER_AS } from '../constants'; | ||
|
||
export function convertCompositeRespToGeoJson(esResponse: any, renderAs: RENDER_AS): Feature[]; | ||
export function convertRegularRespToGeoJson(esResponse: any, renderAs: RENDER_AS): Feature[]; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is beyond the scope of this PR, but I wonder if we can have a range slider option next to the hard-coded select box values for advanced users to fine-tune their resolution?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will create follow-up issue for this after this merges.