Skip to content

Commit af21952

Browse files
iot-app-kit-botNorbertNaderdiehbriaTheEvilDevboweihan
authored
commit by Octane (#137)
* Release 1.2.1 (#85) * fix: unsubrscribe data provider on component updates * Release 1.2.1 Co-authored-by: Norbert Nader <[email protected]> * fix: resolves #83 (#87) * fix: resolves #83 * Update index.ts Co-authored-by: Norbert Nader <[email protected]> * feat: improve documentation (#90) * Run tests on pull request (#91) * Update reference to code name (#86) AWS-UI internal code name is mentioned in the readme. Co-authored-by: Norbert Nader <[email protected]> * feat: update synchro charts to 3.1.0, update docs (#92) * feat: Improve documentation formatting (#93) * feat: Improve resource explorer docs (#95) * Update README.md (#94) * feat: support fetchMostRecentBeforeStart (#79) * Update documentation & make react-components easier to use (#98) * Utilize lock file in CI (#99) * build(deps): bump async from 2.6.3 to 2.6.4 (#100) Bumps [async](https://github.com/caolan/async) from 2.6.3 to 2.6.4. - [Release notes](https://github.com/caolan/async/releases) - [Changelog](https://github.com/caolan/async/blob/v2.6.4/CHANGELOG.md) - [Commits](caolan/async@v2.6.3...v2.6.4) --- updated-dependencies: - dependency-name: async dependency-type: indirect ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * feat: support auto-assigning colors for certain components (#96) * feat: support auto-assigning colors for certain components * Update package.json * Update cypress to v9, added stricted linting, fixed linting warnings and errors (#104) * Add stylelint and enforce via global package.json (#106) * use most recent synchro-charts version, 4.0.1 (#111) * build(deps): bump eventsource from 1.1.0 to 1.1.1 (#116) Bumps [eventsource](https://github.com/EventSource/eventsource) from 1.1.0 to 1.1.1. - [Release notes](https://github.com/EventSource/eventsource/releases) - [Changelog](https://github.com/EventSource/eventsource/blob/master/HISTORY.md) - [Commits](EventSource/eventsource@v1.1.0...v1.1.1) --- updated-dependencies: - dependency-name: eventsource dependency-type: indirect ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * feat: expand children in resource explorer (#115) * feat: expand children in resource explorer * fix typo * Fix asset module cache * Add logic for fetching hierarchies * Add tests * Improve insert * Fix linting Co-authored-by: Norbert Nader <[email protected]> * Update README.md (#121) Fix test runner status badge * Bump minor version (#120) * specify react types package version to be 17 (#134) Co-authored-by: Xinyi <[email protected]> * build(deps): bump parse-url from 6.0.0 to 6.0.2 (#142) Bumps [parse-url](https://github.com/IonicaBizau/parse-url) from 6.0.0 to 6.0.2. - [Release notes](https://github.com/IonicaBizau/parse-url/releases) - [Commits](https://github.com/IonicaBizau/parse-url/commits) --- updated-dependencies: - dependency-name: parse-url dependency-type: indirect ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Fix: Development Quick Start Docs/Scripts (#148) * add yarn bootstrap script to replace lerna bootstrap * specify supported node and yarn engines * simplify development docs and update build steps Co-authored-by: Thomas Juranek <[email protected]> * build(deps): bump moment from 2.29.2 to 2.29.4 (#149) Bumps [moment](https://github.com/moment/moment) from 2.29.2 to 2.29.4. - [Release notes](https://github.com/moment/moment/releases) - [Changelog](https://github.com/moment/moment/blob/develop/CHANGELOG.md) - [Commits](moment/moment@2.29.2...2.29.4) --- updated-dependencies: - dependency-name: moment dependency-type: indirect ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix: update @testing-library/react to use create root (#151) Co-authored-by: Norbert Nader <[email protected]> * feat(props): adapt props for synchro-charts (#133) * feat(props): adapt props for synchro-charts * add testing for new props * fix(tests): cleanup tests from devwork * Update changelog * update tests to wait for intercepts Co-authored-by: Norbert Nader <[email protected]> * feat: batch API for historical, aggregated, and latest value data (#137) * fix: resolve float decimal precision issue on round() function. (#160) * fix: update @testing-library/react to use create root * fix: resolve float decimal precision issue on round() function. * Simplify round() function. Remove managing the negative sign separately. Co-authored-by: Norbert Nader <[email protected]> * sync changes with private repo for common files (#150) * sync changes with private repo for common files * Revert "fix: update @testing-library/react to use create root (#151)" This reverts commit 960f53f. Co-authored-by: Xinyi <[email protected]> * Update npm packages repository (#161) * build(deps): bump terser from 4.8.0 to 4.8.1 (#168) Bumps [terser](https://github.com/terser/terser) from 4.8.0 to 4.8.1. - [Release notes](https://github.com/terser/terser/releases) - [Changelog](https://github.com/terser/terser/blob/master/CHANGELOG.md) - [Commits](https://github.com/terser/terser/commits) --- updated-dependencies: - dependency-name: terser dependency-type: indirect ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * docs: Fix KPI docs and explain behavior of querying timer-series data when resolution is omitted * bump synchro-charts/core version from v5 to v6 (#199) Co-authored-by: Thomas Juranek <[email protected]> * docs: Add coding guidelines * organize coding guidelines into sections and reword items (#212) sentance casing on headings Co-authored-by: Thomas Juranek <[email protected]> * feat(core)!: Refactor time series data module to remove unused functionality. Add meta field to data stream. BREAKING CHANGE: Refactored export from `@iot-app-kit/core` IoTAppKitDataModule to be named TimeSeriesDataModule, and removed the concept of multiple data sources per time series data module * feat(core): Support caching of dataType, name and other fields describing dataStreams * feat(core,source-iotsitewise)!: Change time series data modules getRequestsFromQueries to be async Fix various eslint errors on existing code * chore: remove unecessary template section * build: npm workspaces (#231) * feat(core): Add meta field to requestInfos in TimeSeriesDataModule * build: npm publish with npm workspaces (#233) * docs: add documentation for publishing new packages (#236) * docs: add documentation around data sources and time series data * feat(core): Add viewportManager to orchestrate viewport syncing within groups * docs(core): Add documentation for viewportManager; export viewportManager from pkg * feat: set up table package and add createTableItems method (#124) - config typescript & rollup - config jest - config eslint - add unit tests for createTableItems method - updated .eslintrc.js at project root level fix: update tsconfig path in eslintrc for Table package. - remove unused variables. fix: add tests for dataFilters.ts - update descriptions for tests in createTableItems.spec.ts - add one test case for getting data point from aggregated datastream fix: remove unnecessary describe block fix: use object to replace CellItem class - add createCellItem function - add unit tests for createCellItem - rename SC_DataStream to SynchroChartsDataStream for better consistency fix: remove unused import - update createCellItem tests. * feat(table): create new Table component based on AWSUI Table component (#129) feat: add helper functions for - iconUtils.tsx - copied from synchro-charts with changes. - iconUtils.spec.ts - copied from synchro-charts with changes: -- add one test cases, that color are provided, compared with the original. - spinner.tsx - copied from synchro-charts with adjustments for React - spinner.spec.tsx - copied from synchro-charts with adjustments for React feat: add the main table component fix: remove generic types for TableProps fix: add size to loading spinner fix: remove unnecessary TS compiler options update a few things based on comments from PR. Fix: remove full file eslint disable. Switch to minimal eslint disable. * fix(table): fix an issue when key in columnDefinition doesn't exist in TableItems (#146) fix: remove unused variables. * feat!(component): replace table component in @iot-app-kit/components (#147) * feat: Replace iot-table with new version. * Update autogenerated types * fix import * another fix for import * another fix for import * Remove unused property for Iot. * Fix a typo * Code cleanups. * Code cleanups. * update type of `ColumnDefinition.formatter` also added a few use cases in testing-ground.tsx * update type of `ColumnDefinition.formatter` also added a few use cases in testing-ground.tsx * Update asset/property IDs and table examples. * update: add formatter to filterOptions Property filtering options now has the same displayed value as table. * update formatPropertyFilterOptions function to better handle error & loading states. * update test examples for table component. * Disable Customized formatter for property filter options. * update test cases after disabled formatter for filter options * Remove unused dependency. * a few bug fixes - Split sorting and propertyFiltering - Remove formatting on property filtering options. * UI adjustment - center icon and string vertically. * Update styles and unit tests * Remove unused imports and statements. * Reformat css file * Restore testing ground * chore(table): Merge changes from mainline and other changes: (#169) * docs(table): update docs and add README.md (#165) * Update docs. Add README.md for new table component. * fix(table): add missing brackets. (#183) * docs(table): update docs / major version bump for breaking changes.(#213) * feat(table): support messageOverrides (#211) * chore(table): add missing tests (#215) - render correct data based on different viewports - render spinner when a datastream is loading - render error icon and message when a datastream in error state - render icon and apply styles when it breaches thresholds * docs(table): update docs / remove unnecessary jest configuration (#217) * fix(components): move message merge to componentWillRender() - clean git history and update doc - removed unused method in `iot-react-table.tsx` * build: add table to workspace - updated docs - export `dataFilters` from core and removed duplications from table. - update npm-publish.yml - update table styles - iot-table: watch messageOverrides for changes * docs(table): revert version bumps and doc changes. * chore: update changelogs & docs / major version bumps to 2.0.0 * fix(components): import missing CSS style sheets. * doc: update link in Coding Guidelines * feat(TwinMaker): Add TwinMaker packages (#252) * build(deps): bump scss-tokenizer from 0.3.0 to 0.4.3 Bumps [scss-tokenizer](https://github.com/sasstools/scss-tokenizer) from 0.3.0 to 0.4.3. - [Release notes](https://github.com/sasstools/scss-tokenizer/releases) - [Commits](sasstools/scss-tokenizer@v0.3.0...v0.4.3) --- updated-dependencies: - dependency-name: scss-tokenizer dependency-type: indirect ... Signed-off-by: dependabot[bot] <[email protected]> * doc(TwinMaker): update TwinMaker docs and link them to the main doc (#256) * chore: update changelogs & version bump (#257) * chore(components): reduce concurrent workers in testing * Fixes the Camera Component Editor for Lens and Clipping planes updates when changing between cameras (#263) * chore(examples): easier linking for iot-app-kit packages (#265) * feat(components): support viewport grouping in iot-table using ViewportManager. * feat(EnvironmentModel): Adding support for environment overlay (#262) Add the EnvironmentModelComponent to adi in possible updates for loading of model later as well as offload responsibility from ModelRefComponent Adds a menu item to the add object menu to add at most 1 environment model Removes Sub model Tree from Environment models Add more restrictions to the Environment nodes. - Environment Nodes cannot have children - Environment Nodes have no Transform Editor - Environment Nodes cannot have Transform controls - Environment Nodes cannot have a model shader - Environment controls cannot have children Add tests * Fix: Updating documentation for Storybook (#264) Co-authored-by: Emily Dodds <[email protected]> * chore(CameraView): Removes the dependency on the feature flag for the top bar camera drowpdown (#267) This will improve the following: 1. No longer require a feature flag so no special build of grafana is required once feature ships 2. If there are no cameras we don't show the UI as it is confusing 3. This restores not showing the View Options if there are no Motion Indicators 4. Hides the top bar if neither exist for more screen real estate * fix(core): add currentTime param to viewportStartDate and `viewportEndDate` * fix(react-components, videoPlayer): fix propertiesNotChanged for videoPlayer * chore(TagResize): Add flag to resizable tags (#270) * Iotroci 8819 (#271) * Fix: Refactor to improve ViewCursorWidget performance * CR Feedback * cleanup * Fix from running npm run build Co-authored-by: Emily Dodds <[email protected]> * Fix: Allows user to hit Esc key to cancel Enhanced Editing (#272) Authored-by: Emily Dodds <[email protected]> * fix(composer): selectedDataBinding not able to update selected node (#274) * doc: add TwinMaker components to GettingStarted doc (#275) Co-authored-by: Xinyi Xu <[email protected]> * fix(composer): use arrow data as texture to avoid public path issue (#276) * fix(composer): fix show svg (#279) * chore: code cleanup (#278) * fix(composer): fix adding tag always attached to root (#281) * fix: Fix the tag scaling with parent scale regression (#282) * Fix the tag scaling with parent scale regression * Re-add the change to handl the submodel ref as a parent * fix(SceneHierarchyPerformance): SceneHierarchy Tree Performance (#283) - Reduces the number of rerenders significantly in the SceneHierarchy Tree view whenever actions like activating, selecting and removing happen - Removes redundent On2 loop when computing children for a scene hierarchy node - Cleans up some new responsibilities for TreeItem and Tree Label that were added in the wrong places. Co-authored-by: Mitchell Lee <[email protected]> * fix(CameraView): Minimum FOV check introduced (#284) * feat: Introduce alarms (#135) * Fix the camera zoom field locked to 1 or greater (#286) * Add success popup message when updating camera location (#285) * Update the text from Cameras in the drop down to Camera View (#287) * fix(composer): fix model shader material color restore (#290) * Chore: CSS updates to Scene Hierarchy (#289) * Fix: CSS updates to Scene Hierarchy * Eslint fix * Improving test coverage * Eslint fixes for new test coverage Co-authored-by: Emily Dodds <[email protected]> * Release 2.2.0 (#292) * fix(composer): Fixes 2nd camera viewing click bug (#291) * fix(composer): Fixes 2nd camera viewing click to look at object rather than view. * Update the package.json test branch numbers due to auto-ratchet Co-authored-by: Emily Dodds <[email protected]> * fix(composer):Camera and Light helper visibility toggling (#294) * fix(deps): update synchro-charts, node-sass, nth-check (#295) * chore: fix internal build (#300) * chore: setup release-please (#301) * fix(composer): update translations (#302) Co-authored-by: Xinyi Xu <[email protected]> Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: Norbert Nader <[email protected]> Co-authored-by: Norbert Nader <[email protected]> Co-authored-by: db <[email protected]> Co-authored-by: Mitchell Lee <[email protected]> Co-authored-by: Bowei Han <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Xinyi Xu <[email protected]> Co-authored-by: Xinyi <[email protected]> Co-authored-by: Thomas Juranek <[email protected]> Co-authored-by: Thomas Juranek <[email protected]> Co-authored-by: Xiao(Bill) Li <[email protected]> Co-authored-by: jmbuss <[email protected]> Co-authored-by: Brian Diehr <[email protected]> Co-authored-by: Jonathan Wills <[email protected]> Co-authored-by: Emily Dodds <[email protected]> Co-authored-by: Emily Dodds <[email protected]> Co-authored-by: Mitchell Lee <[email protected]> Co-authored-by: Matt Popovich <[email protected]>
1 parent c703fa1 commit af21952

File tree

239 files changed

+17406
-6995
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

239 files changed

+17406
-6995
lines changed

.github/workflows/release-please.yml

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
on:
2+
push:
3+
branches:
4+
- main
5+
name: release-please
6+
jobs:
7+
release-please:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: google-github-actions/release-please-action@v3
11+
id: release
12+
with:
13+
command: manifest
14+
token: ${{secrets.GITHUB_TOKEN}}
15+
default-branch: main
16+
17+
update-pull-request:
18+
name: Update pull request
19+
runs-on: ubuntu-latest
20+
needs: release-please
21+
if: ${{ !needs.release-please.outputs.releases_created }}
22+
steps:
23+
- name: Fetching the repository
24+
uses: actions/checkout@v2
25+
with:
26+
ref: release-please--branches--main
27+
fetch-depth: 2
28+
29+
- name: Setting up Node.js 16
30+
uses: actions/setup-node@v3
31+
with:
32+
node-version: 16.x
33+
34+
- name: Updating package-lock.json file
35+
run: npm install --no-audit --no-fund --ignore-scripts --package-lock-only
36+
37+
- name: Merging changes with last commit
38+
run: |
39+
git config --local user.email "github-actions[bot]@users.noreply.github.com"
40+
git config --local user.name "github-actions[bot]"
41+
git add .
42+
git commit --amend --no-edit
43+
44+
- name: Push changes
45+
uses: ad-m/github-push-action@master
46+
continue-on-error: true
47+
with:
48+
github_token: ${{ secrets.GITHUB_TOKEN }}
49+
branch: release-please--branches--main
50+
force: true

.release-please-manifest.json

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"packages/components": "2.2.0",
3+
"packages/core": "2.2.0",
4+
"packages/react-components": "2.2.0",
5+
"packages/related-table": "2.2.0",
6+
"packages/scene-composer": "2.2.0",
7+
"packages/source-iotsitewise": "2.2.0",
8+
"packages/source-iottwinmaker": "2.2.0",
9+
"packages/table": "2.2.0",
10+
".": "2.2.0"
11+
}

CHANGELOG.md

+55-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,59 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6-
# 2.1.0 (2022-09-30)
6+
## 2.2.0 (2022-10-21)
7+
8+
### Features
9+
10+
* source-iotsitewise, core, components:
11+
* Introduce alarms support ([9bc221e](https://github.com/awslabs/iot-app-kit/commit/9bc221ef19fc5a9db4360c1d124f41e7b0d896be))
12+
13+
* react-components, scene-composer:
14+
* EnvironmentModelComponent for Adding support for environment overlay ([eb91179](https://github.com/awslabs/iot-app-kit/commit/eb911799e555c07c535853661e93237969159ff0))
15+
16+
* core, components:
17+
* Support viewport grouping in iot-table ([be5b588](https://github.com/awslabs/iot-app-kit/commit/be5b588a90ec267a2c8cdce24bdea86b45c97136))
18+
19+
* scene-composer:
20+
* Removes the dependency on the feature flag for the top bar camera drowpdown ([fb8e333](https://github.com/awslabs/iot-app-kit/commit/fb8e3330cc4f4933ccd6f9cde32b1d4694897358))
21+
* Add flag to resizable tags ([560e1b1](https://github.com/awslabs/iot-app-kit/commit/560e1b1a2db0f60700b7246626c71f1bc05f49e1))
22+
23+
### Bug Fixes
24+
25+
* scene-composer:
26+
* Camera Component Editor for Lens and Clipping planes updates when changing between cameras ([94c5978](https://github.com/awslabs/iot-app-kit/commit/94c59786aae02a4c9fd088cfc6c9cea516880f3c))
27+
* improve ViewCursorWidget performance ([58b70bd](https://github.com/awslabs/iot-app-kit/commit/58b70bdc82cd1e4bbcc0c0e7f66bfef3f064e86b))
28+
* Allows user to hit Esc key to cancel Enhanced Editing ([9c1b9e6](https://github.com/awslabs/iot-app-kit/commit/9c1b9e64c725671adb0766d1c080297389385fd8))
29+
* selectedDataBinding not able to update selected node ([b23bce2](https://github.com/awslabs/iot-app-kit/commit/b23bce279b81496583c052a0dc69ac9be5994643))
30+
* use arrow data as texture to avoid public path issue ([0d2e427](https://github.com/awslabs/iot-app-kit/commit/0d2e427354cbd3c0678d579ceaffab84e5e88e5c))
31+
* fix show svg ([cb6094e](https://github.com/awslabs/iot-app-kit/commit/cb6094e724465ccc11d9f7ae7f7fe3179d4d2596))
32+
* fix adding tag always attached to root ([775446a](https://github.com/awslabs/iot-app-kit/commit/775446a210877780c2a220092e6b0210edc7ea2c))
33+
* Fix the tag scaling with parent scale regression ([4483140](https://github.com/awslabs/iot-app-kit/commit/448314018882912a49c8522786bc8ae3c964b7aa))
34+
* SceneHierarchy Tree Performance ([c74d1dc](https://github.com/awslabs/iot-app-kit/commit/c74d1dc8be97135529d55e994834e7dd3f352ee8))
35+
* Minimum FOV check introduced ([720b8e8](https://github.com/awslabs/iot-app-kit/commit/720b8e85d3b8329c898638030e32ad1e910c4e62))
36+
* Fix the camera zoom field locked to 1 or greater ([cada75e](https://github.com/awslabs/iot-app-kit/commit/cada75ec32c81312bf5ee403f10bbf4567c30c05))
37+
* Add success popup message when updating camera location ([4af9c07](https://github.com/awslabs/iot-app-kit/commit/4af9c0758c8adc04f35c80fae2f39b60460e903a))
38+
* Update the text from Cameras in the drop down to Camera View ([5687f5e](https://github.com/awslabs/iot-app-kit/commit/5687f5efc38dabbd0ec06ccc5e395576fa3d57e4))
39+
* fix model shader material color restore ([0786c4a](https://github.com/awslabs/iot-app-kit/commit/0786c4a038cbe93be8a4d7a4b2f7a57bfacd76c2))
40+
* CSS updates to Scene Hierarchy ([ab3c749](https://github.com/awslabs/iot-app-kit/commit/ab3c7490add7338611533e6b68cecefe0f9cb3a1))
41+
42+
* core:
43+
* add currentTime param to viewportStartDate and `viewportEndDate` ([eb02085](https://github.com/awslabs/iot-app-kit/commit/eb02085fd3b0aa987c38278cedc8eba0e56d9fa9))
44+
45+
* react-components:
46+
* fix propertiesNotChanged for videoPlayer ([9a360b1](https://github.com/awslabs/iot-app-kit/commit/9a360b10fc87b2e31b4c6a00d9e49a5224e207d0))
47+
48+
### Documentation
49+
50+
* Updating scene-composer documentation for Storybook ([901ff53](https://github.com/awslabs/iot-app-kit/commit/901ff53efc86d0c68f0cbc15dc7be9dfc00b0243))
51+
* add TwinMaker components to GettingStarted doc ([84e9fdf](https://github.com/awslabs/iot-app-kit/commit/84e9fdfb3b1af3c47343a91ca1259e5e45f1eaac))
52+
53+
### Miscellaneous
54+
55+
* reduce concurrent workers in testing ([e8d6dbc](https://github.com/awslabs/iot-app-kit/commit/e8d6dbcac3f3e2e503e02db0087d5db324e9b521))
56+
* easier linking for iot-app-kit packages ([44d454d](https://github.com/awslabs/iot-app-kit/commit/44d454d955e22581228d3d77829b8ad27a24fd52))
57+
58+
## 2.1.0 (2022-09-30)
759

860
### Features
961

@@ -30,7 +82,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
3082
* update jest versions from 28 to 27 to be consistent with other modules ([f08c541](https://github.com/awslabs/iot-app-kit/commit/f08c541f017f4bbefae085e45c2ef2e686eb5919))
3183

3284

33-
# 2.0.0 (2022-09-14)
85+
## 2.0.0 (2022-09-14)
3486

3587
### BREAKING CHANGES
3688
* core:
@@ -59,7 +111,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
59111
* Migrate to NPM workspaces ([8e200be](https://github.com/awslabs/iot-app-kit/commit/8e200be0401fe6fa989cbf9a1ad96aafd8305a96))
60112

61113

62-
# 1.4.0 (2022-06-09)
114+
## 1.4.0 (2022-06-09)
63115

64116

65117
### Features

docs/AWSIoTSiteWiseSource.md

+27
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,33 @@ Each asset contains the following fields:
112112

113113
Type: String
114114

115+
#### Alarms
116+
117+
AWS IoT SiteWise has a concept of [alarms](https://docs.aws.amazon.com/iot-sitewise/latest/userguide/industrial-alarms.html).
118+
119+
The source of alarms in IoT Application Kit is AWS IoT Events.
120+
121+
AWS IoT Events alarms are able to process and alarm on AWS IoT SiteWise data.
122+
123+
To query for an alarm you have to know the **AlarmState Property ID**. The **AlarmState Property ID** can be found in the AWS IoT SiteWise console on the **Models** page. Find the model which the alarm was created on. Then under the **Alarm definitions** tab you should see your alarm. Use the **AlarmState Property ID** as the `propertyId` in the asset property query.
124+
125+
```
126+
query.timeSeriesData({
127+
assets: [{
128+
assetId: 'id',
129+
properties: [{ propertyId: 'alarmStatePropertyId' }]
130+
}]
131+
})
132+
```
133+
134+
This query will request an AWS IoT Events alarm stream, which can be in one of [these states](https://docs.aws.amazon.com/iotevents/latest/apireference/API_iotevents-data_AlarmState.html). The alarms input property stream will be associated with the alarm stream if queried. IoT Application Kit will autogenerate thresholds that represent the alarm. This is how alarms are visualized in @iot-app-kit/components.
135+
136+
![status grid with alarms](./imgs/statusGridWithAlarms.png)
137+
138+
![status timeline with alarms](./imgs/statusTimelineWithAlarms.png)
139+
140+
![line chart with alarms](./imgs/lineChartWithAlarms.png)
141+
115142
### TimeSeriesDataSettings parameter
116143

117144
(Optional) Specifies how IoT Application Kit requests time series data. Learn more about how to configure TimeSeriesDataSettings, see TimeSeriesDataSettings under [Core](https://github.com/awslabs/iot-app-kit/tree/main/docs/Core.md).

docs/GettingStarted.md

+140-53
Original file line numberDiff line numberDiff line change
@@ -5,79 +5,166 @@ Use the step-by-step tutorial in this section to learn how to set up IoT Applica
55
1. Install the required dependencies
66
To install by using npm, run the following command.
77
1. `npm install --save @iot-app-kit/source-iotsitewise`
8+
1. `npm install --save @iot-app-kit/source-iottwinmaker`
89
1. `npm install --save @iot-app-kit/components`
910
1. If you want to use React: `npm install --save @iot-app-kit/react-components`
11+
1. `npm install --save @iot-app-kit/scene-composer`
1012
2. To initialize the AWS IoT SiteWise source, choose one of the following.
1113
1. To initialize an instance of [@aws-sdk/client-iotsitewise](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-iotsitewise/index.html), use the following sample code.
1214

13-
import { initialize } from '@iot-app-kit/source-iotsitewise';
15+
```ts
16+
import { initialize } from '@iot-app-kit/source-iotsitewise';
1417

15-
const { IoTSiteWiseClient } = require("@aws-sdk/client-iotsitewise");
18+
const { IoTSiteWiseClient } = require("@aws-sdk/client-iotsitewise");
1619

17-
const iotsitewiseClient = new IoTSiteWiseClient({ region: "REGION" });
20+
const iotsitewiseClient = new IoTSiteWiseClient({ region: "REGION" });
1821

19-
const { query } = initialize({ iotsitewiseClient });
22+
const { query } = initialize({ iotsitewiseClient });
23+
```
2024

2125
2. To initialize an instance of [@aws-sdk/credential-providers](https://www.npmjs.com/package/@aws-sdk/credential-providers), use the following sample code, but replace the credential provider with the one you wish to utilize:
2226

23-
import { initialize } from '@iot-app-kit/source-iotsitewise';
24-
import { fromCognitoIdentity } from "@aws-sdk/credential-providers";
25-
26-
const { query } = initialize({ awsCredentials: fromCognitoIdentity(...) });
27+
```ts
28+
import { initialize } from '@iot-app-kit/source-iotsitewise';
29+
import { fromCognitoIdentity } from "@aws-sdk/credential-providers";
2730
31+
const { query } = initialize({ awsCredentials: fromCognitoIdentity(...) });
32+
```
2833

2934
3. Include the style sheets somewhere in your application
3035

31-
```
36+
```ts
3237
import "@iot-app-kit/components/styles.css";
3338
```
3439

3540
4. To mount the component, use the following sample code.
3641

37-
import { initialize } from '@iot-app-kit/source-iotsitewise';
38-
import { LineChart, WebglContext } from '@iot-app-kit/react-components';
39-
const { IoTSiteWiseClient } = require("@aws-sdk/client-iotsitewise");
40-
41-
const iotsitewiseClient = new IoTSiteWiseClient({ region: "REGION" });
42-
const { query } = initialize({ iotsitewiseClient });
43-
44-
// React component example
45-
<LineChart
46-
queries={[
47-
query.timeSeriesData(
48-
{
49-
assets: [{
50-
// Replace sitewse-asset-id with the ID of your AWS IoT SiteWise asset.
51-
assetId: 'sitewise-asset-id',
52-
// Replace property-id with the ID of your AWS IoT SiteWise asset property.
53-
properties: [{ propertyId: 'property-id' }],
54-
}]
55-
}
56-
)
57-
]}
58-
/>
59-
<WebglContext />
60-
61-
// Web component example
62-
const { defineCustomElements } = require('@iot-app-kit/components/loader');
63-
defineCustomElements();
64-
65-
<iot-line-chart
66-
queries={[
67-
query.timeSeriesData(
68-
{
69-
assets: [{
70-
// Replace sitewse-asset-id with the ID of your AWS IoT SiteWise asset.
71-
assetId: 'sitewise-asset-id',
72-
// Replace property-id with the ID of your AWS IoT SiteWise asset property.
73-
properties: [{ propertyId: 'property-id' }],
74-
}]
75-
}
76-
)
77-
]}
78-
/>
79-
<iot-webgl-context />
80-
42+
```tsx
43+
import { initialize } from '@iot-app-kit/source-iotsitewise';
44+
import { LineChart, WebglContext } from '@iot-app-kit/react-components';
45+
const { IoTSiteWiseClient } = require("@aws-sdk/client-iotsitewise");
46+
47+
const iotsitewiseClient = new IoTSiteWiseClient({ region: "REGION" });
48+
const { query } = initialize({ iotsitewiseClient });
49+
50+
// React component example
51+
<LineChart
52+
queries={[
53+
query.timeSeriesData(
54+
{
55+
assets: [{
56+
// Replace sitewse-asset-id with the ID of your AWS IoT SiteWise asset.
57+
assetId: 'sitewise-asset-id',
58+
// Replace property-id with the ID of your AWS IoT SiteWise asset property.
59+
properties: [{ propertyId: 'property-id' }],
60+
}]
61+
}
62+
)
63+
]}
64+
/>
65+
<WebglContext />
66+
67+
// Web component example
68+
const { defineCustomElements } = require('@iot-app-kit/components/loader');
69+
defineCustomElements();
70+
71+
<iot-line-chart
72+
queries={[
73+
query.timeSeriesData(
74+
{
75+
assets: [{
76+
// Replace sitewse-asset-id with the ID of your AWS IoT SiteWise asset.
77+
assetId: 'sitewise-asset-id',
78+
// Replace property-id with the ID of your AWS IoT SiteWise asset property.
79+
properties: [{ propertyId: 'property-id' }],
80+
}]
81+
}
82+
)
83+
]}
84+
/>
85+
<iot-webgl-context />
86+
```
8187
The IoT App Kit components are all supported broadly across all modern browsers, including IE11. Due to usage of WebGL, users with misconfigured or missing graphics drivers may face problems when utilizing IoT App Kit components which utilize WebGL. Components which require WebGL will specify in their components documentation.
8288

8389

90+
5. To initialize the AWS IoT TwinMaker source with [@aws-sdk/credential-providers](https://www.npmjs.com/package/@aws-sdk/credential-providers), use the following sample code, but replace the credential provider with the one you wish to utilize:
91+
92+
```ts
93+
import { initialize } from '@iot-app-kit/source-iottwinmaker';
94+
import { fromCognitoIdentity } from "@aws-sdk/credential-providers";
95+
96+
// Replace twin-maker-workspace-id with the ID of your AWS IoT TwinMaker workspace, and replace
97+
// REGION with the region of your workspace.
98+
const { query } = initialize('twin-maker-workspace-id', { awsCredentials: fromCognitoIdentity(...), awsRegion: 'REGION' });
99+
```
100+
101+
6. To mount the SceneViewer component, use the following sample code.
102+
103+
```tsx
104+
import { initialize, TwinMakerQuery } from '@iot-app-kit/source-iottwinmaker';
105+
import { SceneViewer } from '@iot-app-kit/scene-composer';
106+
107+
const { query, s3SceneLoader } = initialize( ... );
108+
// Replace scene-id with the ID of your AWS IoT TwinMaker scene in the workspace.
109+
const sceneLoader = s3SceneLoader('scene-id');
110+
const queries: TwinMakerQuery[] = [
111+
{
112+
// Replace entity-id with the ID of your AWS IoT TwinMaker entity in the workspace.
113+
entityId: 'entity-id',
114+
// Replace component-name with the name of the component for your entity.
115+
componentName: 'component-name',
116+
// Replace property-name with the name of the property for your component.
117+
properties: [{ propertyName: 'property-name' }],
118+
},
119+
{
120+
// Replace component-type-id with the ID of your concrete AWS IoT TwinMaker component type in the workspace.
121+
componentTypeId: 'component-type-id',
122+
// Replace property-name with the name of the property for your component type.
123+
properties: [{ propertyName: 'property-name' }],
124+
},
125+
];
126+
const viewport = {
127+
// Replace start-time with the start time to query data from your workspace.
128+
start: new Date('start-time'),
129+
// Replace end-time with the end time to query data from your workspace.
130+
end: new Date('end-time'),
131+
};
132+
133+
// React component example
134+
<SceneViewer
135+
sceneLoader={sceneLoader}
136+
queries={queries}
137+
viewport={viewport}
138+
/>
139+
```
140+
141+
7. To mount the VideoPlayer component, use the following sample code.
142+
```tsx
143+
import { initialize } from '@iot-app-kit/source-iottwinmaker';
144+
import { VideoPlayer } from '@iot-app-kit/react-components';
145+
146+
const videoData = initialize( ... ).videoData({
147+
// Replace entity-id with your AWS IoT TwinMaker entity that has KinesisVideoStream component
148+
entityId: 'entity-id',
149+
// Replace component-name with the name of the component for your entity that has KinesisVideoStreamName property
150+
componentName: 'component-name',
151+
});
152+
// or
153+
const videoData = initialize( ... ).videoData({
154+
// Replace kvs-stream-name with your KinesisVideo stream name
155+
kvsStreamName: 'kvs-stream-name',
156+
});
157+
158+
// Video player for On-Demand playback mode with specified start and end time
159+
<VideoPlayer
160+
videoData={videoData}
161+
// Replace start-time and end-time with the correct time to play the video.
162+
viewport={{ start: new Date('start-time'), end: new Date('end-time') }}
163+
/>
164+
165+
// Video player for Live playback mode
166+
<VideoPlayer
167+
videoData={videoData}
168+
viewport={{ duration: '0' }}
169+
/>
170+
```

docs/imgs/lineChartWithAlarms.png

55.5 KB
Loading

docs/imgs/statusGridWithAlarms.png

68.2 KB
Loading
68.9 KB
Loading

0 commit comments

Comments
 (0)