-
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.
[ML] Anomaly Detection: add anomalies map to explorer for jobs with '…
…lat_long' function (#88416) * wip: create embedded map component for explorer * add embeddedMap component to explorer * use geo_results * remove charts callout when map is shown * add translation, round geo coordinates * create GEO_MAP chart type and move embedded map to charts area * remove embedded map that is no longer used * fix type and fail silently if plugin not available * fix multiple type of jobs charts view * fix tooltip function and remove single viewer link for latlong * ensure diff types of jobs show correct charts. fix jest test * show errorCallout if maps not enabled and is lat_long job * use shared MlEmbeddedMapComponent in explorer * ensure latLong jobs not viewable in single metric viewer * update jest test
- Loading branch information
1 parent
7622da0
commit 2eb170b
Showing
12 changed files
with
364 additions
and
57 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
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.