Public
Edited
Apr 30, 2024
1 fork
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
Insert cell
Insert cell
Insert cell
Insert cell
{
//this bit of math unpacks a specific place of an integer. Each emotion is encoded at a power-of-10s place.
//the millionths place neutral, the hundred-thousandths is happy...
//you should be able to just bring this fn over into any other programming language with a bit of cleanup
let place = 0; // neutral = 0, happy = 1, sad = 2, angry = 3, fearful = 4, disgusted = 5, surprised = 6
return Math.floor((Math.abs(consolidated) / Math.pow(10, 6 - place)) % 10);
}
Insert cell
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