Comments (3)
@niklas-dahl Thanks. I opened a separate issue to update the dependencies to support ng2 2.0.0 see #9 .
Fingers crossed, it's quick. But I am checking out a migration to angular-cli beta.14 out for other projects first today.
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 DT/types-2.0
branch, which does not yet support parallel versions. This is a known issue with the TS team building the types-publisher linking DT and @types. We cannot kill the legacy version due to the dependencies to it from other libraries in DT.
(2) All the D3 modules which form part of the D3 Standard Bundle are, however, obtainable from @types. E.g. npm install @types/d3-selection --save
will get you the latest v4 definitions for d3-selection. So you can import them individually and bundle them similar to how this d3-ng2-service does it in bundle-d3.ts. You can also just use a subset, to fit your tailored need.
If you require the use of a d3
global for vanilla scripts, things are still a little tricky. You can essentially follow the approach under (2), with a couple of changes:
- Rather than building a
.ts
file use a.d.ts
file (i.e. you creating your own bundle definition in the project - Add the following to the so created bundle definitions file:
export as namespace d3;
The last part will ensure the global becomes available. You can consume it in a TS file by using
\\\ <reference types="..." />
with the appropriate path to the bundle definitions file. This would be used instead of an import
statement.
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. 😄
from d3-ng2-service.
wow, thanks for your detailed answer.
from d3-ng2-service.
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...)
from d3-ng2-service.
Related Issues (20)
- [BREAKING CHANGE] Update Major Release to Align with D3 v5
- Problem with d3.geo HOT 2
- traceur 404 (Not Found) Error HOT 1
- [d3-contour] Update to Minor Version 1.2
- Unresolved variables and methods HOT 7
- Type 'SVGPathSeg' is not assignable to type 'EnterElement'. Property 'ownerDocument' is missing in type 'SVGPathSeg'. HOT 5
- Update d3-geo to 1.10 HOT 1
- Property 'getBoundingClientRect' does not exist on type 'BaseType'. Property 'getBoundingClientRect' does not exist on type 'Window'.
- Update Angular dependencies HOT 1
- [d3-interpolate] Update to Minor Version 1.2
- [d3-color] Update to Minor Version 1.2
- [d3-format] Update to Minor Version 1.3
- upgrade to angular 6 HOT 14
- How to read a JSON file and load the data into a Treemap? HOT 1
- Load svg from File
- has no exportted member 'ThresholdArrayGenerator'. HOT 15
- Support for Angular 7 HOT 2
- Include d3-floorplan
- Failed AOT compilation HOT 2
- No Explanation as WHY we need a D3 service HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from d3-ng2-service.