-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f2450bc
commit dba8f27
Showing
89 changed files
with
2,098 additions
and
317 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
22 changes: 22 additions & 0 deletions
22
packages/components/src/components/common/combineAnnotations.spec.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,22 @@ | ||
import { combineAnnotations } from './combineAnnotations'; | ||
import { TIME_SERIES_DATA_WITH_ALARMS } from '@iot-app-kit/source-iotsitewise'; | ||
|
||
it('correctly combines annotations annotations', () => { | ||
const combinedAnnotations = combineAnnotations( | ||
{ | ||
colorDataAcrossThresholds: true, | ||
show: true, | ||
thresholdOptions: true, | ||
}, | ||
{ | ||
y: TIME_SERIES_DATA_WITH_ALARMS.annotations.y, | ||
} | ||
); | ||
|
||
expect(combinedAnnotations).toEqual({ | ||
colorDataAcrossThresholds: true, | ||
show: true, | ||
thresholdOptions: true, | ||
y: TIME_SERIES_DATA_WITH_ALARMS.annotations.y, | ||
}); | ||
}); |
8 changes: 8 additions & 0 deletions
8
packages/components/src/components/common/combineAnnotations.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,8 @@ | ||
import { Annotations } from '@synchro-charts/core'; | ||
|
||
export const combineAnnotations = (prev: Annotations, cur: Annotations): Annotations => { | ||
return { | ||
...prev, | ||
y: [...(prev?.y || []), ...(cur?.y || [])], | ||
}; | ||
}; |
3 changes: 3 additions & 0 deletions
3
packages/components/src/components/common/getAlarmStreamAnnotations.spec.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,3 @@ | ||
it('todo', () => { | ||
// TODO | ||
}); |
19 changes: 19 additions & 0 deletions
19
packages/components/src/components/common/getAlarmStreamAnnotations.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,19 @@ | ||
import { Annotations, YAnnotation } from '@synchro-charts/core'; | ||
import { DataStream } from '@iot-app-kit/core'; | ||
|
||
export const getAlarmStreamAnnotations = ({ | ||
annotations, | ||
dataStreams, | ||
}: { | ||
annotations: Annotations; | ||
dataStreams: DataStream[]; | ||
}): { y: YAnnotation[] | undefined } => ({ | ||
y: (annotations as Annotations).y?.filter((yAnnotation) => { | ||
return ( | ||
'dataStreamIds' in yAnnotation && | ||
yAnnotation.dataStreamIds?.some((dataStreamId) => | ||
dataStreams.some((dataStream) => dataStream.streamType === 'ALARM' && dataStreamId === dataStream.id) | ||
) | ||
); | ||
}), | ||
}); |
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
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
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
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
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
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
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
Oops, something went wrong.