-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[ML] Anomaly Detection: add anomalies map to explorer for jobs with 'lat_long' function #88416
Merged
alvarezmelissa87
merged 15 commits into
elastic:master
from
alvarezmelissa87:ml-add-explorer-maps
Jan 29, 2021
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
cc12e5e
wip: create embedded map component for explorer
alvarezmelissa87 0e9b281
add embeddedMap component to explorer
alvarezmelissa87 052014c
use geo_results
alvarezmelissa87 8d0cf05
remove charts callout when map is shown
alvarezmelissa87 d2ecf50
add translation, round geo coordinates
alvarezmelissa87 ebce0ac
create GEO_MAP chart type and move embedded map to charts area
alvarezmelissa87 ffb319f
remove embedded map that is no longer used
alvarezmelissa87 d6232f6
fix type and fail silently if plugin not available
alvarezmelissa87 423e12d
fix multiple type of jobs charts view
alvarezmelissa87 bff94a7
fix tooltip function and remove single viewer link for latlong
alvarezmelissa87 ea9414a
ensure diff types of jobs show correct charts. fix jest test
alvarezmelissa87 1912759
show errorCallout if maps not enabled and is lat_long job
alvarezmelissa87 c7b782b
use shared MlEmbeddedMapComponent in explorer
alvarezmelissa87 4b8124d
ensure latLong jobs not viewable in single metric viewer
alvarezmelissa87 4fed952
update jest test
alvarezmelissa87 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
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
33 changes: 33 additions & 0 deletions
33
...ck/plugins/ml/public/application/explorer/explorer_charts/explorer_chart_embedded_map.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,33 @@ | ||
/* | ||
* 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 React, { useState, useEffect } from 'react'; | ||
import { Dictionary } from '../../../../common/types/common'; | ||
import { LayerDescriptor } from '../../../../../maps/common/descriptor_types'; | ||
import { getMLAnomaliesActualLayer, getMLAnomaliesTypicalLayer } from './map_config'; | ||
import { MlEmbeddedMapComponent } from '../../components/ml_embedded_map'; | ||
interface Props { | ||
seriesConfig: Dictionary<any>; | ||
} | ||
|
||
export function EmbeddedMapComponentWrapper({ seriesConfig }: Props) { | ||
const [layerList, setLayerList] = useState<LayerDescriptor[]>([]); | ||
|
||
useEffect(() => { | ||
if (seriesConfig.mapData && seriesConfig.mapData.length > 0) { | ||
setLayerList([ | ||
getMLAnomaliesActualLayer(seriesConfig.mapData), | ||
getMLAnomaliesTypicalLayer(seriesConfig.mapData), | ||
]); | ||
} | ||
}, [seriesConfig]); | ||
|
||
return ( | ||
<div data-test-subj="xpack.ml.explorer.embeddedMap" style={{ width: '100%', height: 300 }}> | ||
<MlEmbeddedMapComponent layerList={layerList} /> | ||
</div> | ||
); | ||
} |
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.
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.
Probably one for a follow up, but would be nice if the
SINGLE_METRIC
andDISTRIBUTION
charts expanded to the height of the map in this situation (preferable than shrinking the map height to match those chart heights I think).