简体   繁体   中英

flattened json file using javascript / coffee with d3.json

I am trying to flattened and combine value in json , here's the json

https://api.github.com/repos/wesm/D3py/commits

I have successfully extract by each position use this coffee code below

d3.json "https://api.github.com/repos/wesm/D3py/commits", (data) -> 
  console.log data[0].commit.author.name
  return 

but when I tried to do something like here below I expected to see array of name , but got nothing ,

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM