tgdwyer / WebCola

Javascript constraint-based graph layout
http://marvl.infotech.monash.edu/webcola/
MIT License
2.01k stars 257 forks source link

index.d.ts needs to import "d3" #201

Open ghost opened 7 years ago

ghost commented 7 years ago

I tried using this project in a simple environment:

npm install webcola
echo 'import { } from "webcola";' > a.ts
tsc a.ts

I got:

node_modules/webcola/WebCola/index.d.ts(847,16): error TS2503: Cannot find namespace 'D3'.

I can make it better by running npm install @types/d3 and adding import * as D3 from "d3"; to the second line of node_modules/webcola/WebCola/index.d.ts. But there is still an error because the latest version of @types/d3 makes Dispatch a generic type.

Also, there is currently a DefinitelyTyped type definition for webcola here. It would be nice to deprecate that in favor of the bundled types here.

tgdwyer commented 7 years ago

Hmm, I'm thinking I need to separate the D3 dependency (it's only one small shim) from the rest of WebCoLa.

aspiers commented 7 years ago

Is this related to #145?