You have several options here.
d3.selectAll("links") will select all
links elements in the SVG. That obviously won't work, since there is no
<links> element in the SVG specs.
Therefore, one solution is selecting the lines:
Another one, in case you have other lines in the SVG, is using the selection:
Finally, you can just set a class...
var linksRef = svgRef.append("g") .attr("class", "links") .selectAll("line") .data(links_data).enter() .append("line") .attr("class", "link")
... and select by that class:
- Understanding how D3.js binds data to nodes
- How to get data of parent node in d3.js
- D3 - how to deal with JSON data structures?
- How to load data from a CSV file in D3 v5
- How to create elements depending on data in D3?
- How to handle layers with missing data points in d3.layout.stack()
- How to update elements of D3 force layout when the underlying data changes
- In d3, how to get the interpolated line data from a SVG line?
- how to encode this data to parent / children structure in JSON
- How to import XML data using d3.js?
- How do I create a tree layout using JSON data in d3.v4 - without stratify()
- How to update d3.js bar chart with new data
- how to create labels for data in donut chart using d3.js
- Using d3.js, how can I display data faster on my chart?
- How to select unique values in d3.js from data
- How to show c3.js No data but with legend for empty column?
- How to update bound data in d3.js?
- How do I load JSON data synchronously with d3.js?
- How to load data from an internal JSON array rather than from an external resource / file for a collapsible tree in d3.js?
- How to pull data from mysql database and visualize with D3.JS?
- How can I get "call" to execute for each data element in D3?
- How is data parsed in this 3D piechart?
- D3 force layout: How to index data by its ID instead of its index in "nodes" array
- D3 - How to update force simulation when data values change
- how to access data of a d3 SVG Element
- NVD3 - How to refresh the data function to product new data on click
- How to put text data with d3.js
- How do I write recursive d3.js code to deal with nested data structures?
- How to remove data cleanly before updating d3.js chart?
- How to update elements of an HTML that the elements are created using data from a CSV file?
More Query from same tag
- Plotly JS range slider really slow with markers
- d3 bar chart with custom x axis and bar width
- What is the meaning of attr("d", path)?
- How to put REST response back in angular JS tag to draw D3 js pie chart
- How to distinguish "0" values from filtered out values in a dc.js geoChoroplethChart?
- Links not visible when loading json data dynamically into D3 Network Visualization
- NVD3 output date format in tooltip as %d/%m/%y and x-axis date as %d/%m
- Animating arc to horizontal line with d3.js
- Pie chart avoiding same adjacent color when rotating colors
- Create wordcloud d3.js from elasticsearch
- d3.csv.parseRows and d3.csv output different results
- How can I dynamically resize an SVG rect based on text width?
- Show div element on mouseover for node in D3 force layout
- d3 graph - How do I make the JS get the JSON from PHP script and then select axes and plot?
- d3 dependency loading before d3
- Using XML as a datasource in d3js layout doesn't work in firefox
- how to correctly place the text labels in d3.js?
- Should this code override the default d3 version in use by Juypyter notebooks?
- D3.js stacked bar chart growing to negative direction
- Difference between dynamic rectangles and circles in d3?
- How to generate part of html code on server side (nodejs)?
- Hide axis tick values under a certain range in d3.js
- Set tooltip position on the last value on the graph
- D3 Not Displaying SVG Text Element
- d3 bar char labels transitions
- How to get parent node from child in json using d3js as Force Layout?
- d3 Hexagonal Binning domain and range
- Added X-Axis Labels to C3 Bar Chart
- Difference between selections when using 'attr()'
- Updating D3 histogram as data comes in