diff options
Diffstat (limited to 'src/utilities/_sila')
-rw-r--r-- | src/utilities/_sila/metricProperties.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/utilities/_sila/metricProperties.js b/src/utilities/_sila/metricProperties.js index edc701d6..e435bab2 100644 --- a/src/utilities/_sila/metricProperties.js +++ b/src/utilities/_sila/metricProperties.js @@ -1,3 +1,12 @@ +export function getGroups(data) { + return Object.keys( + data.reduce(function (rv, x) { + (rv[x['Sensor']] = rv[x['Sensor']] || []).push(x); + return rv; + }, {}) + ); +} + export function getItems(data, float = false) { let filteredData = data.filter((metric) => { return metric.Value !== 'nan'; |