So I know how to use CSS with my D3 force layout graph but I am trying to put this graph on WordPress using the wp-D3 plugin and it is not compatible with CSS. I tried to include a link to a CSS file in WordPress but that did not work either. So my next step is to try and declare CSS inside my JavaScript but I am not sure how.

      var link = svg.selectAll(".link")
       .attr("class", "link")
       .style("stroke-width", function (d) {
       return Math.sqrt(d.value);

Thesvg.selectAll(".link") refers to the CSS that I used to have but took out. Without it in the CSS, no links appear on the force layout graph.

Here is a link to a fiddle with the graph:

Read more here: Declaring CSS style inside Javascript for D3 graph


If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Related Wordpress search:

, , , , ,

Wordpress related questions and answers: