2

I am getting an error while trying to implement a text wrapping capability to the labels in my force layout, saying d3plus is not defined. I have the following lines of code to reference d3 and d3plus:

<script src="https://d3js.org/d3.v4.min.js"></script>
<script src="//d3plus.org/js/d3.js"></script>
<script src="//d3plus.org/js/d3plus.js"></script>

and the following to call the textwrap method

d3plus.textwrap()
  .container(d3.select(".dataLabels"))
  .draw();  
VerletIntegrator
  • 159
  • 2
  • 10

2 Answers2

3

Your script source to d3plus isn't correct. Instead of

 <script src="https://d3js.org/d3.v4.min.js"></script>
 <script src="//d3plus.org/js/d3.js"></script>
 <script src="//d3plus.org/js/d3plus.js"></script>

use

<script src="https://d3js.org/d3.v4.min.js"></script>
<script src="https://d3plus.org/js/d3.js"></script><!-- https: added -->
<script src="https://d3plus.org/js/d3plus.js"></script><!-- https: added -->

Thanks.

0

You're loading in versions 3 and 4 of d3, which might be causing the errors. D3plus currently only supports version 3.

Dave Landry
  • 246
  • 1
  • 7