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

前端 未结 3 925
执笔经年
执笔经年 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:03

    Can you extract other entries of your data? e.g. words and sentiment?
    Maybe you could try it like following code. If it works, you can change it to your codes.

    var data; // a global
    d3.json("path/to/file.json", function(error, json) {
      if (error) return console.warn(error);
      d3.select("#vis").append("svg")
        .data(json)
        .enter().append("text")
        .text(function(d) {return d.tweets;});
    });
    

提交回复
热议问题