in src/models/Node.js [129:142]
static merge(nodes) {
return new Node({
id: min(nodes.map(n => n.data.id)),
entity: nodes[0].data.entity,
freq: sum(nodes.map(n => n.data.freq)),
mergedData: nodes.map(n => n.data),
topEntries: nodes
.reduce(
(acc, curr) => acc.concat(curr.data.topEntries),
[]
)
.slice(0, 5),
});
}