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

Pass global filters & queries to coordinate maps vis. #30595

Merged
merged 6 commits into from
Feb 15, 2019

Conversation

lukeelmers
Copy link
Member

Fixes #23261.

Summary

When you click to fit coordinate map data to the geo_bounding_box, the vis makes a call to ES using searchSource to retrieve the bounds for that query. Everything worked fine with filters applied in the appState, but globalState filters & queries were not being added, and the vis did not have access to them.

After some discussions with @ppisljar, @timroes, and @flash1293, we decided that, for the time being, we'll work around this limitation by attaching global queries/filters to the vis object inside of embedded_visualize_handler, so that they can be accessed & added to searchSource within the visualization itself.

This is not a long-term solution, and it is something we intend to remove in the future by looking for ways to remove searchSource from the map vis entirely: #30593.

Checklist

Use strikethroughs to remove checklist items you don't feel are applicable to this PR.

@lukeelmers lukeelmers added the Team:Visualizations Visualization editors, elastic-charts and infrastructure label Feb 8, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app

@elasticmachine

This comment has been minimized.

@ppisljar

This comment has been minimized.

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.

tested on chrome linux and it works ok

@elasticmachine

This comment has been minimized.

@lukeelmers
Copy link
Member Author

@ppisljar Pushed some updates w/ notes. Lmk what you think.

* under the License.
*/

export { queryGeohashBounds } from './query_geohash_bounds';
Copy link
Member Author

Choose a reason for hiding this comment

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

Added a new utils directory to visualize/loader -- I think this is something we will be able to make use of elsewhere, e.g. extracting some of the field-formatter specific stuff from pipeline_helpers and moving it here

@@ -172,7 +168,7 @@ export function CoordinateMapsVisualizationProvider(Notifier, Private) {
tooltipFormatter: this._geoJsonFeatureCollectionAndMeta ? boundTooltipFormatter : null,
mapType: newParams.mapType,
isFilteredByCollar: this._isFilteredByCollar(),
fetchBounds: this.getGeohashBounds.bind(this),
fetchBounds: () => this.vis.API.getGeohashBounds(), // TODO: Remove this (elastic/kibana#30593)
Copy link
Member Author

Choose a reason for hiding this comment

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

I don't believe it is necessary to pass this.vis to the function here, as it is already available in embedded_visualize_handler and should be the same object, but let me know if for some reason this is an incorrect assumption.

@lukeelmers

This comment has been minimized.

@flash1293
Copy link
Contributor

Code LGTM! 👍

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, tested on chrome linux with and without pipeline data loader, works good

@ppisljar
Copy link
Member

retest

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elastic elastic deleted a comment from elasticmachine Feb 14, 2019
@elastic elastic deleted a comment from elasticmachine Feb 14, 2019
@elastic elastic deleted a comment from elasticmachine Feb 14, 2019
@elasticmachine

This comment has been minimized.

@spalger
Copy link
Contributor

spalger commented Feb 14, 2019

retest

@elasticmachine
Copy link
Contributor

💔 Build Failed

@lukeelmers
Copy link
Member Author

retest

@elasticmachine
Copy link
Contributor

💔 Build Failed

@spalger
Copy link
Contributor

spalger commented Feb 15, 2019

These failures would be fixed by a merge with master

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@lukeelmers lukeelmers merged commit 09a6c9d into elastic:master Feb 15, 2019
@lukeelmers lukeelmers deleted the fix/data-bounds branch February 15, 2019 15:43
lukeelmers added a commit to lukeelmers/kibana that referenced this pull request Feb 15, 2019
lukeelmers added a commit to lukeelmers/kibana that referenced this pull request Feb 15, 2019
lukeelmers added a commit to lukeelmers/kibana that referenced this pull request Feb 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants