Published
Edited
Mar 11, 2019
Importers
1 star
Insert cell
Insert cell
Insert cell
Insert cell
html`<div>
${
emojis.map(
(d, i) => `<span style="font-size:${size}em" title=${d.code+":" + d.idx + "&#13;"+d.comment}>${d.emoji}</span>`
)
}
</div>`

Insert cell
Insert cell
Insert cell
emojis = emojis_all.filter((d) => d.comment.indexOf(filter) >= 0)
Insert cell
Insert cell
emojis_all = {
const emojis = [];
let idx=0;
emojiData.forEach(d => {
let start = parseInt(d.codes[0], 16);
let end = d.codes[1] ? parseInt(d.codes[1], 16) : start;
let cmt = d.comments[0];
cmt = d.comments[1] ? cmt + ".." + d.comments[1] : cmt;
for (var i = start; i <= end; i++) {
emojis.push({code:fmt(i), emoji:String.fromCodePoint(i), comment:cmt, idx:idx++});
}
// emojii.push({code:String.fromCodePoint(start), comment:cmt});
// let range = end - start;
// if (range >= 2) {
// if (range >= 3)
// for (var i = start+1; i <= end-1; i++) {
// emojii.push({code:String.fromCodePoint(i), comment:".."});
// }
// emojii.push({code:String.fromCodePoint(end), comment:cmt_end});
// }
});
return emojis;
}
Insert cell
function parse(text) {
return text
.split("\n")
.filter(l => l && l[0] != "#")
.map(l => {
let cols = l.split(';');
let codes = cols[0].trim().split("..");
let comments = cols[1].split(")")[1].trim().split("..")
return {codes:codes, comments};
}
)
}
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more