Quantcast
Channel: Active questions tagged html - Stack Overflow
Viewing all articles
Browse latest Browse all 72388

String does not match expected pattern d3 select

$
0
0

I am using d3 v5 for data visualization, I have created a force layout with each of the nodes having their own name as id. This part is done dynamically. The HTML part works fine , the userInput.value will return me an id with "/" in it (The ID for the node in this case is "foo/A" ). However the d3.select function fails when selecting an ID value with forward slash in it. Is there a way to bypass this error without renaming all the nodes?

var userInput = document.getElementById("targetNode");
  var theNode = d3.select("#" + userInput.value);

Viewing all articles
Browse latest Browse all 72388

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>