📄 tanstack/ranger/latest/docs/framework/react/api/logarithmic-interpolator

File: logarithmic-interpolator.md | Updated: 11/15/2025

Source: https://tanstack.com/ranger/latest/docs/framework/react/api/logarithmic-interpolator



TanStack

Ranger v0v0

Search...

+ K

Auto

Log In

TanStack StartRC

Docs Examples GitHub Contributors

TanStack Router

Docs Examples GitHub Contributors

TanStack Query

Docs Examples GitHub Contributors

TanStack Table

Docs Examples Github Contributors

TanStack Formnew

Docs Examples Github Contributors

TanStack DBbeta

Docs Github Contributors

TanStack Virtual

Docs Examples Github Contributors

TanStack Paceralpha

Docs Examples Github Contributors

TanStack Storealpha

Docs Examples Github Contributors

TanStack Devtoolsalpha

Docs Github Contributors

More Libraries

Maintainers Partners Support Learn StatsBETA Discord Merch Blog GitHub Ethos Brand Guide

Documentation

Framework

React logo

React

Version

Latest

Search...

+ K

Menu

Getting Started

Adapters

API Reference

Examples

Framework

React logo

React

Version

Latest

Menu

Getting Started

Adapters

API Reference

Examples

On this page

Examples
--------

Want to skip to the implementation? Check out these examples:

The API below described how to use the logarithmic-interpolator features.

Options
-------

By default, react-ranger uses linear interpolation between data points, but allows you to easily customize it to use your own interpolation functions by passing an object that implements the following interface.

### interpolator

tsx

interpolator: {
    getPercentageForValue: (val: number, min: number, max: number): number;
    getValueForClientX: (clientX: number, trackDims: object, min: number, max: number): number;
}


interpolator: {
    getPercentageForValue: (val: number, min: number, max: number): number;
    getValueForClientX: (clientX: number, trackDims: object, min: number, max: number): number;
}

The Interpolator to use. Defaults to the bundled linear-scale interpolator

  • getPercentageForValue - Takes the value & range and returns a percentage [0, 100] where the value sits from left to right.
  • getValueForClientX- Takes the clientX (offset from the left edge of the ranger) along with the dimensions and range settings and transforms a pixel coordinate back into a value.

Edit on GitHub

Custom Styles

Update on Drag

Partners Become a Partner

Code RabbitCode Rabbit CloudflareCloudflare AG GridAG Grid NetlifyNetlify NeonNeon WorkOSWorkOS ClerkClerk ConvexConvex ElectricElectric SentrySentry PrismaPrisma StrapiStrapi UnkeyUnkey

scarf analytics