score:1
Accepted answer
Make sure you pass the actual function and not the return value of the function, by eliminating the ()
:
this.dragger = d3.drag()
.on("drag", this.handleDrag)
.on("end", this.endDrag);
For your other issue, use (this as any).parentNode
to allow this
to be treated as any object to avoid typescript issues.
Source: stackoverflow.com
Related Query
- Implementing d3.js in angular 4
- Problem implementing Stacked Bar Chart using d3.stack() in Angular v11/12
- Using D3.js with Angular 2
- Styles in component for D3.js do not show in angular 2
- Why does d3.js v3 break my force graph when implementing zooming when v2 doesn't?
- D3 with Backbone / D3 with Angular / D3 with Ember?
- Using $filter in Angular directive
- How to use 'this' in Angular with D3?
- Implementing the D3 "reusable chart" pattern in TypeScript
- d3.js runtime error after upgrade to Angular 8
- Correct Way to Import D3.js into an Angular 2 Application
- Having trouble integrating D3.js (collapsible tree) into Angular application
- Angular 2 typescript d3 type issue: Property 'x' does not exist on type '[number, number]'
- Is there any benefit installing d3.js via npm for Angular 2 TypeScript project?
- What object type is the instance element parameter pass into the link function of an angular directive?
- how can I exclude an element from an Angular scope?
- Using d3.js svg clipPath not clipping in Angular
- Angular 4 + D3v4 : dragging circle not working correctly in conjunction with zooming
- d3, Angular 2: node.getBoundingClientRect is not a function
- D3, TS and Angular 2
- Build issue angular 5 has no exported member 'DSVRowAny'
- Argument of type '[string, string] error? (in Angular and d3)
- D3 Pie in Angular 2?
- Angular 2.0 & D3.js don't apply Css on svg
- Error in d3.js after upgrading to Angular 8
- Renderer2 does not render SVG element while using d3 js - Angular 4
- TypeError: Cannot read property 'childNodes' of undefined angular
- How to implement D3 in Angular 2
- What is the equivalent of `link` function in Angular to access DOM elements
- Angular ng-click's inside a dynamically created d3 chart are not working
More Query from same tag
- D3 transform the scale and keep the position unchanged
- get point coordination using path.getPointAtLength after rotation in d3 and svg
- D3.JS to create a Stacked Area Chart
- dc.js - Remove the old chart and redraw chart on range slider filter
- D3: ordinal scale not working with array of objects
- D3 js update plot just adds new points on top
- Struggling to get a chart with modified JSON format
- Making svg container appear one below another on array looping
- Improper transition along path in d3 with leaflet
- Unexpected behavior with d3.svg.line()?
- Problem with label position with more than one nvd3 graph on one site
- d3.js time format %b %e return null
- d3.js sub-select a bar from a bar chart
- Zoom with Axis: undefined is not an object (evaluating 'd3.event.transform')
- D3 insert conditional at end of transition
- d3.js passing in multiple functions on hover
- Dynamically adding nodes to d3.js Force directed graph
- Looping through array and removing elements of specific types d3.js
- D3 visualization responsive to all screen sizes without scroll bar
- Programmatically open nested, collapsed (hidden) nodes in d3.js v6
- Can't remove rotation in D3's radial tree layout
- How can I remove spurious line on zoomable sunburst?
- D3 bar char x-axis line not displaying
- How to zoom a chart in d3 correctly?
- D3 Beginner - having some issues with scale
- d3 heatmap using nested json data: how to create grids
- D3 - add class to selected parent
- TypeError: e is undefined in d3.min.js
- How to set the Origin (drag.origin) for drag behavior in d3 JavaScript library
- Generating custom elements in d3