score:2
Accepted answer
You can filter
a selection:
var myLink = d3.selectAll(".link")
.filter(function(d) { return d === linkData[3]; })
.attr('stroke', 'red');
Or, better still, as LeartS suggested, you can directly filter the link without whisking through the .data()
from the DOM:
var myLink = d3.selectAll(".link")
.filter(function(d) { return isThisTheLinkIWant(d); })
.attr('stroke', 'red');
Source: stackoverflow.com
Related Query
- In d3, how to get the interpolated line data from a SVG line?
- How to get the data from the c3.js
- how to get data with tsv or csv to array in d3.js from a txt file?
- How do I get data from a rectangle in D3?
- d3 line graphic, get data from Object instead of CSV
- How to reshaping Data in Javascript from array to object without losing some of the data
- How to get data from d3js polyline?
- How do I get an object from d3.data()?
- How to get a data from an analysis in R in Json file format to get D3 visualisations?
- how to get data from mongodb and display as a d3 chart using nodejs
- How to modify tags of an already existing svg object with data from json file
- How to get json data from controller in jsp?
- In d3 4.0, how can I get extra data from the stratified object?
- How to get the data from given array of objects in d3.js
- How to get a value from a nested object in a GeoJson object in d3js?
- How can I get a specific object from an array in javascript?
- How to get a D3.js pie chart to render data dynamically from the DOM
- How to properly get data from a d3.js nested array
- how to plot data from JSON object on .svg file using D3.js
- How to get data of parent node in d3.js
- How to load data from a CSV file in D3 v5
- How to get absolute coordinates of object inside a <g> group?
- How to get maximum value from an array of objects to use in d3.scale.linear().domain()
- D3.JS get reference to bound data of clicked object
- How to select unique values in d3.js from data
- How to load data from an internal JSON array rather than from an external resource / file for a collapsible tree in d3.js?
- Get data from rest service using D3
- How to pull data from mysql database and visualize with D3.JS?
- D3js: how to get Lat/Log geocoordinates from mouse click?
- How can I get "call" to execute for each data element in D3?
More Query from same tag
- d3 data manipulation before plotting
- Align Table Columns Underneath Grouped Bar Chart D3
- Basic d3: why can you select things that don't exist yet?
- Recreate rectangle wave animation with a single line
- Looping transition in D3 version 4 and 5
- d3 wait for n second per iteration
- Issue in fetching data from nested json to construct bar graph in d3
- Call JavaScript function from SVG file
- Javascript's getBBox() provides a box that is taller than its content text. Why?
- Magnifier in d3
- D3 Treemap v3 to v4
- Pie chart on tooltip hover on multi bar chart nvd3
- Pass value to modal and display as plain text
- nvd3 is there existing way to add a scroller to nvd3 chart?
- Failed to generating two pie charts on the same page in d3.js
- D3: uncaught exception: Object
- How can I zoom in on a point in d3.js, manually, without using d3.behavior.zoom()?
- Size of a filtered dimension in Crossfilter?
- DC.JS Composite Chart Not Displaying Last Value
- Threshold scale for position
- d3, data .enter, different groups
- D3 Multi Series Line chart with non time x axis
- hide/Show Grid lines using a button D3
- Loop over JSON data to create d3 pie charts
- Javascript - pass THIS in function doesnt work
- D3.js v5 - appending lines about a circle from length of array
- Ajax retrieve Json string but can not loop the success data as object
- D3js v5 grouped bar chart data x.domain labels and data separated
- d3 stacked bar chart gets stripes when drawing many bars
- Removing attributes from nested array in D3