An open API service indexing awesome lists of open source software.

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

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.