FormidableLabs / FormidableLabs/victory-native-xl

Zoom Scale Limits

Open
#490 5 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
TypeScript
Stars
1.2k
Forks
109
Avg merge
1d 15h
Merged PRs (30d)
3

Description

### Description

In my application, I'm using `CartesianChart` to display data. I want to prevent users from zooming in too close or zooming out too far, as this can make the chart unreadable.
It would be great if the `PinchTransformGestureConfig` could be enhanced to include properties for setting minimum and maximum scale values for both the x and y axes.

### Proposal

Extend the `PinchTransformGestureConfig` interface with the following properties:
```
export type PinchTransformGestureConfig = {
enabled?: boolean;
dimensions?: Dimension | Dimension[];
maxScaleX?: number;
maxScaleY?: number;
minScaleX?: number;
minScaleY?: number;
};
```

Contributor guide

Open the contributing guide

Research direction

Start by locating the PinchTransformGestureConfig interface and the CartesianChart zoom handling. Trace how pinch scale is applied for the x and y dimensions, then verify that minScaleX, minScaleY, maxScaleX, and maxScaleY constrain zooming as proposed. Done means both axes respect their configured limits without changing behavior when the properties are omitted.

Written by the indexing model from the issue text.

Assessment

Tech stack
react-native, typescript
Domain
data-visualization, mobile
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.