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