(startProps, endProps, options)
| 80688 | } |
| 80689 | exports.default = flyToViewport; |
| 80690 | function 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 | } |
| 80703 | function getFlyToTransitionParams(startProps, endProps, opts) { |
| 80704 | opts = Object.assign({}, DEFAULT_OPTS, opts); |
| 80705 | const rho = opts.curve; |
nothing calls this directly
no test coverage detected