words = Array.from(
d3
.group(
tweetsSelected
.map((t) => {
const text = t.text || t.full_text;
return text.split(/[\s\n]/g);
})
.flat()
.filter((d) => d.indexOf("#") !== -1)
.map((d) =>
d
.trim()
.toUpperCase()
.replace(/[\,\.\!\;\…\:]/g, "")
),
(d) => d
)
.entries()
)
.sort((a, b) => b[1].length - a[1].length)
.map(([w, v], i) => ({
word: w,
count: v.length,
rank: i,
col: Math.floor(i / ELEMS_PER_COL)
}))