Published
Edited
Apr 21, 2021
Fork of Bee graph
2 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
/*CALCULATION BASED ON http://www.killowen.com/genetics2B.html
The number of sex alleles: (1/a)*100% ; a=number of sex alleles
The number of drones mating with the queen having one common sex allele: [1/(d*2)]*100% ; d=number of mated drones
*/
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
/*
19 sex alleles
Queen: S1 S2
Drone: pick one from S1~S19
| S1 S2
-----------------
S1| S1 S1 S1 S2
|
S2| S1 S2 S2 S2
probability: 2/19 * 1/2 = 1/19 (S1 S1 , S2 S2)
38 * 1/19 = 2
legend: 10 bees per hex
*/
Insert cell
//non_viable_num= [19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1];
Insert cell
/*nestColors = {
const data = []
var k;
for (let i = 0; i<703; i++)
{ k = d3.randomInt(4)();
var color;
switch(k)
{
case 0:
color = "#ffe110";
break;
case 1:
color = "#ffb110";
break;
case 2:
color = "#ffc110";
break;
case 3:
color = "#ffd110";
break;
default:
color = "red";
break;
}
data.push(color)
}
var temp = [];


for(var j=0; j<19; j++){
for(var i=0; i<non_viable_num[j]; i++){
var non_viable = Math.round(d3.randomUniform.source(Math.random)(0+j*37,36+j*37)());
temp.push(non_viable);
while(temp.includes(non_viable)==true)
{non_viable = Math.round(d3.randomUniform.source(Math.random)(0+j*37,36+j*37)());}
temp.push(non_viable);
data[non_viable] = "#332701";//"#49332F";
}
}
//temp.remove();
return data
}*/
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