D3.js binds to an attribute value update of the data on an element, and how to update the corresponding value of its child elements

  var node = this.vis.selectAll(".node").data(nodes, function(d) {
                    return d.id;
                });

  var svg = node.enter().append("svg:svg").classed("node",true);
        svg.append("svg:image").attr("href",function(d){return d.src});
        
< hr >

as above, when you click Refresh, the nodes data has been updated, but the data obtained by d on img is still the data previously bound, not the latest data

Mar.23,2021

enter is only applicable to newly added elements. If you want to have an existing element update, you can use the following methods

node.select('svg:image').attr('href', function(d) { return d.src });

about D3.js Update, Enter and Exit, please take a look at this article http://wiki.jikexueyuan.com/p.

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b35679-2bf89.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b35679-2bf89.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?