https://github.com/tmobile/node-red-contrib-summarizer
Node-RED node to summarize arrays of data
https://github.com/tmobile/node-red-contrib-summarizer
node-red node-red-contrib summarizer
Last synced: 3 months ago
JSON representation
Node-RED node to summarize arrays of data
- Host: GitHub
- URL: https://github.com/tmobile/node-red-contrib-summarizer
- Owner: tmobile
- License: apache-2.0
- Created: 2020-06-16T18:35:22.000Z (about 6 years ago)
- Default Branch: main
- Last Pushed: 2021-05-11T17:42:04.000Z (about 5 years ago)
- Last Synced: 2025-01-20T12:44:52.517Z (over 1 year ago)
- Topics: node-red, node-red-contrib, summarizer
- Language: HTML
- Size: 26.4 KB
- Stars: 2
- Watchers: 9
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# node-red-contrib-summarizer
Based on [node-red-contrib-summariser](https://github.com/hammoaj/node-red-contrib-summariser).
A Node-RED node that generates summaries from arrays of data
An array of data is passed in the form:
```
[
{"field1": },
{"field2": },
{"field3": },
...
]
```
In the node's configuration, you can define a set of rules that apply to a field within the data table.
Each rule delivers its result on a separate output message.
Rules available:
**Sum**
The `Sum` rule sums the numerical values in the given field across the arrays. It returns a single number in `msg.payload`.
**Count**
The `Count` rule counts the number of times the field occurs in the arrays. It returns a single number in `msg.payload`.
**Mean**
The `Mean` rule calculates the mean of the numerical values in the given field across the arrays. It returns a single number in `msg.payload`.
**Group**
The `Group` rule calculates the frequency that every value in the given field occurs in the array. It returns an object where the values are the key, and the frequencies a returned as the value for the given key. This can be passed directly into a `split` node where the keys are emitted in `msg.topic` ready for the node-red-dashboard chart nodes.
**Join**
This rule joins all of the values in the given field across the array.
If given, the values are separated by string in the separator field in the configuration.
**Extract**
This rule returns an array of all of the values for the given field across the array.