using-react-hooks-with-d3 icon indicating copy to clipboard operation
using-react-hooks-with-d3 copied to clipboard

Typescript

Open tomgallagher opened this issue 5 years ago • 0 comments

Hey

I've been enjoying your videos, I wanted to learn about d3 and need to build a racing bar chart so great!

I'm having some problems converting your code into Typescript, using @types/d3. Generally it's OK with things like NumberValue expected rather than Number or String. But I'm having trouble with the call function here

svg.select('.x-axis').style('transform', translateY(${dimensions.height}px)).call(xAxis);

Argument of type 'Axis<NumberValue>' is not assignable to parameter of type '(selection: Selection<BaseType, unknown, null, undefined>, ...args: any[]) => void'.

Are you thinking about adding Typescript versions as well at any stage, so I can look at them as I convert?

Thanks

Tom

tomgallagher avatar Oct 17 '20 07:10 tomgallagher