Skip to content

Commit

Permalink
Add field to determine if charts are sample anomalies or not
Browse files Browse the repository at this point in the history
  • Loading branch information
ohltyler committed Dec 14, 2020
1 parent 8e2aceb commit 33b4c0c
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 10 deletions.
15 changes: 9 additions & 6 deletions public/pages/AnomalyCharts/containers/AnomaliesChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ interface AnomaliesChartProps {
dateRange: DateRange;
isLoading: boolean;
showAlerts?: boolean;
isNotSample?: boolean;
detector: Detector;
monitor?: Monitor;
children: React.ReactNode | React.ReactNode[];
Expand Down Expand Up @@ -240,20 +241,21 @@ export const AnomaliesChart = React.memo((props: AnomaliesChartProps) => {
anomalySummary={INITIAL_ANOMALY_SUMMARY}
isLoading={props.isLoading}
anomalyGradeSeriesName={getAnomalyGradeWording(
props.showAlerts
props.isNotSample
)}
confidenceSeriesName={getConfidenceWording(
props.showAlerts
props.isNotSample
)}
showAlerts={props.showAlerts}
isNotSample={props.isNotSample}
detector={props.detector}
isHCDetector={props.isHCDetector}
selectedHeatmapCell={props.selectedHeatmapCell}
/>,
<EuiSpacer size="m" />,
<FeatureBreakDown
title={getFeatureBreakdownWording(
props.showAlerts
props.isNotSample
)}
//@ts-ignore
detector={props.newDetector}
Expand All @@ -266,7 +268,7 @@ export const AnomaliesChart = React.memo((props: AnomaliesChartProps) => {
//@ts-ignore
dateRange={props.zoomRange}
featureDataSeriesName={getFeatureDataWording(
props.showAlerts
props.isNotSample
)}
isHCDetector={props.isHCDetector}
selectedHeatmapCell={props.selectedHeatmapCell}
Expand All @@ -287,9 +289,10 @@ export const AnomaliesChart = React.memo((props: AnomaliesChartProps) => {
bucketizedAnomalies={props.bucketizedAnomalies}
anomalySummary={props.anomalySummary}
isLoading={props.isLoading}
anomalyGradeSeriesName={getAnomalyGradeWording(props.showAlerts)}
confidenceSeriesName={getConfidenceWording(props.showAlerts)}
anomalyGradeSeriesName={getAnomalyGradeWording(props.isNotSample)}
confidenceSeriesName={getConfidenceWording(props.isNotSample)}
showAlerts={props.showAlerts}
isNotSample={props.isNotSample}
detector={props.detector}
monitor={props.monitor}
isHCDetector={props.isHCDetector}
Expand Down
9 changes: 5 additions & 4 deletions public/pages/AnomalyCharts/containers/AnomalyDetailsChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ interface AnomalyDetailsChartProps {
dateRange: DateRange;
isLoading: boolean;
showAlerts?: boolean;
isNotSample?: boolean;
anomalyGradeSeriesName: string;
confidenceSeriesName: string;
detector: Detector;
Expand Down Expand Up @@ -200,7 +201,7 @@ export const AnomalyDetailsChart = React.memo(
<EuiFlexItem>
<EuiStat
title={isLoading ? '-' : anomalySummary.anomalyOccurrence}
description={getAnomalyOccurrenceWording(props.showAlerts)}
description={getAnomalyOccurrenceWording(props.isNotSample)}
titleSize="s"
/>
</EuiFlexItem>
Expand All @@ -209,7 +210,7 @@ export const AnomalyDetailsChart = React.memo(
isLoading={isLoading}
minValue={anomalySummary.minAnomalyGrade}
maxValue={anomalySummary.maxAnomalyGrade}
description={getAnomalyGradeWording(props.showAlerts)}
description={getAnomalyGradeWording(props.isNotSample)}
tooltip="Indicates to what extent this data point is anomalous. The scale ranges from 0 to 1."
/>
</EuiFlexItem>
Expand All @@ -218,14 +219,14 @@ export const AnomalyDetailsChart = React.memo(
isLoading={isLoading}
minValue={anomalySummary.minConfidence}
maxValue={anomalySummary.maxConfidence}
description={getConfidenceWording(props.showAlerts)}
description={getConfidenceWording(props.isNotSample)}
tooltip="Indicates the level of confidence in the anomaly result."
/>
</EuiFlexItem>
<EuiFlexItem>
<EuiStat
title={isLoading ? '' : anomalySummary.lastAnomalyOccurrence}
description={getLastAnomalyOccurrenceWording(props.showAlerts)}
description={getLastAnomalyOccurrenceWording(props.isNotSample)}
titleSize="s"
/>
</EuiFlexItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ interface AnomalyOccurrenceChartProps {
dateRange: DateRange;
isLoading: boolean;
showAlerts?: boolean;
isNotSample?: boolean;
anomalyGradeSeriesName: string;
confidenceSeriesName: string;
detector: Detector;
Expand Down Expand Up @@ -94,6 +95,7 @@ export const AnomalyOccurrenceChart = React.memo(
anomalyGradeSeriesName={props.anomalyGradeSeriesName}
confidenceSeriesName={props.confidenceSeriesName}
showAlerts={props.showAlerts}
isNotSample={props.isNotSample}
detector={props.detector}
monitor={props.monitor}
isHCDetector={props.isHCDetector}
Expand Down
3 changes: 3 additions & 0 deletions public/pages/DetectorResults/containers/AnomalyHistory.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ interface AnomalyHistoryProps {
isFeatureDataMissing?: boolean;
isHistorical?: boolean;
taskId?: string;
isNotSample?: boolean;
}

export const AnomalyHistory = (props: AnomalyHistoryProps) => {
Expand Down Expand Up @@ -333,6 +334,7 @@ export const AnomalyHistory = (props: AnomalyHistoryProps) => {
anomalySummary={bucketizedAnomalySummary}
isLoading={isLoading || isLoadingAnomalyResults}
showAlerts={props.isHistorical ? false : true}
isNotSample={props.isNotSample}
detector={props.detector}
monitor={props.monitor}
isHCDetector={isHCDetector}
Expand Down Expand Up @@ -397,6 +399,7 @@ export const AnomalyHistory = (props: AnomalyHistoryProps) => {
anomalyGradeSeriesName="Anomaly grade"
confidenceSeriesName="Confidence"
showAlerts={true}
isNotSample={true}
detector={props.detector}
monitor={props.monitor}
isHCDetector={isHCDetector}
Expand Down
1 change: 1 addition & 0 deletions public/pages/DetectorResults/containers/AnomalyResults.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,7 @@ export function AnomalyResults(props: AnomalyResultsProps) {
detector={detector}
monitor={monitor}
isFeatureDataMissing={isDetectorMissingData}
isNotSample={true}
/>
</Fragment>
) : detector ? (
Expand Down
1 change: 1 addition & 0 deletions public/pages/EditFeatures/containers/SampleAnomalies.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ export function SampleAnomalies(props: SampleAnomaliesProps) {
zoomRange={zoomRange}
anomaliesResult={anomaliesResult}
showAlerts={false}
isNotSample={false}
/>
<EuiSpacer />
{isLoading ? (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,7 @@ export const HistoricalDetectorDetail = (
isFeatureDataMissing={isDetectorMissingData}
isHistorical={true}
taskId={detector?.taskId}
isNotSample={true}
/>
</EuiFlexItem>
{/* <EuiFlexItem>
Expand Down

0 comments on commit 33b4c0c

Please sign in to comment.