From 59d45fde2269368f5f6fa617f6fe6f926e7b64a1 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 23 May 2023 23:53:07 +0000 Subject: [PATCH 1/8] Update dependency @elastic/charts to v57 --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 8e53ef137d9e5..9a0a3693cf774 100644 --- a/package.json +++ b/package.json @@ -93,7 +93,7 @@ "@dnd-kit/utilities": "^2.0.0", "@elastic/apm-rum": "^5.12.0", "@elastic/apm-rum-react": "^1.4.2", - "@elastic/charts": "55.0.0", + "@elastic/charts": "57.0.0", "@elastic/datemath": "5.0.3", "@elastic/elasticsearch": "npm:@elastic/elasticsearch-canary@8.6.0-canary.3", "@elastic/ems-client": "8.4.0", diff --git a/yarn.lock b/yarn.lock index ed8aa3bc746d1..36c6d7bbc8823 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1460,10 +1460,10 @@ dependencies: object-hash "^1.3.0" -"@elastic/charts@55.0.0": - version "55.0.0" - resolved "https://registry.yarnpkg.com/@elastic/charts/-/charts-55.0.0.tgz#df9a4e9b0a84a613f103011d99f120cb528c4dc9" - integrity sha512-a4UIieTi04CPHxfwztDe36xoPFkp+I4tRPXWXobv/aG/zTd4AwruRyL981RiV2Tv8Mrc5jpCJFgfadNoPrL3pg== +"@elastic/charts@57.0.0": + version "57.0.0" + resolved "https://registry.yarnpkg.com/@elastic/charts/-/charts-57.0.0.tgz#eb5c98fac7632f73c3585195e585ea88d6abcfe6" + integrity sha512-MBfPsRasEJX+OsbFk6DWEbajyKPb3aCYh5FBdvsvoIea4m76pFPjG4N0gZarRHTkkDTv6h+hiSjya0pkkyaqgA== dependencies: "@popperjs/core" "^2.4.0" bezier-easing "^2.1.0" From 771c0803f65a370042cfe528d0381cb46b1788c0 Mon Sep 17 00:00:00 2001 From: nickofthyme Date: Wed, 24 May 2023 09:30:27 -0700 Subject: [PATCH 2/8] update charts to 57.0.1 --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 9a0a3693cf774..a29b858ae8bc4 100644 --- a/package.json +++ b/package.json @@ -93,7 +93,7 @@ "@dnd-kit/utilities": "^2.0.0", "@elastic/apm-rum": "^5.12.0", "@elastic/apm-rum-react": "^1.4.2", - "@elastic/charts": "57.0.0", + "@elastic/charts": "57.0.1", "@elastic/datemath": "5.0.3", "@elastic/elasticsearch": "npm:@elastic/elasticsearch-canary@8.6.0-canary.3", "@elastic/ems-client": "8.4.0", diff --git a/yarn.lock b/yarn.lock index 36c6d7bbc8823..d28149f49ea29 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1460,10 +1460,10 @@ dependencies: object-hash "^1.3.0" -"@elastic/charts@57.0.0": - version "57.0.0" - resolved "https://registry.yarnpkg.com/@elastic/charts/-/charts-57.0.0.tgz#eb5c98fac7632f73c3585195e585ea88d6abcfe6" - integrity sha512-MBfPsRasEJX+OsbFk6DWEbajyKPb3aCYh5FBdvsvoIea4m76pFPjG4N0gZarRHTkkDTv6h+hiSjya0pkkyaqgA== +"@elastic/charts@57.0.1": + version "57.0.1" + resolved "https://registry.yarnpkg.com/@elastic/charts/-/charts-57.0.1.tgz#c48209f11be8984310dd366f8ead6d8c04720402" + integrity sha512-+wVSMjZIk5oAfslRKpcmpVGgT4qbf3IGtp4rQEUVTIMAJiYv6m5optVmQvg+n/JkR9/k/SVobtW1WylIKzQi9w== dependencies: "@popperjs/core" "^2.4.0" bezier-easing "^2.1.0" From 08b8f0bbe3b7ee31313a3798ba2a921ccc270a69 Mon Sep 17 00:00:00 2001 From: nickofthyme Date: Wed, 24 May 2023 09:31:21 -0700 Subject: [PATCH 3/8] fix tooltip header type errors from v56 changes --- .../metric_distribution_chart/metric_distribution_chart.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x-pack/plugins/data_visualizer/public/application/common/components/stats_table/components/metric_distribution_chart/metric_distribution_chart.tsx b/x-pack/plugins/data_visualizer/public/application/common/components/stats_table/components/metric_distribution_chart/metric_distribution_chart.tsx index dad53496c1e90..2790730235b3d 100644 --- a/x-pack/plugins/data_visualizer/public/application/common/components/stats_table/components/metric_distribution_chart/metric_distribution_chart.tsx +++ b/x-pack/plugins/data_visualizer/public/application/common/components/stats_table/components/metric_distribution_chart/metric_distribution_chart.tsx @@ -18,7 +18,7 @@ import { ScaleType, Settings, TooltipValue, - TooltipValueFormatter, + TooltipHeaderFormatter, } from '@elastic/charts'; import { MetricDistributionChartTooltipHeader } from './metric_distribution_chart_tooltip_header'; @@ -66,7 +66,7 @@ export const MetricDistributionChart: FC = ({ const theme = useDataVizChartTheme(); - const headerFormatter: TooltipValueFormatter = (tooltipData: ChartTooltipValue) => { + const headerFormatter: TooltipHeaderFormatter = (tooltipData) => { const xValue = tooltipData.value; const chartPoint: MetricDistributionChartData | undefined = chartData.find( (data) => data.x === xValue From e1c656f3fe9e7de65204ca412109763c18462c8d Mon Sep 17 00:00:00 2001 From: nickofthyme Date: Wed, 24 May 2023 11:25:03 -0700 Subject: [PATCH 4/8] fix more type changes related to headerFormetter changes --- .../metric_distribution_chart.tsx | 5 ----- .../criterion_preview_chart/criterion_preview_chart.tsx | 8 ++++---- .../node_details/tabs/metrics/chart_section.tsx | 8 ++++---- .../node_details/tabs/processes/process_row_charts.tsx | 8 ++++---- .../inventory_view/components/timeline/timeline.tsx | 8 ++++---- .../metric_detail/components/chart_section_vis.tsx | 8 ++++---- .../pages/metrics/metrics_explorer/components/chart.tsx | 8 ++++---- 7 files changed, 24 insertions(+), 29 deletions(-) diff --git a/x-pack/plugins/data_visualizer/public/application/common/components/stats_table/components/metric_distribution_chart/metric_distribution_chart.tsx b/x-pack/plugins/data_visualizer/public/application/common/components/stats_table/components/metric_distribution_chart/metric_distribution_chart.tsx index 2790730235b3d..2cf73d455e311 100644 --- a/x-pack/plugins/data_visualizer/public/application/common/components/stats_table/components/metric_distribution_chart/metric_distribution_chart.tsx +++ b/x-pack/plugins/data_visualizer/public/application/common/components/stats_table/components/metric_distribution_chart/metric_distribution_chart.tsx @@ -17,7 +17,6 @@ import { Position, ScaleType, Settings, - TooltipValue, TooltipHeaderFormatter, } from '@elastic/charts'; @@ -25,10 +24,6 @@ import { MetricDistributionChartTooltipHeader } from './metric_distribution_char import { kibanaFieldFormat } from '../../../utils'; import { useDataVizChartTheme } from '../../hooks'; -interface ChartTooltipValue extends TooltipValue { - skipHeader?: boolean; -} - export interface MetricDistributionChartData { x: number; y: number; diff --git a/x-pack/plugins/infra/public/alerting/common/criterion_preview_chart/criterion_preview_chart.tsx b/x-pack/plugins/infra/public/alerting/common/criterion_preview_chart/criterion_preview_chart.tsx index bd79036974f51..168bb6c30bec5 100644 --- a/x-pack/plugins/infra/public/alerting/common/criterion_preview_chart/criterion_preview_chart.tsx +++ b/x-pack/plugins/infra/public/alerting/common/criterion_preview_chart/criterion_preview_chart.tsx @@ -6,7 +6,7 @@ */ import React, { useMemo } from 'react'; -import { niceTimeFormatter, TooltipValue } from '@elastic/charts'; +import { niceTimeFormatter, TooltipProps } from '@elastic/charts'; import { Theme, LIGHT_THEME, DARK_THEME } from '@elastic/charts'; import moment from 'moment'; import { i18n } from '@kbn/i18n'; @@ -18,9 +18,9 @@ import { GetLogAlertsChartPreviewDataSuccessResponsePayload } from '../../../../ type Series = GetLogAlertsChartPreviewDataSuccessResponsePayload['data']['series']; -export const tooltipProps = { - headerFormatter: (tooltipValue: TooltipValue) => - moment(tooltipValue.value).format('Y-MM-DD HH:mm:ss'), +export const tooltipProps: TooltipProps = { + headerFormatter: ({ value }) => + moment(value).format('Y-MM-DD HH:mm:ss'), }; export const NUM_BUCKETS = 20; diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/metrics/chart_section.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/metrics/chart_section.tsx index ebe497e1e772e..b9d548a5250b3 100644 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/metrics/chart_section.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/metrics/chart_section.tsx @@ -13,7 +13,7 @@ import { Position, Settings, TickFormatter, - TooltipValue, + TooltipProps, } from '@elastic/charts'; import { useUiSetting } from '@kbn/kibana-react-plugin/public'; import moment from 'moment'; @@ -59,9 +59,9 @@ export const ChartSection = ({ }: Props) => { const isDarkMode = useUiSetting('theme:darkMode'); const metrics = series.map((chartSeries) => chartSeries.metric); - const tooltipProps = { - headerFormatter: (tooltipValue: TooltipValue) => - moment(tooltipValue.value).format('Y-MM-DD HH:mm:ss.SSS'), + const tooltipProps: TooltipProps = { + headerFormatter: ({ value }) => + moment(value).format('Y-MM-DD HH:mm:ss.SSS'), }; return ( diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/processes/process_row_charts.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/processes/process_row_charts.tsx index fd08ccbbed2f6..88e48c64df01a 100644 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/processes/process_row_charts.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/processes/process_row_charts.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { Axis, Chart, niceTimeFormatter, Position, Settings, TooltipValue } from '@elastic/charts'; +import { Axis, Chart, niceTimeFormatter, Position, Settings, TooltipProps } from '@elastic/charts'; import { EuiDescriptionListDescription, EuiDescriptionListTitle, @@ -95,9 +95,9 @@ const ProcessChart = ({ timeseries, color, label }: ProcessChartProps) => { const yAxisFormatter = createFormatter('percent'); - const tooltipProps = { - headerFormatter: (tooltipValue: TooltipValue) => - moment(tooltipValue.value).format('Y-MM-DD HH:mm:ss.SSS'), + const tooltipProps: TooltipProps = { + headerFormatter: ({ value }) => + moment(value).format('Y-MM-DD HH:mm:ss.SSS'), }; const dataDomain = calculateDomain(timeseries, [chartMetric], false); diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/timeline/timeline.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/timeline/timeline.tsx index 1c8a796737d15..524845aafa48f 100644 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/timeline/timeline.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/timeline/timeline.tsx @@ -16,12 +16,12 @@ import { Chart, Settings, Position, - TooltipValue, niceTimeFormatter, ElementClickListener, RectAnnotation, RectAnnotationDatum, XYChartElementEvent, + TooltipProps, } from '@elastic/charts'; import { EuiFlexItem } from '@elastic/eui'; import { EuiFlexGroup } from '@elastic/eui'; @@ -123,9 +123,9 @@ export const Timeline: React.FC = ({ interval, yAxisFormatter, isVisible }, [timeseries]); const isDarkMode = useUiSetting('theme:darkMode'); - const tooltipProps = { - headerFormatter: (tooltipValue: TooltipValue) => - moment(tooltipValue.value).format('Y-MM-DD HH:mm:ss.SSS'), + const tooltipProps: TooltipProps = { + headerFormatter: ({ value }) => + moment(value).format('Y-MM-DD HH:mm:ss.SSS'), }; const dataDomain = timeseries ? calculateDomain(timeseries, [chartMetric], false) : null; diff --git a/x-pack/plugins/infra/public/pages/metrics/metric_detail/components/chart_section_vis.tsx b/x-pack/plugins/infra/public/pages/metrics/metric_detail/components/chart_section_vis.tsx index 4cf4a16747081..9160ba63e8f6b 100644 --- a/x-pack/plugins/infra/public/pages/metrics/metric_detail/components/chart_section_vis.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/metric_detail/components/chart_section_vis.tsx @@ -14,8 +14,8 @@ import { niceTimeFormatter, Position, Settings, - TooltipValue, BrushEndListener, + TooltipProps, } from '@elastic/charts'; import { EuiPageContentBody_Deprecated as EuiPageContentBody } from '@elastic/eui'; import { useUiSetting } from '@kbn/kibana-react-plugin/public'; @@ -75,9 +75,9 @@ export const ChartSectionVis = ({ }, [onChangeRangeTime, isLiveStreaming, stopLiveStreaming] ); - const tooltipProps = { - headerFormatter: useCallback( - (data: TooltipValue) => moment(data.value).format(dateFormat || 'Y-MM-DD HH:mm:ss.SSS'), + const tooltipProps: TooltipProps = { + headerFormatter: useCallback>( + ({ value }) => moment(value).format(dateFormat || 'Y-MM-DD HH:mm:ss.SSS'), [dateFormat] ), }; diff --git a/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/chart.tsx b/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/chart.tsx index 3b4b48a2ea1cd..d1f95d77e6338 100644 --- a/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/chart.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/chart.tsx @@ -12,7 +12,7 @@ import { niceTimeFormatter, Position, Settings, - TooltipValue, + TooltipProps, } from '@elastic/charts'; import { EuiFlexGroup, EuiFlexItem, EuiTitle, EuiToolTip } from '@elastic/eui'; import { euiStyled } from '@kbn/kibana-react-plugin/common'; @@ -81,9 +81,9 @@ export const MetricsExplorerChart = ({ ? niceTimeFormatter([firstRow.timestamp, lastRow.timestamp]) : (value: number) => `${value}`; }, [series.rows]); - const tooltipProps = { - headerFormatter: useCallback( - (data: TooltipValue) => moment(data.value).format(dateFormat || 'Y-MM-DD HH:mm:ss.SSS'), + const tooltipProps: TooltipProps = { + headerFormatter: useCallback>( + ({ value }) => moment(value).format(dateFormat || 'Y-MM-DD HH:mm:ss.SSS'), [dateFormat] ), }; From 9fa44027e170c47a12b075afa20d35ae4c13eb29 Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Wed, 24 May 2023 18:29:58 +0000 Subject: [PATCH 5/8] [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix' --- .../common/criterion_preview_chart/criterion_preview_chart.tsx | 3 +-- .../components/node_details/tabs/metrics/chart_section.tsx | 3 +-- .../node_details/tabs/processes/process_row_charts.tsx | 3 +-- .../metrics/inventory_view/components/timeline/timeline.tsx | 3 +-- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/x-pack/plugins/infra/public/alerting/common/criterion_preview_chart/criterion_preview_chart.tsx b/x-pack/plugins/infra/public/alerting/common/criterion_preview_chart/criterion_preview_chart.tsx index 168bb6c30bec5..e2cec0732ebb7 100644 --- a/x-pack/plugins/infra/public/alerting/common/criterion_preview_chart/criterion_preview_chart.tsx +++ b/x-pack/plugins/infra/public/alerting/common/criterion_preview_chart/criterion_preview_chart.tsx @@ -19,8 +19,7 @@ import { GetLogAlertsChartPreviewDataSuccessResponsePayload } from '../../../../ type Series = GetLogAlertsChartPreviewDataSuccessResponsePayload['data']['series']; export const tooltipProps: TooltipProps = { - headerFormatter: ({ value }) => - moment(value).format('Y-MM-DD HH:mm:ss'), + headerFormatter: ({ value }) => moment(value).format('Y-MM-DD HH:mm:ss'), }; export const NUM_BUCKETS = 20; diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/metrics/chart_section.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/metrics/chart_section.tsx index b9d548a5250b3..c1e586e2d04c2 100644 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/metrics/chart_section.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/metrics/chart_section.tsx @@ -60,8 +60,7 @@ export const ChartSection = ({ const isDarkMode = useUiSetting('theme:darkMode'); const metrics = series.map((chartSeries) => chartSeries.metric); const tooltipProps: TooltipProps = { - headerFormatter: ({ value }) => - moment(value).format('Y-MM-DD HH:mm:ss.SSS'), + headerFormatter: ({ value }) => moment(value).format('Y-MM-DD HH:mm:ss.SSS'), }; return ( diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/processes/process_row_charts.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/processes/process_row_charts.tsx index 88e48c64df01a..7732f2c5a3f75 100644 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/processes/process_row_charts.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/processes/process_row_charts.tsx @@ -96,8 +96,7 @@ const ProcessChart = ({ timeseries, color, label }: ProcessChartProps) => { const yAxisFormatter = createFormatter('percent'); const tooltipProps: TooltipProps = { - headerFormatter: ({ value }) => - moment(value).format('Y-MM-DD HH:mm:ss.SSS'), + headerFormatter: ({ value }) => moment(value).format('Y-MM-DD HH:mm:ss.SSS'), }; const dataDomain = calculateDomain(timeseries, [chartMetric], false); diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/timeline/timeline.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/timeline/timeline.tsx index 524845aafa48f..3df6f846e9952 100644 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/timeline/timeline.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/timeline/timeline.tsx @@ -124,8 +124,7 @@ export const Timeline: React.FC = ({ interval, yAxisFormatter, isVisible const isDarkMode = useUiSetting('theme:darkMode'); const tooltipProps: TooltipProps = { - headerFormatter: ({ value }) => - moment(value).format('Y-MM-DD HH:mm:ss.SSS'), + headerFormatter: ({ value }) => moment(value).format('Y-MM-DD HH:mm:ss.SSS'), }; const dataDomain = timeseries ? calculateDomain(timeseries, [chartMetric], false) : null; From a11e846823c3f0acc340bb0b4c20e9dd4e96d4bd Mon Sep 17 00:00:00 2001 From: nickofthyme Date: Wed, 24 May 2023 12:37:41 -0700 Subject: [PATCH 6/8] improve typing of customTooltip on chart settings --- .../ml/public/application/explorer/swimlane_container.tsx | 3 ++- .../profiling/public/components/stacked_bar_chart/index.tsx | 4 ++-- .../components/risk_score/risk_score_over_time/index.tsx | 6 +++--- .../step_waterfall_chart/waterfall/waterfall_bar_chart.tsx | 4 ++-- .../synthetics/waterfall/components/waterfall_bar_chart.tsx | 4 ++-- 5 files changed, 11 insertions(+), 10 deletions(-) diff --git a/x-pack/plugins/ml/public/application/explorer/swimlane_container.tsx b/x-pack/plugins/ml/public/application/explorer/swimlane_container.tsx index cbff2587ccf4c..0e7ebac306bce 100644 --- a/x-pack/plugins/ml/public/application/explorer/swimlane_container.tsx +++ b/x-pack/plugins/ml/public/application/explorer/swimlane_container.tsx @@ -24,6 +24,7 @@ import { ElementClickListener, TooltipValue, HeatmapSpec, + CustomTooltip, TooltipSettings, HeatmapBrushEvent, Position, @@ -83,7 +84,7 @@ export function isViewBySwimLaneData(arg: any): arg is ViewBySwimLaneData { * Provides a custom tooltip for the anomaly swim lane chart. */ const SwimLaneTooltip = - (fieldName?: string): FC<{ values: TooltipValue[] }> => + (fieldName?: string): CustomTooltip => ({ values }) => { const tooltipData: TooltipValue[] = []; diff --git a/x-pack/plugins/profiling/public/components/stacked_bar_chart/index.tsx b/x-pack/plugins/profiling/public/components/stacked_bar_chart/index.tsx index 0dbaad53292c9..e423174587241 100644 --- a/x-pack/plugins/profiling/public/components/stacked_bar_chart/index.tsx +++ b/x-pack/plugins/profiling/public/components/stacked_bar_chart/index.tsx @@ -17,7 +17,7 @@ import { Tooltip, XYChartElementEvent, TooltipContainer, - TooltipInfo, + CustomTooltip, } from '@elastic/charts'; import { EuiPanel } from '@elastic/eui'; import { keyBy } from 'lodash'; @@ -57,7 +57,7 @@ export function StackedBarChart({ const { chartsBaseTheme, chartsTheme } = useProfilingChartsTheme(); - function CustomTooltipWithSubChart(props: TooltipInfo) { + const CustomTooltipWithSubChart: CustomTooltip = () => { if (!highlightedSample) { return null; } diff --git a/x-pack/plugins/security_solution/public/explore/components/risk_score/risk_score_over_time/index.tsx b/x-pack/plugins/security_solution/public/explore/components/risk_score/risk_score_over_time/index.tsx index 99de9b11740e7..a0651a626abda 100644 --- a/x-pack/plugins/security_solution/public/explore/components/risk_score/risk_score_over_time/index.tsx +++ b/x-pack/plugins/security_solution/public/explore/components/risk_score/risk_score_over_time/index.tsx @@ -6,7 +6,7 @@ */ import React, { useMemo, useCallback } from 'react'; -import type { TooltipValue } from '@elastic/charts'; +import type { TooltipHeaderFormatter, TooltipValue } from '@elastic/charts'; import { Chart, LineSeries, @@ -80,8 +80,8 @@ const RiskScoreOverTimeComponent: React.FC = ({ const timeZone = useTimeZone(); const dataTimeFormatter = useMemo(() => histogramDateTimeFormatter([from, to]), [from, to]); - const headerFormatter = useCallback( - (tooltip: TooltipValue) => , + const headerFormatter = useCallback( + ({ value }) => , [] ); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_bar_chart.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_bar_chart.tsx index 804e0828e3143..547c173292048 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_bar_chart.tsx +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_bar_chart.tsx @@ -16,8 +16,8 @@ import { ScaleType, Settings, TickFormatter, - TooltipInfo, TooltipContainer, + CustomTooltip, } from '@elastic/charts'; import { useEuiTheme } from '@elastic/eui'; import { useChartTheme } from '../../../../../../hooks/use_chart_theme'; @@ -36,7 +36,7 @@ const getChartHeight = (data: WaterfallData): number => { return noOfXBars * BAR_HEIGHT; }; -const Tooltip = (tooltipInfo: TooltipInfo) => { +const Tooltip: CustomTooltip = (tooltipInfo) => { const { data, sidebarItems } = useWaterfallContext(); return useMemo(() => { const sidebarItem = sidebarItems?.find((item) => item.index === tooltipInfo.header?.value); diff --git a/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall_bar_chart.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall_bar_chart.tsx index 04e4ea67369f5..0c5b8b34e2afd 100644 --- a/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall_bar_chart.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall_bar_chart.tsx @@ -16,8 +16,8 @@ import { ScaleType, Settings, TickFormatter, - TooltipInfo, TooltipContainer, + CustomTooltip, } from '@elastic/charts'; import { BAR_HEIGHT } from './constants'; import { useChartTheme } from '../../../../../hooks/use_chart_theme'; @@ -34,7 +34,7 @@ const getChartHeight = (data: WaterfallData): number => { return noOfXBars * BAR_HEIGHT; }; -const Tooltip = (tooltipInfo: TooltipInfo) => { +const Tooltip: CustomTooltip = (tooltipInfo) => { const { data, sidebarItems } = useWaterfallContext(); return useMemo(() => { const sidebarItem = sidebarItems?.find((item) => item.index === tooltipInfo.header?.value); From e2d5103a085ad2c6260f766b2f2c40f29ab18a2e Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Wed, 24 May 2023 19:47:56 +0000 Subject: [PATCH 7/8] [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix' --- .../profiling/public/components/stacked_bar_chart/index.tsx | 2 +- .../components/risk_score/risk_score_over_time/index.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/x-pack/plugins/profiling/public/components/stacked_bar_chart/index.tsx b/x-pack/plugins/profiling/public/components/stacked_bar_chart/index.tsx index e423174587241..1279ba4694be1 100644 --- a/x-pack/plugins/profiling/public/components/stacked_bar_chart/index.tsx +++ b/x-pack/plugins/profiling/public/components/stacked_bar_chart/index.tsx @@ -90,7 +90,7 @@ export function StackedBarChart({ ); - } + }; return ( diff --git a/x-pack/plugins/security_solution/public/explore/components/risk_score/risk_score_over_time/index.tsx b/x-pack/plugins/security_solution/public/explore/components/risk_score/risk_score_over_time/index.tsx index a0651a626abda..a8906bfab2fa6 100644 --- a/x-pack/plugins/security_solution/public/explore/components/risk_score/risk_score_over_time/index.tsx +++ b/x-pack/plugins/security_solution/public/explore/components/risk_score/risk_score_over_time/index.tsx @@ -6,7 +6,7 @@ */ import React, { useMemo, useCallback } from 'react'; -import type { TooltipHeaderFormatter, TooltipValue } from '@elastic/charts'; +import type { TooltipHeaderFormatter } from '@elastic/charts'; import { Chart, LineSeries, From b03ff66b91e12d1791cc91263ab33b4c40bde9d3 Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Thu, 1 Jun 2023 23:25:18 +0000 Subject: [PATCH 8/8] [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix' --- .../metrics/inventory_view/components/timeline/timeline.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/timeline/timeline.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/timeline/timeline.tsx index ac39c649fe936..460065668ee19 100644 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/timeline/timeline.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/timeline/timeline.tsx @@ -125,7 +125,7 @@ export const Timeline: React.FC = ({ interval, yAxisFormatter, isVisible const isDarkMode = useIsDarkMode(); const tooltipProps: TooltipProps = { headerFormatter: ({ value }) => moment(value).format('Y-MM-DD HH:mm:ss.SSS'), - } + }; const dataDomain = timeseries ? calculateDomain(timeseries, [chartMetric], false) : null; const domain = dataDomain