Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/json/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用javascript/coffee和d3.json展平json文件_Javascript_Json_D3.js_Coffeescript - Fatal编程技术网

使用javascript/coffee和d3.json展平json文件

使用javascript/coffee和d3.json展平json文件,javascript,json,d3.js,coffeescript,Javascript,Json,D3.js,Coffeescript,我正在尝试将json中的值展平并合并,下面是json 我已经成功地提取了每个职位使用下面的咖啡代码 d3.json "https://api.github.com/repos/wesm/D3py/commits", (data) -> console.log data[0].commit.author.name return 但当我尝试做下面这样的事情时,我希望看到名称数组,但什么也没得到 d3.json "https://api.github.com/repos/wes

我正在尝试将json中的值展平并合并,下面是json

我已经成功地提取了每个职位使用下面的咖啡代码

d3.json "https://api.github.com/repos/wesm/D3py/commits", (data) -> 
  console.log data[0].commit.author.name
  return 
但当我尝试做下面这样的事情时,我希望看到名称数组,但什么也没得到

 d3.json "https://api.github.com/repos/wesm/D3py/commits", (data) -> 
  names = (name for name in data.commit.author.name)
  console.log names
  return

谢谢大家!@meetamit这很有效,我花了3个小时!!
names = (entry.commit.author.name for entry in data)