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(); 

2 Answers 2

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.

Sign up to request clarification or add additional context in comments.

4 Comments

That didn't help. I tried referencing online and also downloading it and calling from the local repository.
Do you use In Page javascript or additional js file? Make sure to refer the d3plus before you call any function of your own js code.
Yeah, I have referenced it before calling any function.
Its working from my side, can you please share your code where you are calling d3 functions?
0

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

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.