awslabs / iot-app-kit

A development library for creating web applications to visualize industrial data
Apache License 2.0
113 stars 59 forks source link

feat(react-components): use historical asset property values #2971

Closed jmbuss closed 3 weeks ago

jmbuss commented 3 weeks ago

Overview

Tanstack wrapper around getAssetPropertyValueHistory, batchGetAssetPropertyValueHistory. These can be used to fetch historical asset property values by assetId + propertyId or propertyAlias for a given viewport.

Note: Caching works based on an entire request in this implementation. Partial request caching is not supported. Late data configuration is also not supported. Instead, a refreshRate can be given, or one will be determined based on a percentage of the provided viewport, and will refresh the whole viewport range.

This hook will work if the client provided implements either / both getAssetPropertyValueHistory, batchGetAssetPropertyValueHistory. The hook will prefer to use the batch api if both are provided.

Legal

This project is available under the Apache 2.0 License.