tomwanzek / d3-v4-definitelytyped

[DEPRECATED] This repo was intended as a staging area for typescript definitions supporting the latest major release of D3js (i.e. version 4.1.x) by Mike Bostock. It has been migrated to DefinitelyTyped.
MIT License
53 stars 14 forks source link

d3-drag problems with Angular 2 #133

Closed gretamosa closed 7 years ago

gretamosa commented 7 years ago

Hi,

I'm trying to reproduce the following d3 example (http://bl.ocks.org/cjrd/6863459) in my Angular2 app with d3-drag and d3-select capabilities but I found the following error:

TypeError: Cannot read property 'button' of null
    at SVGGElement.defaultFilter (drag.js:10)
    at SVGGElement.mousedowned (drag.js:41)
    at SVGGElement.<anonymous> (d3.js:811)
    at ZoneDelegate.invokeTask (zone.js:275)
    at Object.onInvokeTask (ng_zone.js:262)
    at ZoneDelegate.invokeTask (zone.js:274)
    at Zone.runTask (zone.js:151)
    at SVGGElement.ZoneTask.invoke (zone.js:345)

My Typescript file has the following imports:

import * as d3 from 'd3';
import * as d3Drag from 'd3-drag';
import * as d3Selection from 'd3-selection';

Finally, I'm using d3 v4.4.4 with Angular2 and using only d3-select the example works but without drag&drop capabilities.

Someone has experienced similar issues or has any clue ?

Thanks,

tomwanzek commented 7 years ago

Please use Stackoverflow for how-to-questions.

If you suspect there is an error with the typescript definitions supporting a specific d3-module, please log an issue on DefinitelyTyped referencing the module name and @-mention me. I will then investigate.

This repo is only available for "historic" reference as it contains helpful background discussions related to design motivations behind the new D3 version 4 definitions now maintained in DefinitelyTyped.

Thanks for understanding. 😄 T