Skip to content

Interpolate functionality. [feature request] #10

@DylanVann

Description

@DylanVann

Could look like this:

interpolate(
    nodeOrValue,
    {
        inputRange: [nodeOrValue, ...],
        outputRange: [nodeOrValue, ...],
    }
)

Questions:

  • Can this be implemented using existing node types?
  • Can the input range actually be animated?
    • If so how do we know when to stop searching for the closest values to the input value?
    • We could just take the first value that's greater than the input value.
    • Assuming the input range always increases even if animated then it will be stable.
  • How does the input range map to the output range?
    • Do we just force the arrays to be the same length and then map between them by index? This is how Animated does it.

I think a basic interpolate (interpolate(x, x0, x1, y0, y1)) could be made using existing node types.

I took a shot at implementing something using nested conds, it didn't go that well. I'll try again though, maybe with a different approach.

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