MCPcopy Create free account
hub / github.com/microsoft/SandDance / getFlyToDuration

Function getFlyToDuration

docs/app/js/sanddance-app.js:80690–80702  ·  view source on GitHub ↗
(startProps, endProps, options)

Source from the content-addressed store, hash-verified

80688}
80689exports.default = flyToViewport;
80690function getFlyToDuration(startProps, endProps, options) {
80691 const opts = {
80692 ...DEFAULT_OPTS,
80693 ...options
80694 };
80695 const { screenSpeed , speed , maxDuration } = opts;
80696 const { S , rho } = getFlyToTransitionParams(startProps, endProps, opts);
80697 const length = 1000 * S;
80698 let duration;
80699 if (Number.isFinite(screenSpeed)) duration = length / (screenSpeed / rho);
80700 else duration = length / speed;
80701 return Number.isFinite(maxDuration) && duration > maxDuration ? 0 : duration;
80702}
80703function getFlyToTransitionParams(startProps, endProps, opts) {
80704 opts = Object.assign({}, DEFAULT_OPTS, opts);
80705 const rho = opts.curve;

Callers

nothing calls this directly

Calls 1

getFlyToTransitionParamsFunction · 0.70

Tested by

no test coverage detected