score:2

Accepted answer

not directly, but you can expand your array

For example:

jj = [{ genre: ['thriller', 'comedy'], title: 'foo'}, { genre: ['thriller', 'action'], title: 'papa'}]

to expand your array:

jj2  = []
jj.forEach(function(movie) { movie.genre.forEach( function(single_genre) { jj2.push({ language: movie.language, genre: single_genre, title: movie.title } ); } ); })

Then you can perform your nesting as normal:

d3.nest().key(function(d) { return d.genre; }).entries(jj2)

Related Query

More Query from same tag