Skip to content

Commit 8721baa

Browse files
committed
fix: Add missing *TickValues prop type
This adds two field types, fields already available in `<BaseGrid>`, to the `CommonGridTProps` type.
1 parent 1aed091 commit 8721baa

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

packages/visx-grid/src/types.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { CSSProperties, ReactNode } from 'react';
2-
import { D3Scale, NumberLike } from '@visx/scale';
2+
import { D3Scale, NumberLike, ScaleInput } from '@visx/scale';
33

44
// In order to plot values on an axis, output of the scale must be number.
55
// Some scales return undefined.
@@ -31,8 +31,12 @@ export type CommonGridProps = {
3131
strokeWidth?: string | number;
3232
/** Grid line stroke-dasharray attribute. */
3333
strokeDasharray?: string;
34-
/** Approximate number of grid lines. Approximate due to d3 alogrithm, specify `tickValues` for precise control. */
34+
/** Approximate number of grid lines. Approximate due to d3 alogrithm, specify `rowTickValues` or `columnTickValues` for precise control. */
3535
numTicks?: number;
36+
/** Exact values to be used for GridRows lines, passed to yScale. Use this if you need precise control over GridRows values. */
37+
rowTickValues?: ScaleInput<GridScale>[];
38+
/** Exact values to be used for GridColumns lines, passed to xScale. Use this if you need precise control over GridColumns values. */
39+
columnTickValues?: ScaleInput<GridScale>[];
3640
/** Styles to apply as grid line style. */
3741
lineStyle?: CSSProperties;
3842
/** Pixel offset to apply as a translation (y- for Rows, x- for Columns) to each grid lines. */

0 commit comments

Comments
 (0)