Skip to content

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.

ParameterType
mDistanceMoments

number

import { analyze, optimalScale } from "@saehrimnir/sickle";
const a = analyze(data, projection);
optimalScale(a.moments); // 1.0342 — multiply the projection by this to minimise stress