optimalScale
function optimalScale(m): number;Defined in: metrics/distance.ts:109
The factor the projection would have to be multiplied by to minimise stress.
Far from 1 means the projection’s units differ from the data’s — harmless in itself, but it tells you stress will look worse than the shape deserves.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
m | DistanceMoments |
Returns
Section titled “Returns”number
Example
Section titled “Example”import { analyze, optimalScale } from "@saehrimnir/sickle";
const a = analyze(data, projection);optimalScale(a.moments); // 1.0342 — multiply the projection by this to minimise stress