MCPcopy Index your code
hub / github.com/microsoft/SandDance / scaleFraction

Function scaleFraction

docs/app/js/sanddance-app.js:126992–127009  ·  view source on GitHub ↗
(scale$1, min, max)

Source from the content-addressed store, hash-verified

126990 return s;
126991}
126992function scaleFraction(scale$1, min, max) {
126993 const delta = max - min;
126994 let i, t, s;
126995 if (!delta || !Number.isFinite(delta)) return (0, _vegaUtil.constant)(0.5);
126996 else {
126997 i = (t = scale$1.type).indexOf("-");
126998 t = i < 0 ? t : t.slice(i + 1);
126999 s = scale(t)().domain([
127000 min,
127001 max
127002 ]).range([
127003 0,
127004 1
127005 ]);
127006 scaleProps.forEach((m)=>scale$1[m] ? s[m](scale$1[m]()) : 0);
127007 return s;
127008 }
127009}
127010function interpolate(type, gamma) {
127011 const interp = _d3Interpolate[method(type)];
127012 return gamma != null && interp && interp.gamma ? interp.gamma(gamma) : interp;

Callers

nothing calls this directly

Calls 2

scaleFunction · 0.70
forEachMethod · 0.45

Tested by

no test coverage detected