Skip to content

Simple zoom-in with interpolateZoom gives negative duration #101

@jjhembd

Description

@jjhembd

If the starting and ending views are centered on the same point, but the ending width is smaller, the .duration property of the returned interpolator is negative. See https://observablehq.com/d/fa1442202b6a7936

Comparing to van Wijk and Nuij, the current code is missing the absolute value on the path length S.

image

Skipping the absolute value does simplify the interpolator (no need to track the k factor). I think it would be enough to take the absolute value when computing the duration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions