Browse Source

Minor cleanup

Kirk Trombley 3 years ago
parent
commit
c81e856211
1 changed files with 2 additions and 2 deletions
  1. 2 2
      web/convert.js

+ 2 - 2
web/convert.js

@@ -26,12 +26,12 @@ const calcImportance = (chroma, lightness, proportion) =>
 const buildClusterData = (size, inertia, mu1, mu2, mu3, nu1, nu2, nu3, totalSize, toHue, toLightness, toChroma, toHex) => {
 const buildClusterData = (size, inertia, mu1, mu2, mu3, nu1, nu2, nu3, totalSize, toHue, toLightness, toChroma, toHex) => {
   const mu = buildVectorData([mu1, mu2, mu3], toHue, toLightness, toChroma, toHex);
   const mu = buildVectorData([mu1, mu2, mu3], toHue, toLightness, toChroma, toHex);
   const nu = [nu1, nu2, nu3];
   const nu = [nu1, nu2, nu3];
+  const muNuAngle = rad2deg * Math.acos(vectorDot(mu.unit, nu) / vectorMag(nu));
   const proportion = size / totalSize;
   const proportion = size / totalSize;
   const importance = calcImportance(mu.chroma, mu.lightness, proportion);
   const importance = calcImportance(mu.chroma, mu.lightness, proportion);
   return {
   return {
     size, inertia, mu, nu,
     size, inertia, mu, nu,
-    proportion, importance,
-    muNuAngle: rad2deg * Math.acos(vectorDot(mu.unit, nu) / vectorMag(nu)),
+    muNuAngle, proportion, importance, 
   };
   };
 };
 };