|
@@ -19,17 +19,17 @@ const buildVectorData = (vector, toHue, toLightness, toChroma, toHex) => {
|
|
|
};
|
|
|
|
|
|
const calcImportance = (chroma, lightness, proportion) => (
|
|
|
- // proportion component - linear, with penalties
|
|
|
- proportion
|
|
|
+ chroma
|
|
|
+ + Math.tanh(100 * (chroma - 0.25)) // penalty for being <25%
|
|
|
+ + Math.tanh(100 * (chroma - 0.40)) // penalty for being <40%
|
|
|
+ + lightness
|
|
|
+ + Math.tanh(100 * (lightness - 0.50)) // penalty for being <50%
|
|
|
+ + proportion
|
|
|
+ Math.tanh(100 * (proportion - 0.05)) // penalty for being <5%
|
|
|
+ + Math.tanh(100 * (proportion - 0.10)) // penalty for being <15%
|
|
|
+ Math.tanh(100 * (proportion - 0.15)) // penalty for being <15%
|
|
|
- + Math.tanh(100 * (proportion - 0.75)) // penalty for being <75%
|
|
|
- // chroma component - scaled, with penalty
|
|
|
- + (chroma / (chroma + lightness)) // consider chroma as portion of chroma + lightness
|
|
|
- + (Math.tanh(10 * (chroma - 0.25))) // penalty for being <25%
|
|
|
- // lightness component - linear, with penality
|
|
|
- + lightness
|
|
|
- + (Math.tanh(10 * (lightness - 0.5))) // penalty for being <50%
|
|
|
+ + Math.tanh(100 * (proportion - 0.25)) // penalty for being <25%
|
|
|
+ + Math.tanh(100 * (proportion - 0.80)) // penalty for being <50%
|
|
|
);
|
|
|
|
|
|
const buildClusterData = (size, inertia, mu1, mu2, mu3, nu1, nu2, nu3, totalSize, toHue, toLightness, toChroma, toHex) => {
|