Published
Edited
Jun 23, 2021
Importers
12 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
rainbowFlag = ["#5E513F", "#A5765C", "#FF7E6A", "#FFB47E", "#FFE694", "#B3EB9F", "#7EC4F6", "#BB87FA"]
Insert cell
transgenderFlag = ["#7EC4F6", "#FFB7DE", "#FFFDF6", "#FFB7DE", "#7EC4F6"]
Insert cell
bisexualFlag = ["#ED6EBA", "#ED6EBA", "#A55DB7", "#7074D1", "#7074D1"]
Insert cell
genderqueerFlag = ["#BB87FA", "#FFFDF6", "#80B65F"]
Insert cell
pansexualFlag = ["#FA87EE", "#FAE49A", "#7EC4F6"]
Insert cell
nonbinaryFlag = ["#FAE49A", "#FFFDF6", "#BB87FA", "#353535"]
Insert cell
asexualFlag = ["#353535", "#CACACA", "#FFFDF6", "#A55DB7"]
Insert cell
Insert cell
flags = [
{name: "Rainbow", colors: rainbowFlag},
{name: "Transgender", colors: transgenderFlag},
{name: "Bisexual", colors: bisexualFlag},
{name: "Genderqueer", colors: genderqueerFlag},
{name: "Pansexual", colors: pansexualFlag},
{name: "Non-binary", colors: nonbinaryFlag},
{name: "Asexual", colors: asexualFlag}
]
Insert cell
Insert cell
flagIndex = {
let i = 0;
while (true) {
yield i++;
if (i == flags.length) {
i = 0;
}
await Promises.delay(2000);
}
}
Insert cell
Insert cell
function generateFlagPattern(colors) {
return colors.map((color, i) => `<rect fill="${color}" x="-3" y="${(23 / colors.length) * i}" width="28" height="${23 / colors.length + 1}"></rect>`);
}
Insert cell
import {toc} from "@nebrius/indented-toc"
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