airbnb / visx

🐯 visx | visualization components
https://airbnb.io/visx
MIT License
19.4k stars 712 forks source link

fix: Add missing `tickValues` prop type #1855

Open f1multiviewer opened 3 months ago

f1multiviewer commented 3 months ago

:bug: Bug Fix

Fixes an issue where the tickValues property wasn't properly being typed, even though it works when being passed.

Related: https://github.com/airbnb/visx/pull/376

f1multiviewer commented 3 months ago

Okay, so I've found that the tickValues is explicitly excluded from the types (even though it spreads just fine). Instead, I'm working now on exposing the rowTickValues and columnTickValues props, which are exposed elsewhere.

Currently though, I'm struggling to use the package locally, using yarn link doesn't seem to work and I'm getting all kinds of errors. How do you test this library in development (specifically in another project)?

rnintai commented 1 month ago

Any updates so far? I'm truly looking forward to it 😂

@f1multiviewer Referring to the CONTRIBUTING.md, maybe you can iterate on your changes locally in the gallery(demo) page after building this module.

cd /packages/visx-demo
yarn
yarn dev

Because i'm new to contributing this repo, i'll try once in then elaborate it to you later.

Updates

Struggling on building the module. 🥹

rnintai commented 1 month ago

Okay, so I've found that the tickValues is explicitly excluded from the types (even though it spreads just fine). Instead, I'm working now on exposing the rowTickValues and columnTickValues props, which are exposed elsewhere.

@f1multiviewer One more, i agree to your suggestion because we may need it for the cases which we want separate the tickValues. However, to align with visx-axis module, why don't we just define it as tickValues?

export type SharedAxisProps<Scale extends AxisScale> = CommonProps<Scale> & {
  // ...
  /** An array of values that determine the number and values of the ticks. Falls back to `scale.ticks()` or `.domain()`. */
  tickValues?: ScaleInput<Scale>[];
  // ...
};

How're your thoughts?