Using D3 to create a force graph. I wish to click a button and a rectangle appears (which I have done). Now I want to append this rectangles text with a few lines of text.
I have three sentences I wish to show, one on each line, so I know where the line breaks should be.
I have tried these :
.text("test" + "\n" + "should be on second line");
.text("test" + "\\n" + "should be on second line");
.text("test" + "<br/>" + "should be on second line");
.html("test" + "\n" + "should be on second line");
.html("test" + "\\n" + "should be on second line");
.html("test" + "<br/>" + "should be on second line");
None of them seem to work and I am unsure why. I have searched around and people are sort of doing hacks to get around this. Surely there is an easier way ?