-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use the d3js v4 typings standalone? #8
Comments
@niklas-dahl Thanks. I opened a separate issue to update the dependencies to support ng2 2.0.0 see #9 . As for your question related to using the typings for D3v4 here is a short version of what is shining through in the longer tracking issue on DT you referenced above: (1) Yes, the definitions pulled from @types/d3 are still for D3 3.x. There is no single definitions file for the D3 Standard Bundle v4 in DT/types-2.0 and @types yet. This is due to a structural limitation in the (2) All the D3 modules which form part of the D3 Standard Bundle are, however, obtainable from @types. E.g. If you require the use of a
The last part will ensure the global becomes available. You can consume it in a TS file by using
with the appropriate path to the bundle definitions file. This would be used instead of an As I finalize the transition of issues/open items from the repo in which the new definitions were developed to DT, I will restructure the main issue thread you found. For some open items I will post a temporary work around, as long as there are still dependencies. Hope this helps in the meantime. I will cc you, when I update the DT comments. In the interim, if you have questions related to the types more general rather than specific to this service, it may be easier to post them on DT (use the main issue for now). I'm sure you are not the only one who ran into the current structural limitations. Cheers. 😄 |
wow, thanks for your detailed answer. |
Not to worry. PS. you're good to use it with ng2 v2.0.0 now. All (peer)-dependencies are updated in the latest release 1.1.3. Will convert the demo project linked in the README next (but that is predicated on all going well with the latest angular-cli release...) |
This Project looks great and once it is compatibile with ng 2.0 I will defenitly use it,
but for now I would really like to install the d3 typings for d3 version 4.
I'm using typescript 2 and as far as I understand your comment on DefinitelyTyped/DefinitelyTyped#9936 I should be able to use them today.
But I dont get how..
I tried:
npm i @types/d3
this installs the typings for d3 version 3npm i @types/d3-types-2.0
npm ERR!npm i @types/d3@types-2.0
npm ERR!npm i @types/d3@4.0
npm ERR!Thanks for all your work on the typings 👍
The text was updated successfully, but these errors were encountered: