-
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.
Revert "[ML] Embeddable Anomaly Swimlane (#64056)"
This reverts commit f62df99.
- Loading branch information
Showing
61 changed files
with
944 additions
and
3,100 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
42 changes: 42 additions & 0 deletions
42
x-pack/plugins/ml/public/application/components/chart_tooltip/chart_tooltip_service.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,42 @@ | ||
/* | ||
* 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 { BehaviorSubject } from 'rxjs'; | ||
|
||
import { TooltipValue, TooltipValueFormatter } from '@elastic/charts'; | ||
|
||
export declare const getChartTooltipDefaultState: () => ChartTooltipState; | ||
|
||
export interface ChartTooltipValue extends TooltipValue { | ||
skipHeader?: boolean; | ||
} | ||
|
||
interface ChartTooltipState { | ||
isTooltipVisible: boolean; | ||
offset: ToolTipOffset; | ||
targetPosition: ClientRect; | ||
tooltipData: ChartTooltipValue[]; | ||
tooltipHeaderFormatter?: TooltipValueFormatter; | ||
tooltipPosition: { left: number; top: number }; | ||
} | ||
|
||
export declare const chartTooltip$: BehaviorSubject<ChartTooltipState>; | ||
|
||
interface ToolTipOffset { | ||
x: number; | ||
y: number; | ||
} | ||
|
||
interface MlChartTooltipService { | ||
show: ( | ||
tooltipData: ChartTooltipValue[], | ||
target?: HTMLElement | null, | ||
offset?: ToolTipOffset | ||
) => void; | ||
hide: () => void; | ||
} | ||
|
||
export declare const mlChartTooltipService: MlChartTooltipService; |
37 changes: 37 additions & 0 deletions
37
x-pack/plugins/ml/public/application/components/chart_tooltip/chart_tooltip_service.js
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,37 @@ | ||
/* | ||
* 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 { BehaviorSubject } from 'rxjs'; | ||
|
||
export const getChartTooltipDefaultState = () => ({ | ||
isTooltipVisible: false, | ||
tooltipData: [], | ||
offset: { x: 0, y: 0 }, | ||
targetPosition: { left: 0, top: 0 }, | ||
tooltipPosition: { left: 0, top: 0 }, | ||
}); | ||
|
||
export const chartTooltip$ = new BehaviorSubject(getChartTooltipDefaultState()); | ||
|
||
export const mlChartTooltipService = { | ||
show: (tooltipData, target, offset = { x: 0, y: 0 }) => { | ||
if (typeof target !== 'undefined' && target !== null) { | ||
chartTooltip$.next({ | ||
...chartTooltip$.getValue(), | ||
isTooltipVisible: true, | ||
offset, | ||
targetPosition: target.getBoundingClientRect(), | ||
tooltipData, | ||
}); | ||
} | ||
}, | ||
hide: () => { | ||
chartTooltip$.next({ | ||
...getChartTooltipDefaultState(), | ||
isTooltipVisible: false, | ||
}); | ||
}, | ||
}; |
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.