Open Aarebecca opened 7 months ago
@Aarebecca that's good, thanks for your effort here, and for opening the PR.
I do think it would be better to base the type definitions on the existing d3-force
package more widely used types, from DefinitelyTyped: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/d3-force/v2/index.d.ts
This module is an extension of d3-force
, so for consistency it would be better to base it on those types, and extend it with the relevant sections, namely adding the 3rd (z) dimension, plus the numDimensions
method.
@vasturiano thank you very much for your advice. It was really an oversight on my part.
I've redefined the types based on d3-force
, which reduces some of the duplication and ensures consistency.
The screenshot below is a type check performed by ts-server
(in strict mode), and everything is fine:
@vasturiano any update on this?
I noticed that the project was missing the
ts
type definition, so I inferred the type based on the implementation. If you have any questions, please point them out.