data = d3.range(200).map(() => {
let rU = d3.randomUniform(0, 100);
const palette = d3.interpolateYlGn;
const color = d3.scaleLinear().range([0,1]).domain([-1,1]);
if (rU() < input2.s1) {
var allele = "A";
var a_color = "#EAE6CA";
}else {
var allele = "a";
var a_color = "#71879a";
}
let p = input2.s2;
let q = 10 - p;
let p_sq = p*p;
let q_sq = q*q;
var colorBee = d3.scaleOrdinal(d3.schemePaired)
var colorBee2 = d3.scaleOrdinal(d3.schemePastel1)
if (0 == p_sq) {
var genotype = "AA";
var g_color = "#FFFFF0";
} else if (1 == p_sq) {
genotype = "BB";
g_color = "#fae755" ;
} else if (2 == p_sq) {
genotype = "CC";
g_color = "#EAE6CA";
}else if (rU() < 9) {
genotype = "DD";
g_color = colorBee(Math.floor(Math.random()*10 + 3));
}else if (rU() < 16) {
genotype = "EE";
g_color = colorBee(Math.floor(Math.random()*10 + 3));
}else if (rU() < 25) {
genotype = "FF";
g_color = colorBee(Math.floor(Math.random()*10 + 3));
}else if (rU() < 36) {
genotype = "GG";
g_color = colorBee(Math.floor(Math.random()*10 + 3));
}else if (rU() < 49) {
genotype = "HH";
g_color = colorBee(Math.floor(Math.random()*10 + 3));
}else if (rU() < 64) {
genotype = "II";
g_color = colorBee2(Math.floor(Math.random()*10 + 3));
}else if (rU() < 81) {
genotype = "JJ";
g_color = colorBee2(Math.floor(Math.random()*10 + 3));
} else if (rU() < 100) {
genotype = "KK";
g_color = colorBee2(Math.floor(Math.random()*10 + 3));
}
let rI = d3.randomInt(1, 3);
let r = rI() * 18 - 10;
let x = Math.random() * width;
let y = 0;
let point = {
allele: allele,
allele_color: a_color,
genotype: genotype,
genotype_color: g_color,
x: x,
y: y,
r: r
};
return point;
})