score:2

*Accepted answer*

You need to use `path.exit().remove();`

. You are missing the parenthesis on `exit`

.

Source: stackoverflow.com

#### Related Query

- Unable to Delete links from a D3 force directed graph with arrows
- Updating links on a force directed graph from dynamic json data
- Updating nodes and links with labels in d3 force directed network graph is not removing the nodes properly
- D3 Force Graph With Arrows and Curved Edges - shorten links so arrow doesnt overlap nodes
- D3.js Force Directed Graph with Json - Create graph specifying link distance from all nodes
- D3 force directed graph with drag and drop support to make selected node position fixed when dropped
- Add text/label onto links in D3 force directed graph
- D3 highlight selected node, and its links to parent and ancestors in a force directed graph
- Adding label to the links in D3 force directed graph
- d3 arrows in Force Directed Graph
- How to check d3 js force graph for nodes with no links and remove them?
- How to render links as elbow connectors in d3 force directed graph
- Collapsible D3 force directed graph with non-tree data
- D3 v4 force directed graph with rectangles
- D3v4 force directed graph - localStorage disconnects links and nodes
- d3js Force Directed Graph - Click on node to popup infobox which read from JSON
- Force directed graph with circular group levels
- I'm unable to remove correctly a node from a D3 force graph
- how to highlight(change color) of all connected(neighbours) nodes and links in a d3 force directed graph
- Missing links in force directed graph
- d3 force directed graph using node names for links
- End points of the links of the force directed graph always stuck to left corner of the rectangular node
- D3 v4 - force directed graph with threshold slider not working
- force directed graph - why pointers change size along with the link width
- D3.js - Changing force directed graph node from circle to svg:rect
- D3 force directed graph nodes with nested circles
- Drawing links that do not affect the physics of a force directed graph
- Unable to render image inside D3 force directed graph
- d3.js tool tip on a force directed graph not displaying complete data while hovering over links
- Removing duplicate edges from an array for a d3 force directed graph

#### More Query from same tag

- D3js force layout - line with gradient between nodes
- Use d3 stack layout with data organized per points, instead of per layers
- How do you move number labels further away from the x-axis in d3.js?
- Possible d3 Bug: dragend fires without any drag event
- D3 stack chart from Array data
- d3 force layout fixed links between nodes
- typescript line chart d3
- d3 zoom x-domain only
- D3 js set data from data-attribute
- How would I add a confidence interval to a distribution graphed using a D3 histogram?
- Conditionally build group in d3
- React + D3: Rendering a bar chart from data in array
- How should I replace this .selectAll necessary before .data in D3?
- NVD3 - Pie Chart - Disable Hover and Where to Find Options
- Scientific notation on axes in plot from django-nvd3
- d3 treemap make each rectangle size represent it's value
- How to rotate x-axis text in dimple.js?
- Shading polygons with d3
- ungrouping an element in D3
- Display D3 text labels only if variable has value
- How to set SVG's(Draw by D3.js) height based on the content?
- Jquery filtering by multiple parameters issue
- d3.js in drupal 7
- d3.js mapping a dataset into a new one with different keys
- Reorder group elements to a specific order
- D3 color change on mouseover using classed("active",true)
- Create nodes based on content BBox and get width of source node when adding links in force layout
- d3 - mouseover and mouseout event not working properly
- Center text over curved links in a force-directed graph
- padding top in bar chart