inputEmojiPicker = (control) => {
let div = html`<div></div>`;
div.value = sorted[0];
d3.select(div)
.selectAll("div.emoji")
.data(sorted)
.join("div")
.classed("emoji", true)
.style("font-size", "25px")
.style("display", "inline-block")
.style("cursor", "pointer")
.style("opacity", d => {
return opacityScale(d.Occurences);
})
.attr("title", d => d["Unicode name"])
.text(d => d.Emoji)
.on("click", (event, d) => {
div.value = d;
div.dispatchEvent(new CustomEvent("input", { bubbles: true }));
if (control) {
control.value += d["Emoji"]
control.dispatchEvent(new CustomEvent("input", { bubbles: true }));
}
});
return div;
}