D3 Library — How To Access Data from JSON in this example

前端 未结 3 967
执笔经年
执笔经年 2021-01-01 04:36

I didn\'t explain the issue properly in the title... Sorry.

I\'m following the D3 Tag Cloud Simple example https://github.com/jasondavies/d3-cloud/blob/master/exampl

3条回答
  •  北荒
    北荒 (楼主)
    2021-01-01 05:11

    I had the exact same problem with the words going out of the svg container and i solved it by inserting a variable called origin that i put to (width/2) in the translate method. The border problems were caused by the fact that the alghorithm is made to keep them inside as long as you use the correct center ot the projection field for example: width=300, height=300 that means origin=150. I hope that helps you.

提交回复
热议问题