From fbd32721da7e35cd1540f4e221c8812bbed6e0f0 Mon Sep 17 00:00:00 2001 From: Tyler Ohlsen Date: Wed, 2 Sep 2020 07:46:21 -0700 Subject: [PATCH] Make elastic/charts imports more generic (#297) --- .../Dashboard/Components/AnomaliesDistribution.tsx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/public/pages/Dashboard/Components/AnomaliesDistribution.tsx b/public/pages/Dashboard/Components/AnomaliesDistribution.tsx index d04d6719..1a8df49a 100644 --- a/public/pages/Dashboard/Components/AnomaliesDistribution.tsx +++ b/public/pages/Dashboard/Components/AnomaliesDistribution.tsx @@ -28,9 +28,9 @@ import { //@ts-ignore EuiStat, } from '@elastic/eui'; -import { Chart, Partition, PartitionLayout } from '@elastic/charts/dist/index'; +import { Chart, Partition, PartitionLayout } from '@elastic/charts'; import { useDispatch } from 'react-redux'; -import { Datum } from '@elastic/charts/dist/utils/commons'; +import { Datum } from '@elastic/charts'; import React from 'react'; import { TIME_RANGE_OPTIONS } from '../../Dashboard/utils/constants'; import { get, isEmpty } from 'lodash'; @@ -86,7 +86,7 @@ export const AnomaliesDistributionChart = ( const getFinalIndices = (detectorList: DetectorListItem[]) => { const indicesSet = new Set(); - detectorList.forEach(detectorItem => { + detectorList.forEach((detectorItem) => { indicesSet.add(detectorItem.indices.toString()); }); @@ -98,11 +98,11 @@ export const AnomaliesDistributionChart = ( detectorList: DetectorListItem[] ): DetectorListItem[] => { const detectorSet = new Set(); - finalAnomalyResult.forEach(anomalyResult => { + finalAnomalyResult.forEach((anomalyResult) => { detectorSet.add(get(anomalyResult, AD_DOC_FIELDS.DETECTOR_ID, '')); }); - const filteredDetectors = detectorList.filter(detector => + const filteredDetectors = detectorList.filter((detector) => detectorSet.has(detector.id) ); @@ -186,7 +186,7 @@ export const AnomaliesDistributionChart = ( textInvertible: true, }, shape: { - fillColor: d => { + fillColor: (d) => { return fillOutColors( d, (d.x0 + d.x1) / 2 / (2 * Math.PI), @@ -204,7 +204,7 @@ export const AnomaliesDistributionChart = ( textInvertible: true, }, shape: { - fillColor: d => { + fillColor: (d) => { return fillOutColors( d, (d.x0 + d.x1) / 2 / (2 * Math.PI),