score:1

Accepted answer

To apply CSS styles, you need to use .style() instead of .attr()...

htmlwidgets::onRender(sn, jsCode = '
  function(el) {
    d3.selectAll(".node text").style("text-shadow", "1px 0 white, -1px 0 white, 0 1px white, 0 -1px white")
  }
')

enter image description here


Related Query

More Query from same tag