Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Commit

Permalink
Make elastic/charts imports more generic (#297)
Browse files Browse the repository at this point in the history
  • Loading branch information
ohltyler committed Sep 2, 2020
1 parent e9b4dc0 commit daed78a
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions public/pages/Dashboard/Components/AnomaliesDistribution.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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());
});

Expand All @@ -98,11 +98,11 @@ export const AnomaliesDistributionChart = (
detectorList: DetectorListItem[]
): DetectorListItem[] => {
const detectorSet = new Set<string>();
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)
);

Expand Down Expand Up @@ -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),
Expand All @@ -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),
Expand Down

0 comments on commit daed78a

Please sign in to comment.