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

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more