Skip to content

Instantly share code, notes, and snippets.

@soupjake
Last active April 13, 2017 14:00
Show Gist options
  • Save soupjake/5f6020ee4c6a1f88d4608a488274d65f to your computer and use it in GitHub Desktop.
Save soupjake/5f6020ee4c6a1f88d4608a488274d65f to your computer and use it in GitHub Desktop.
moviegenresd3
<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><title>Movie Genres By Decades</title><link rel="stylesheet" href="style.css"><meta name="viewport" content="width=device-width, initial-scale=1.0"></head><body><div id="title"><h1>MOVIE GENRES BY THE DECADES</h1></div><div id="vis"><div id="tipsbar"> <input type="checkbox" id="toggletips"> Tooltips<br/><div id="tooltips"><ul><li>Click on a genre area to "zoom" sunburst in</li><li>"Hover" over a genre area for more genre info</li><li>Use the slider below to load in a different decade</li></ul></div></div><div id="legendbar"> <input type="checkbox" id="togglelegend"> Main Genre Details<br/><div id="legend"></div></div> <svg id="chart"></svg><div class="range-slider"><form> <input type="range" min=1930 max=2010 step=10 id="decade" value=2010 oninput="selected_decade.value = decade.value"> <output name="selected_decade" id="selected_decade">2010</output></form></div></div> <script src="https://d3js.org/d3.v4.min.js"></script> <script src="script.js"></script> </body></html>
{"name":"1930","children":[{"name":"Action","children":[{"name":"Adventure","children":[{"name":"Romance","size":1}]}]},{"name":"Adventure","children":[{"name":"Drama","children":[{"name":"Romance","size":1}]},{"name":"Family","children":[{"name":"Fantasy","size":1}]}]},{"name":"Animation","children":[{"name":"Family","children":[{"name":"Fantasy","size":1}]}]},{"name":"Comedy","children":[{"name":"Drama","children":[{"name":"","size":1},{"name":"Family","size":1},{"name":"History","size":1},{"name":"Romance","size":1}]},{"name":"Musical","children":[{"name":"Romance","size":2}]},{"name":"Romance","children":[{"name":"","size":1}]}]},{"name":"Drama","children":[{"name":"History","children":[{"name":"Romance","size":1}]},{"name":"Musical","children":[{"name":"Romance","size":1}]},{"name":"Romance","children":[{"name":"War","size":1}]},{"name":"War","children":[{"name":"","size":1}]}]}]}
{"name":"1940","children":[{"name":"Action","children":[{"name":"Adventure","children":[{"name":"Romance","size":1}]},{"name":"Drama","children":[{"name":"Romance","size":1}]}]},{"name":"Adventure","children":[{"name":"Comedy","children":[{"name":"Musical","size":1}]},{"name":"Drama","children":[{"name":"Romance","size":2}]}]},{"name":"Animation","children":[{"name":"Drama","children":[{"name":"Family","size":1}]},{"name":"Family","children":[{"name":"Fantasy","size":2}]}]},{"name":"Comedy","children":[{"name":"Musical","children":[{"name":"","size":1}]}]},{"name":"Crime","children":[{"name":"Drama","children":[{"name":"","size":1},{"name":"Film-Noir","size":1}]}]},{"name":"Drama","children":[{"name":"","children":[{"name":"","size":1}]},{"name":"Family","children":[{"name":"","size":1},{"name":"Fantasy","size":2}]},{"name":"Fantasy","children":[{"name":"Romance","size":1}]},{"name":"Film-Noir","children":[{"name":"","size":1},{"name":"Mystery","size":1}]},{"name":"Romance","children":[{"name":"","size":1},{"name":"War","size":2},{"name":"Western","size":1}]}]},{"name":"Film-Noir","children":[{"name":"Mystery","children":[{"name":"Romance","size":1}]}]},{"name":"Musical","children":[{"name":"Romance","children":[{"name":"","size":1}]}]},{"name":"Western","children":[{"name":"","children":[{"name":"","size":1}]}]}]}
{"name":"1950","children":[{"name":"Action","children":[{"name":"Adventure","children":[{"name":"Drama","size":1}]}]},{"name":"Adventure","children":[{"name":"Drama","children":[{"name":"","size":1},{"name":"Family","size":1},{"name":"War","size":1}]},{"name":"Horror","children":[{"name":"Sci-Fi","size":1}]}]},{"name":"Biography","children":[{"name":"Comedy","children":[{"name":"Musical","size":1}]},{"name":"Drama","children":[{"name":"History","size":1}]}]},{"name":"Comedy","children":[{"name":"Music","children":[{"name":"Romance","size":1}]},{"name":"Musical","children":[{"name":"Romance","size":1}]},{"name":"Mystery","children":[{"name":"Romance","size":1}]}]},{"name":"Crime","children":[{"name":"Drama","children":[{"name":"","size":1},{"name":"Film-Noir","size":1},{"name":"Romance","size":1}]},{"name":"Film-Noir","children":[{"name":"Thriller","size":1}]}]},{"name":"Drama","children":[{"name":"","children":[{"name":"","size":2}]},{"name":"Family","children":[{"name":"Musical","size":1},{"name":"Romance","size":1}]},{"name":"Fantasy","children":[{"name":"","size":1}]},{"name":"History","children":[{"name":"","size":2},{"name":"Romance","size":1}]},{"name":"Romance","children":[{"name":"","size":2},{"name":"War","size":1},{"name":"Western","size":1}]}]},{"name":"Thriller","children":[{"name":"Western","children":[{"name":"","size":1}]}]}]}
{"name":"1960","children":[{"name":"Action","children":[{"name":"Adventure","children":[{"name":"Comedy","size":1},{"name":"Drama","size":1},{"name":"Thriller","size":6},{"name":"Western","size":1}]},{"name":"Crime","children":[{"name":"Drama","size":1}]},{"name":"Drama","children":[{"name":"History","size":1},{"name":"Western","size":1}]}]},{"name":"Adventure","children":[{"name":"Biography","children":[{"name":"Drama","size":1}]},{"name":"Comedy","children":[{"name":"Family","size":1},{"name":"Fantasy","size":1},{"name":"History","size":1},{"name":"Romance","size":1}]},{"name":"Drama","children":[{"name":"History","size":1}]},{"name":"Mystery","children":[{"name":"Sci-Fi","size":1}]},{"name":"War","children":[{"name":"Western","size":1}]}]},{"name":"Animation","children":[{"name":"Comedy","children":[{"name":"Family","size":1}]}]},{"name":"Biography","children":[{"name":"Crime","children":[{"name":"Drama","size":2}]},{"name":"Drama","children":[{"name":"Family","size":1},{"name":"History","size":3}]}]},{"name":"Comedy","children":[{"name":"","children":[{"name":"","size":1}]},{"name":"Drama","children":[{"name":"","size":2},{"name":"Music","size":1},{"name":"Musical ","size":1},{"name":"Romance","size":1}]},{"name":"Family","children":[{"name":"","size":1},{"name":"Fantasy","size":1}]},{"name":"Musical","children":[{"name":"","size":2}]}]},{"name":"Crime","children":[{"name":"Drama","children":[{"name":"","size":1},{"name":"Mystery","size":1},{"name":"Romance","size":3},{"name":"Thriller","size":1}]},{"name":"Thriller","children":[{"name":"","size":1}]}]},{"name":"Drama","children":[{"name":"","children":[{"name":"","size":5}]},{"name":"Family","children":[{"name":"Musical","size":2}]},{"name":"History","children":[{"name":"War","size":1}]},{"name":"Horror","children":[{"name":"","size":1},{"name":"Mystery","size":1}]},{"name":"Romance","children":[{"name":"","size":1},{"name":"Sci-Fi","size":1},{"name":"War","size":1},{"name":"Western","size":1}]},{"name":"Sport","children":[{"name":"","size":1}]},{"name":"Thriller","children":[{"name":"","size":1}]},{"name":"War","children":[{"name":"","size":1}]},{"name":"Western","children":[{"name":"","size":1}]}]},{"name":"Horror","children":[{"name":"Mystery","children":[{"name":"","size":1},{"name":"Thriller","size":1}]},{"name":"Sci-Fi","children":[{"name":"","size":1}]}]},{"name":"Thriller","children":[{"name":"","children":[{"name":"","size":1}]},{"name":"War","children":[{"name":"","size":1}]}]},{"name":"Western","children":[{"name":"","children":[{"name":"","size":4}]}]}]}
{"name":"1970","children":[{"name":"Action","children":[{"name":"Adventure","children":[{"name":"Drama","size":1},{"name":"Fantasy","size":1},{"name":"History","size":1},{"name":"Sci-Fi","size":5},{"name":"Thriller","size":3}]},{"name":"Comedy","children":[{"name":"","size":1},{"name":"Sci-Fi","size":1},{"name":"War","size":1}]},{"name":"Crime","children":[{"name":"Drama","size":1}]},{"name":"Drama","children":[{"name":"History","size":2},{"name":"Sci-Fi","size":1},{"name":"War","size":1}]},{"name":"Sci-Fi","children":[{"name":"","size":4},{"name":"Thriller","size":1}]}]},{"name":"Adventure","children":[{"name":"Comedy","children":[{"name":"Family","size":1},{"name":"Fantasy","size":1}]},{"name":"Crime","children":[{"name":"Drama","size":1}]},{"name":"Drama","children":[{"name":"History","size":1},{"name":"Romance","size":2},{"name":"Thriller","size":2}]},{"name":"Family","children":[{"name":"Fantasy","size":1},{"name":"Romance","size":1},{"name":"Sport","size":1}]},{"name":"Horror","children":[{"name":"Thriller","size":1}]},{"name":"Mystery","children":[{"name":"Sci-Fi","size":1}]}]},{"name":"Biography","children":[{"name":"Crime","children":[{"name":"Drama","size":1}]},{"name":"Drama","children":[{"name":"Romance","size":1},{"name":"War","size":1}]}]},{"name":"Comedy","children":[{"name":"","children":[{"name":"","size":6}]},{"name":"Crime","children":[{"name":"Drama","size":1},{"name":"Horror","size":1},{"name":"Mystery","size":1}]},{"name":"Drama","children":[{"name":"Family","size":1},{"name":"Music","size":3},{"name":"Musical ","size":1},{"name":"Romance","size":2},{"name":"War","size":1}]},{"name":"Romance","children":[{"name":"","size":2}]},{"name":"Sci-Fi","children":[{"name":"","size":1}]},{"name":"Thriller","children":[{"name":"","size":1}]},{"name":"Western","children":[{"name":"","size":1}]}]},{"name":"Crime","children":[{"name":"Drama","children":[{"name":"","size":3},{"name":"Romance","size":1},{"name":"Sport","size":1},{"name":"Thriller","size":1}]},{"name":"Horror","children":[{"name":"Thriller","size":1}]}]},{"name":"Documentary","children":[{"name":"History","children":[{"name":"Music","size":1}]},{"name":"Music","children":[{"name":"","size":1}]}]},{"name":"Drama","children":[{"name":"","children":[{"name":"","size":5}]},{"name":"Family","children":[{"name":"History","size":1},{"name":"Musical","size":1}]},{"name":"Fantasy","children":[{"name":"","size":1}]},{"name":"History","children":[{"name":"","size":1},{"name":"War","size":1}]},{"name":"Music","children":[{"name":"Musical","size":1},{"name":"Romance","size":1}]},{"name":"Mystery","children":[{"name":"Sci-Fi","size":1},{"name":"Thriller","size":1}]},{"name":"Romance","children":[{"name":"","size":2}]},{"name":"Sci-Fi","children":[{"name":"","size":2}]},{"name":"Sport","children":[{"name":"","size":1}]},{"name":"Thriller","children":[{"name":"","size":1}]},{"name":"War","children":[{"name":"","size":2}]}]},{"name":"Family","children":[{"name":"Fantasy","children":[{"name":"Musical","size":1}]}]},{"name":"Fantasy","children":[{"name":"Horror","children":[{"name":"Mystery","size":1},{"name":"Sci-Fi","size":1}]}]},{"name":"Horror","children":[{"name":"","children":[{"name":"","size":3}]},{"name":"Sci-Fi","children":[{"name":"","size":3}]},{"name":"Thriller","children":[{"name":"","size":2}]}]},{"name":"Musical","children":[{"name":"Romance","children":[{"name":"","size":1}]}]},{"name":"Mystery","children":[{"name":"Western","children":[{"name":"","size":1}]}]},{"name":"Sci-Fi","children":[{"name":"","children":[{"name":"","size":1}]},{"name":"Thriller","children":[{"name":"","size":1}]}]},{"name":"Thriller","children":[{"name":"","children":[{"name":"","size":1}]}]}]}
{"name":"1980","children":[{"name":"Action","children":[{"name":"Adventure","children":[{"name":"","size":3},{"name":"Comedy","size":6},{"name":"Drama","size":3},{"name":"Family","size":1},{"name":"Fantasy","size":9},{"name":"Romance","size":1},{"name":"Sci-Fi","size":8},{"name":"Thriller","size":10},{"name":"Western","size":1}]},{"name":"Animation","children":[{"name":"Sci-Fi","size":1}]},{"name":"Biography","children":[{"name":"Drama","size":2}]},{"name":"Comedy","children":[{"name":"Crime","size":6},{"name":"Drama","size":1},{"name":"Horror","size":2},{"name":"Sci-Fi","size":1},{"name":"War","size":1}]},{"name":"Crime","children":[{"name":"Drama","size":4},{"name":"Sci-Fi","size":1},{"name":"Thriller","size":2}]},{"name":"Drama","children":[{"name":"Family","size":1},{"name":"Horror","size":1},{"name":"Romance","size":1},{"name":"Thriller","size":2},{"name":"War","size":1}]},{"name":"Fantasy","children":[{"name":"Fantasy","size":3}]},{"name":"Horror","children":[{"name":"Romance","size":1},{"name":"Sci-Fi","size":3}]},{"name":"Sci-Fi","children":[{"name":"","size":4},{"name":"Sport","size":1}]},{"name":"Thriller","children":[{"name":"","size":3}]}]},{"name":"Adventure","children":[{"name":"Animation","children":[{"name":"Comedy","size":1},{"name":"Family","size":1},{"name":"Fantasy","size":1}]},{"name":"Comedy","children":[{"name":"","size":3},{"name":"Drama","size":1},{"name":"Fantasy","size":1},{"name":"Music","size":1},{"name":"Sci-Fi","size":4}]},{"name":"Crime","children":[{"name":"Drama","size":2},{"name":"Thriller","size":1}]},{"name":"Drama","children":[{"name":"","size":2},{"name":"Family","size":2},{"name":"Fantasy","size":1},{"name":"History","size":3},{"name":"Romance","size":1},{"name":"Sci-Fi","size":1},{"name":"Thriller","size":1},{"name":"Western","size":1}]},{"name":"Family","children":[{"name":"Fantasy","size":2}]},{"name":"Fantasy","children":[{"name":"","size":3},{"name":"Mystery","size":1}]},{"name":"Horror","children":[{"name":"","size":1},{"name":"Thriller","size":2}]},{"name":"Mystery","children":[{"name":"Thriller","size":1}]}]},{"name":"Biography","children":[{"name":"Comedy","children":[{"name":"Drama","size":1},{"name":"Musical","size":1}]},{"name":"Drama","children":[{"name":"","size":2},{"name":"History","size":6},{"name":"Music","size":2},{"name":"Romance","size":1},{"name":"Sport","size":2},{"name":"War","size":1}]}]},{"name":"Comedy","children":[{"name":"","children":[{"name":"","size":9}]},{"name":"Crime","children":[{"name":"","size":2},{"name":"Romance","size":1},{"name":"Sci-Fi","size":1}]},{"name":"Drama","children":[{"name":"","size":5},{"name":"Family","size":4},{"name":"Fantasy","size":2},{"name":"Music","size":1},{"name":"Musical ","size":1},{"name":"Romance","size":7},{"name":"Thriller","size":1}]},{"name":"Family","children":[{"name":"","size":1}]},{"name":"Fantasy","children":[{"name":"","size":2},{"name":"Horror","size":5},{"name":"Romance","size":1},{"name":"Sci-Fi","size":1}]},{"name":"Horror","children":[{"name":"","size":1},{"name":"Musical","size":1},{"name":"Sci-Fi","size":1}]},{"name":"Music","children":[{"name":"Sci-Fi","size":1}]},{"name":"Musical","children":[{"name":"","size":1}]},{"name":"Romance","children":[{"name":"","size":1},{"name":"Sci-Fi","size":1}]},{"name":"Sci-Fi","children":[{"name":"","size":2}]},{"name":"Sport","children":[{"name":"","size":2}]},{"name":"War","children":[{"name":"","size":1}]}]},{"name":"Crime","children":[{"name":"Drama","children":[{"name":"","size":6},{"name":"Horror","size":1},{"name":"Music","size":1},{"name":"Mystery","size":1},{"name":"Romance","size":2},{"name":"Thriller","size":1}]}]},{"name":"Documentary","children":[{"name":"","children":[{"name":"","size":1}]}]},{"name":"Drama","children":[{"name":"","children":[{"name":"","size":10}]},{"name":"Fantasy","children":[{"name":"Romance","size":1}]},{"name":"History","children":[{"name":"War","size":3}]},{"name":"Horror","children":[{"name":"","size":1}]},{"name":"Music","children":[{"name":"Romance","size":2}]},{"name":"Musical","children":[{"name":"Romance","size":1}]},{"name":"Romance","children":[{"name":"","size":5},{"name":"Thriller","size":1}]},{"name":"Sci-Fi","children":[{"name":"","size":1}]},{"name":"Sport","children":[{"name":"","size":1}]},{"name":"War","children":[{"name":"","size":1}]}]},{"name":"Family","children":[{"name":"Sci-Fi","children":[{"name":"","size":1}]}]},{"name":"Fantasy","children":[{"name":"Horror","children":[{"name":"","size":7},{"name":"Mystery","size":1},{"name":"Romance","size":1},{"name":"Sci-Fi","size":1},{"name":"Thriller","size":2}]}]},{"name":"Horror","children":[{"name":"","children":[{"name":"","size":5}]},{"name":"Mystery","children":[{"name":"","size":2},{"name":"Sci-Fi","size":3},{"name":"Thriller","size":3}]},{"name":"Sci-Fi","children":[{"name":"","size":4}]},{"name":"Thriller","children":[{"name":"","size":6}]}]},{"name":"Mystery","children":[{"name":"Romance","children":[{"name":"Thriller","size":1}]},{"name":"Thriller","children":[{"name":"","size":2}]}]},{"name":"Sci-Fi","children":[{"name":"Thriller","children":[{"name":"","size":2}]}]},{"name":"Western","children":[{"name":"","children":[{"name":"","size":3}]}]}]}
{"name":"1990","children":[{"name":"Action","children":[{"name":"","children":[{"name":"","size":3}]},{"name":"Adventure","children":[{"name":"","size":1},{"name":"Animation","size":2},{"name":"Comedy","size":18},{"name":"Crime","size":7},{"name":"Drama","size":11},{"name":"Family","size":2},{"name":"Fantasy","size":8},{"name":"History","size":1},{"name":"Horror","size":2},{"name":"Mystery","size":2},{"name":"Romance","size":2},{"name":"Sci-Fi","size":9},{"name":"Thriller","size":11}]},{"name":"Biography","children":[{"name":"Drama","size":1}]},{"name":"Comedy","children":[{"name":"","size":3},{"name":"Crime","size":17},{"name":"Family","size":1},{"name":"Fantasy","size":1},{"name":"Horror","size":1},{"name":"Sci-Fi","size":3},{"name":"Thriller","size":2}]},{"name":"Crime","children":[{"name":"","size":1},{"name":"Drama","size":22},{"name":"Horror","size":1},{"name":"Mystery","size":2},{"name":"Romance","size":2},{"name":"Sci-Fi","size":6},{"name":"Thriller","size":9}]},{"name":"Drama","children":[{"name":"","size":1},{"name":"Fantasy","size":2},{"name":"History","size":1},{"name":"Music","size":1},{"name":"Mystery","size":2},{"name":"Romance","size":1},{"name":"Sci-Fi","size":4},{"name":"Sport","size":2},{"name":"Thriller","size":5},{"name":"War","size":2}]},{"name":"Fantasy","children":[{"name":"Fantasy","size":4}]},{"name":"Horror","children":[{"name":"","size":2},{"name":"Sci-Fi","size":4},{"name":"Thriller","size":1}]},{"name":"Sci-Fi","children":[{"name":"","size":4},{"name":"Thriller","size":1},{"name":"War","size":1}]},{"name":"Thriller","children":[{"name":"","size":7},{"name":"Western","size":1}]}]},{"name":"Adventure","children":[{"name":"Animation","children":[{"name":"Biography","size":1},{"name":"Comedy","size":9},{"name":"Drama","size":3},{"name":"Family","size":1},{"name":"Fantasy","size":1}]},{"name":"Biography","children":[{"name":"","size":1},{"name":"Crime","size":1},{"name":"Drama","size":3}]},{"name":"Comedy","children":[{"name":"","size":2},{"name":"Crime","size":1},{"name":"Drama","size":4},{"name":"Family","size":9},{"name":"Fantasy","size":1},{"name":"Sci-Fi","size":3},{"name":"Sport","size":1}]},{"name":"Drama","children":[{"name":"","size":2},{"name":"History","size":1},{"name":"Horror","size":1},{"name":"Romance","size":3},{"name":"Thriller","size":1},{"name":"Western","size":1}]},{"name":"Family","children":[{"name":"","size":3},{"name":"Fantasy","size":1}]},{"name":"Sci-Fi","children":[{"name":"Thriller","size":1}]}]},{"name":"Animation","children":[{"name":"Comedy","children":[{"name":"Drama","size":1},{"name":"Family","size":2},{"name":"Fantasy","size":1}]},{"name":"Drama","children":[{"name":"Family","size":1}]},{"name":"Family","children":[{"name":"Fantasy","size":1}]}]},{"name":"Biography","children":[{"name":"Comedy","children":[{"name":"Drama","size":4},{"name":"Romance","size":1}]},{"name":"Crime","children":[{"name":"Drama","size":6}]},{"name":"Documentary","children":[{"name":"Sport","size":1}]},{"name":"Drama","children":[{"name":"","size":5},{"name":"History","size":8},{"name":"Music","size":4},{"name":"Romance","size":3},{"name":"Sport","size":2},{"name":"Thriller","size":2}]}]},{"name":"Comedy","children":[{"name":"","children":[{"name":"","size":32}]},{"name":"Crime","children":[{"name":"","size":15},{"name":"Drama","size":11},{"name":"Family","size":1},{"name":"Romance","size":3},{"name":"Thriller","size":5}]},{"name":"Drama","children":[{"name":"","size":43},{"name":"Family","size":10},{"name":"Fantasy","size":5},{"name":"Music","size":4},{"name":"Romance","size":41},{"name":"Sci-Fi","size":2},{"name":"Sport","size":3},{"name":"Thriller","size":1},{"name":"War","size":1}]},{"name":"Family","children":[{"name":"","size":4},{"name":"Fantasy","size":7},{"name":"Music","size":1},{"name":"Musical ","size":1},{"name":"Romance","size":1},{"name":"Sci-Fi","size":2}]},{"name":"Fantasy","children":[{"name":"","size":3},{"name":"Horror","size":8},{"name":"Romance","size":2},{"name":"Sci-Fi","size":1}]},{"name":"Horror","children":[{"name":"","size":1},{"name":"Sci-Fi","size":1},{"name":"Thriller","size":1}]},{"name":"Music","children":[{"name":"","size":4},{"name":"Romance","size":2}]},{"name":"Musical","children":[{"name":"Romance","size":1}]},{"name":"Romance","children":[{"name":"","size":19},{"name":"Sci-Fi","size":3},{"name":"Thriller","size":1}]},{"name":"Sci-Fi","children":[{"name":"","size":1}]},{"name":"Sport","children":[{"name":"","size":3}]}]},{"name":"Crime","children":[{"name":"Drama","children":[{"name":"","size":14},{"name":"Fantasy","size":1},{"name":"History","size":1},{"name":"Horror","size":1},{"name":"Music","size":1},{"name":"Mystery","size":14},{"name":"Romance","size":6},{"name":"Thriller","size":17}]},{"name":"Fantasy","children":[{"name":"Horror","size":1}]},{"name":"Horror","children":[{"name":"Mystery","size":1}]},{"name":"Mystery","children":[{"name":"Thriller","size":3}]},{"name":"Romance","children":[{"name":"Thriller","size":1}]},{"name":"Thriller","children":[{"name":"","size":3}]}]},{"name":"Documentary","children":[{"name":"","children":[{"name":"","size":1}]},{"name":"Drama","children":[{"name":"War","size":1}]}]},{"name":"Drama","children":[{"name":"","children":[{"name":"","size":39}]},{"name":"Family","children":[{"name":"","size":2},{"name":"Fantasy","size":1},{"name":"Romance","size":1}]},{"name":"Fantasy","children":[{"name":"Horror","size":2},{"name":"Romance","size":5},{"name":"Thriller","size":1}]},{"name":"History","children":[{"name":"","size":5},{"name":"Horror","size":1},{"name":"Romance","size":1},{"name":"War","size":1}]},{"name":"Horror","children":[{"name":"Romance","size":2},{"name":"Sci-Fi","size":1}]},{"name":"Music","children":[{"name":"","size":3},{"name":"Mystery","size":1},{"name":"Romance","size":2}]},{"name":"Musical","children":[{"name":"","size":1}]},{"name":"Mystery","children":[{"name":"","size":1},{"name":"Romance","size":3},{"name":"Sci-Fi","size":3},{"name":"Thriller","size":10}]},{"name":"Romance","children":[{"name":"","size":27},{"name":"Sport","size":1},{"name":"War","size":5},{"name":"Western","size":1}]},{"name":"Sci-Fi","children":[{"name":"Thriller","size":2}]},{"name":"Sport","children":[{"name":"","size":2}]},{"name":"Thriller","children":[{"name":"","size":10}]},{"name":"War","children":[{"name":"","size":3}]},{"name":"Western","children":[{"name":"","size":1}]}]},{"name":"Family","children":[{"name":"Fantasy","children":[{"name":"Music","size":1}]}]},{"name":"Fantasy","children":[{"name":"Horror","children":[{"name":"","size":4},{"name":"Mystery","size":2},{"name":"Romance","size":1},{"name":"Thriller","size":2}]},{"name":"Romance","children":[{"name":"","size":2}]}]},{"name":"Horror","children":[{"name":"","children":[{"name":"","size":4}]},{"name":"Mystery","children":[{"name":"","size":3},{"name":"Sci-Fi","size":3},{"name":"Thriller","size":4}]},{"name":"Romance","children":[{"name":"Sci-Fi","size":1}]},{"name":"Sci-Fi","children":[{"name":"","size":6}]},{"name":"Thriller","children":[{"name":"","size":1}]}]},{"name":"Mystery","children":[{"name":"Sci-Fi","children":[{"name":"Thriller","size":2}]},{"name":"Thriller","children":[{"name":"","size":2}]}]},{"name":"Sci-Fi","children":[{"name":"","children":[{"name":"","size":1}]}]}]}
{"name":"2000","children":[{"name":"Action","children":[{"name":"","children":[{"name":"","size":2}]},{"name":"Adventure","children":[{"name":"","size":4},{"name":"Animation","size":20},{"name":"Biography","size":1},{"name":"Comedy","size":33},{"name":"Crime","size":8},{"name":"Drama","size":20},{"name":"Family","size":7},{"name":"Fantasy","size":32},{"name":"History","size":1},{"name":"Horror","size":4},{"name":"Mystery","size":1},{"name":"Romance","size":5},{"name":"Sci-Fi","size":26},{"name":"Thriller","size":8},{"name":"Western","size":2}]},{"name":"Animation","children":[{"name":"Comedy","size":2},{"name":"Sci-Fi","size":1}]},{"name":"Biography","children":[{"name":"Crime","size":3}]},{"name":"Comedy","children":[{"name":"","size":6},{"name":"Crime","size":28},{"name":"Documentary","size":2},{"name":"Drama","size":4},{"name":"Family","size":1},{"name":"Fantasy","size":4},{"name":"Horror","size":3},{"name":"Music","size":1},{"name":"Mystery","size":1},{"name":"Romance","size":2},{"name":"Sci-Fi","size":3},{"name":"Sport","size":2},{"name":"Thriller","size":1}]},{"name":"Crime","children":[{"name":"","size":1},{"name":"Drama","size":43},{"name":"Fantasy","size":4},{"name":"Mystery","size":1},{"name":"Sci-Fi","size":2},{"name":"Thriller","size":29}]},{"name":"Drama","children":[{"name":"","size":3},{"name":"Fantasy","size":4},{"name":"History","size":7},{"name":"Horror","size":1},{"name":"Mystery","size":1},{"name":"Romance","size":3},{"name":"Sci-Fi","size":1},{"name":"Sport","size":2},{"name":"Thriller","size":11},{"name":"War","size":4}]},{"name":"Family","children":[{"name":"Family","size":1}]},{"name":"Fantasy","children":[{"name":"Fantasy","size":5}]},{"name":"Horror","children":[{"name":"Mystery","size":1},{"name":"Sci-Fi","size":12},{"name":"Thriller","size":3}]},{"name":"Mystery","children":[{"name":"Sci-Fi","size":4},{"name":"Thriller","size":5}]},{"name":"Sci-Fi","children":[{"name":"","size":5},{"name":"Sport","size":1},{"name":"Thriller","size":7}]},{"name":"Sport","children":[{"name":"","size":1}]},{"name":"Thriller","children":[{"name":"","size":2}]},{"name":"War","children":[{"name":"","size":1}]},{"name":"Western","children":[{"name":"","size":1}]}]},{"name":"Adventure","children":[{"name":"","children":[{"name":"","size":2}]},{"name":"Animation","children":[{"name":"Comedy","size":44},{"name":"Family","size":13}]},{"name":"Biography","children":[{"name":"Drama","size":6}]},{"name":"Comedy","children":[{"name":"","size":6},{"name":"Crime","size":4},{"name":"Drama","size":15},{"name":"Family","size":20},{"name":"Fantasy","size":1},{"name":"History","size":1},{"name":"Horror","size":2},{"name":"Mystery","size":2},{"name":"Romance","size":2},{"name":"Sci-Fi","size":4}]},{"name":"Crime","children":[{"name":"Drama","size":2}]},{"name":"Documentary","children":[{"name":"Drama","size":1},{"name":"Short","size":1}]},{"name":"Drama","children":[{"name":"","size":6},{"name":"Family","size":6},{"name":"Fantasy","size":2},{"name":"History","size":3},{"name":"Mystery","size":1},{"name":"Romance","size":5},{"name":"Sci-Fi","size":2},{"name":"Thriller","size":2},{"name":"War","size":1}]},{"name":"Family","children":[{"name":"Fantasy","size":12}]},{"name":"Fantasy","children":[{"name":"","size":1},{"name":"Horror","size":1},{"name":"Mystery","size":1},{"name":"Thriller","size":1}]},{"name":"Horror","children":[{"name":"Mystery","size":1},{"name":"Thriller","size":2}]},{"name":"Mystery","children":[{"name":"Thriller","size":1}]},{"name":"Sci-Fi","children":[{"name":"Thriller","size":3}]}]},{"name":"Animation","children":[{"name":"Biography","children":[{"name":"Documentary","size":1},{"name":"Drama","size":1}]},{"name":"Comedy","children":[{"name":"","size":1},{"name":"Drama","size":2},{"name":"Family","size":16},{"name":"Fantasy","size":1}]},{"name":"Drama","children":[{"name":"","size":1},{"name":"Family","size":2},{"name":"Mystery","size":1}]},{"name":"Family","children":[{"name":"Fantasy","size":3}]}]},{"name":"Biography","children":[{"name":"Comedy","children":[{"name":"Crime","size":3},{"name":"Documentary","size":1},{"name":"Drama","size":5},{"name":"Romance","size":1}]},{"name":"Crime","children":[{"name":"Documentary","size":1},{"name":"Drama","size":15}]},{"name":"Documentary","children":[{"name":"","size":1},{"name":"History","size":1},{"name":"Music","size":3}]},{"name":"Drama","children":[{"name":"","size":18},{"name":"Family","size":1},{"name":"Fantasy","size":1},{"name":"History","size":19},{"name":"Music","size":11},{"name":"Romance","size":12},{"name":"Sport","size":12},{"name":"War","size":1}]}]},{"name":"Comedy","children":[{"name":"","children":[{"name":"","size":80}]},{"name":"Crime","children":[{"name":"","size":25},{"name":"Drama","size":22},{"name":"Family","size":4},{"name":"Horror","size":1},{"name":"Music","size":3},{"name":"Musical","size":3},{"name":"Mystery","size":5},{"name":"Romance","size":9},{"name":"Sport","size":1},{"name":"Thriller","size":6}]},{"name":"Documentary","children":[{"name":"Documentary","size":8}]},{"name":"Drama","children":[{"name":"","size":78},{"name":"Family","size":19},{"name":"Fantasy","size":8},{"name":"History","size":1},{"name":"Horror","size":3},{"name":"Music","size":16},{"name":"Musical ","size":3},{"name":"Mystery","size":1},{"name":"Romance","size":101},{"name":"Sci-Fi","size":1},{"name":"Sport","size":3},{"name":"War","size":1}]},{"name":"Family","children":[{"name":"","size":10},{"name":"Fantasy","size":18},{"name":"Music","size":2},{"name":"Musical ","size":1},{"name":"Romance","size":10},{"name":"Sci-Fi","size":2},{"name":"Sport","size":2}]},{"name":"Fantasy","children":[{"name":"","size":6},{"name":"Horror","size":4},{"name":"Mystery","size":1},{"name":"Romance","size":9},{"name":"Sci-Fi","size":1}]},{"name":"History","children":[{"name":"History","size":1}]},{"name":"Horror","children":[{"name":"","size":5},{"name":"Musical","size":2},{"name":"Mystery","size":1},{"name":"Sci-Fi","size":4},{"name":"Thriller","size":3}]},{"name":"Music","children":[{"name":"","size":10},{"name":"Romance","size":3}]},{"name":"Musical","children":[{"name":"","size":1},{"name":"Romance","size":3}]},{"name":"Mystery","children":[{"name":"","size":1},{"name":"Romance","size":1},{"name":"Sci-Fi","size":1}]},{"name":"Romance","children":[{"name":"","size":91},{"name":"Sci-Fi","size":7}]},{"name":"Sci-Fi","children":[{"name":"","size":2},{"name":"Thriller","size":1}]},{"name":"Short","children":[{"name":"","size":1}]},{"name":"Sport","children":[{"name":"","size":9}]},{"name":"War","children":[{"name":"","size":1}]}]},{"name":"Crime","children":[{"name":"Documentary","children":[{"name":"","size":1},{"name":"Documentary","size":1},{"name":"News","size":1},{"name":"War","size":2}]},{"name":"Drama","children":[{"name":"","size":22},{"name":"Fantasy","size":2},{"name":"History","size":1},{"name":"Horror","size":3},{"name":"Music","size":3},{"name":"Musical","size":2},{"name":"Mystery","size":33},{"name":"Romance","size":10},{"name":"Sport","size":1},{"name":"Thriller","size":44},{"name":"Western","size":2}]},{"name":"Horror","children":[{"name":"","size":1},{"name":"Mystery","size":4},{"name":"Thriller","size":3}]},{"name":"Mystery","children":[{"name":"Thriller","size":8}]},{"name":"Thriller","children":[{"name":"","size":10},{"name":"War","size":1}]}]},{"name":"Documentary","children":[{"name":"","children":[{"name":"","size":21}]},{"name":"Drama","children":[{"name":"","size":3},{"name":"History","size":1}]},{"name":"Family","children":[{"name":"Music","size":1}]},{"name":"History","children":[{"name":"","size":1},{"name":"Music","size":1},{"name":"Sport","size":1}]},{"name":"Music","children":[{"name":"","size":3}]},{"name":"Sport","children":[{"name":"","size":4}]},{"name":"War","children":[{"name":"","size":3}]}]},{"name":"Drama","children":[{"name":"","children":[{"name":"","size":96}]},{"name":"Family","children":[{"name":"","size":7},{"name":"Fantasy","size":2},{"name":"Music","size":2},{"name":"Romance","size":1},{"name":"Sport","size":3},{"name":"Western","size":1}]},{"name":"Fantasy","children":[{"name":"","size":2},{"name":"Horror","size":5},{"name":"Musical","size":1},{"name":"Mystery","size":3},{"name":"Romance","size":6},{"name":"Sci-Fi","size":1},{"name":"Sport","size":1},{"name":"Thriller","size":1},{"name":"War","size":1}]},{"name":"History","children":[{"name":"","size":9},{"name":"Music","size":1},{"name":"Romance","size":3},{"name":"War","size":15}]},{"name":"Horror","children":[{"name":"","size":2},{"name":"Mystery","size":11},{"name":"Romance","size":1},{"name":"Sci-Fi","size":9},{"name":"Thriller","size":4}]},{"name":"Music","children":[{"name":"","size":11},{"name":"Musical","size":2},{"name":"Mystery","size":2},{"name":"Romance","size":11}]},{"name":"Musical","children":[{"name":"","size":1},{"name":"Romance","size":6}]},{"name":"Mystery","children":[{"name":"","size":6},{"name":"Romance","size":11},{"name":"Sci-Fi","size":10},{"name":"Thriller","size":17}]},{"name":"Romance","children":[{"name":"","size":74},{"name":"Sci-Fi","size":4},{"name":"Sport","size":5},{"name":"Thriller","size":3},{"name":"War","size":3},{"name":"Western","size":3}]},{"name":"Sci-Fi","children":[{"name":"","size":1},{"name":"Thriller","size":5}]},{"name":"Sport","children":[{"name":"","size":14}]},{"name":"Thriller","children":[{"name":"","size":27},{"name":"War","size":2}]},{"name":"War","children":[{"name":"","size":7}]},{"name":"Western","children":[{"name":"","size":1}]}]},{"name":"Family","children":[{"name":"Music","children":[{"name":"Romance","size":1}]}]},{"name":"Fantasy","children":[{"name":"Horror","children":[{"name":"","size":2},{"name":"Mystery","size":2},{"name":"Thriller","size":1}]},{"name":"Mystery","children":[{"name":"Romance","size":1},{"name":"Thriller","size":1}]},{"name":"Thriller","children":[{"name":"","size":1}]}]},{"name":"Horror","children":[{"name":"","children":[{"name":"","size":31}]},{"name":"Musical","children":[{"name":"Sci-Fi","size":1}]},{"name":"Mystery","children":[{"name":"","size":14},{"name":"Sci-Fi","size":1},{"name":"Thriller","size":14}]},{"name":"Romance","children":[{"name":"Thriller","size":1}]},{"name":"Sci-Fi","children":[{"name":"","size":5}]},{"name":"Thriller","children":[{"name":"","size":21}]}]},{"name":"Mystery","children":[{"name":"Romance","children":[{"name":"Sci-Fi","size":1},{"name":"Thriller","size":1}]},{"name":"Sci-Fi","children":[{"name":"Thriller","size":3}]},{"name":"Thriller","children":[{"name":"","size":11}]}]},{"name":"Romance","children":[{"name":"","children":[{"name":"","size":2}]},{"name":"Short","children":[{"name":"","size":1}]}]},{"name":"Sci-Fi","children":[{"name":"Thriller","children":[{"name":"","size":3}]}]},{"name":"Thriller","children":[{"name":"","children":[{"name":"","size":7}]}]},{"name":"Western","children":[{"name":"","children":[{"name":"","size":2}]}]}]}
{"name":"2010","children":[{"name":"Action","children":[{"name":"","children":[{"name":"","size":6}]},{"name":"Adventure","children":[{"name":"","size":2},{"name":"Animation","size":10},{"name":"Biography","size":1},{"name":"Comedy","size":12},{"name":"Crime","size":2},{"name":"Drama","size":25},{"name":"Family","size":5},{"name":"Fantasy","size":18},{"name":"History","size":2},{"name":"Horror","size":3},{"name":"Mystery","size":3},{"name":"Romance","size":3},{"name":"Sci-Fi","size":36},{"name":"Thriller","size":9},{"name":"Western","size":2}]},{"name":"Animation","children":[{"name":"Comedy","size":5},{"name":"Crime","size":1},{"name":"Fantasy","size":1}]},{"name":"Biography","children":[{"name":"Crime","size":2},{"name":"Documentary","size":1},{"name":"Drama","size":8}]},{"name":"Comedy","children":[{"name":"","size":5},{"name":"Crime","size":23},{"name":"Drama","size":4},{"name":"Family","size":2},{"name":"Fantasy","size":3},{"name":"Horror","size":1},{"name":"Mystery","size":1},{"name":"Romance","size":6},{"name":"Sci-Fi","size":3},{"name":"Sport","size":1},{"name":"Thriller","size":1}]},{"name":"Crime","children":[{"name":"","size":2},{"name":"Drama","size":33},{"name":"Horror","size":1},{"name":"Mystery","size":6},{"name":"Romance","size":1},{"name":"Sci-Fi","size":2},{"name":"Sport","size":1},{"name":"Thriller","size":23}]},{"name":"Drama","children":[{"name":"","size":5},{"name":"Fantasy","size":5},{"name":"History","size":3},{"name":"Romance","size":1},{"name":"Sci-Fi","size":5},{"name":"Sport","size":2},{"name":"Thriller","size":12},{"name":"War","size":2},{"name":"Western","size":1}]},{"name":"Family","children":[{"name":"Family","size":1}]},{"name":"Fantasy","children":[{"name":"Fantasy","size":11}]},{"name":"Horror","children":[{"name":"","size":3},{"name":"Mystery","size":1},{"name":"Romance","size":1},{"name":"Sci-Fi","size":5},{"name":"Thriller","size":5}]},{"name":"Mystery","children":[{"name":"Sci-Fi","size":2},{"name":"Thriller","size":5}]},{"name":"Romance","children":[{"name":"Sport","size":1},{"name":"Thriller","size":2}]},{"name":"Sci-Fi","children":[{"name":"","size":4},{"name":"Thriller","size":7}]},{"name":"Thriller","children":[{"name":"","size":18}]}]},{"name":"Adventure","children":[{"name":"","children":[{"name":"","size":1}]},{"name":"Animation","children":[{"name":"","size":1},{"name":"Comedy","size":44},{"name":"Drama","size":1},{"name":"Family","size":10},{"name":"Fantasy","size":1},{"name":"Sci-Fi","size":1}]},{"name":"Biography","children":[{"name":"Documentary","size":1},{"name":"Drama","size":5}]},{"name":"Comedy","children":[{"name":"","size":3},{"name":"Crime","size":2},{"name":"Drama","size":6},{"name":"Family","size":6},{"name":"Fantasy","size":1},{"name":"Sci-Fi","size":1},{"name":"Western","size":1}]},{"name":"Crime","children":[{"name":"Drama","size":1},{"name":"Mystery","size":1}]},{"name":"Documentary","children":[{"name":"","size":1}]},{"name":"Drama","children":[{"name":"","size":2},{"name":"Family","size":2},{"name":"Fantasy","size":4},{"name":"History","size":1},{"name":"Horror","size":1},{"name":"Mystery","size":1},{"name":"Sci-Fi","size":5},{"name":"Thriller","size":3},{"name":"Western","size":2}]},{"name":"Family","children":[{"name":"","size":2},{"name":"Fantasy","size":14},{"name":"Sci-Fi","size":1}]},{"name":"Fantasy","children":[{"name":"","size":4},{"name":"Mystery","size":1}]},{"name":"Horror","children":[{"name":"","size":1}]},{"name":"Mystery","children":[{"name":"Sci-Fi","size":2}]},{"name":"Sci-Fi","children":[{"name":"","size":1},{"name":"Thriller","size":3}]}]},{"name":"Animation","children":[{"name":"","children":[{"name":"","size":2}]},{"name":"Comedy","children":[{"name":"Crime","size":1},{"name":"Drama","size":1},{"name":"Family","size":11}]},{"name":"Family","children":[{"name":"","size":2}]}]},{"name":"Biography","children":[{"name":"","children":[{"name":"","size":1}]},{"name":"Comedy","children":[{"name":"Crime","size":2},{"name":"Drama","size":8}]},{"name":"Crime","children":[{"name":"Documentary","size":1},{"name":"Drama","size":10}]},{"name":"Documentary","children":[{"name":"","size":1},{"name":"Drama","size":1},{"name":"Music","size":1}]},{"name":"Drama","children":[{"name":"","size":10},{"name":"Family","size":2},{"name":"History","size":13},{"name":"Music","size":5},{"name":"Romance","size":6},{"name":"Sport","size":11},{"name":"Thriller","size":7},{"name":"War","size":1}]}]},{"name":"Comedy","children":[{"name":"","children":[{"name":"","size":69}]},{"name":"Crime","children":[{"name":"","size":8},{"name":"Drama","size":13},{"name":"Romance","size":1},{"name":"Thriller","size":4}]},{"name":"Documentary","children":[{"name":"Documentary","size":3}]},{"name":"Drama","children":[{"name":"","size":60},{"name":"Family","size":5},{"name":"Fantasy","size":2},{"name":"Horror","size":2},{"name":"Music","size":5},{"name":"Musical ","size":3},{"name":"Mystery","size":1},{"name":"Romance","size":50}]},{"name":"Family","children":[{"name":"","size":9},{"name":"Fantasy","size":2},{"name":"Romance","size":3}]},{"name":"Fantasy","children":[{"name":"","size":5},{"name":"Horror","size":5},{"name":"Musical","size":1},{"name":"Romance","size":1},{"name":"Thriller","size":1}]},{"name":"Horror","children":[{"name":"","size":11},{"name":"Mystery","size":2},{"name":"Romance","size":2},{"name":"Sci-Fi","size":2},{"name":"Thriller","size":2}]},{"name":"Music","children":[{"name":"","size":3},{"name":"Romance","size":3}]},{"name":"Mystery","children":[{"name":"","size":1},{"name":"Thriller","size":1}]},{"name":"Romance","children":[{"name":"","size":40},{"name":"Sci-Fi","size":2},{"name":"Thriller","size":1}]},{"name":"Sci-Fi","children":[{"name":"","size":3}]},{"name":"Sport","children":[{"name":"","size":1}]},{"name":"Western","children":[{"name":"","size":3}]}]},{"name":"Crime","children":[{"name":"Documentary","children":[{"name":"","size":1}]},{"name":"Drama","children":[{"name":"","size":10},{"name":"History","size":1},{"name":"Horror","size":2},{"name":"Mystery","size":12},{"name":"Romance","size":4},{"name":"Thriller","size":33}]},{"name":"Horror","children":[{"name":"Music","size":1},{"name":"Thriller","size":1}]},{"name":"Mystery","children":[{"name":"Thriller","size":3}]},{"name":"Romance","children":[{"name":"Thriller","size":1}]},{"name":"Thriller","children":[{"name":"","size":4}]}]},{"name":"Documentary","children":[{"name":"","children":[{"name":"","size":26}]},{"name":"Drama","children":[{"name":"Sport","size":1}]},{"name":"Family","children":[{"name":"","size":1}]},{"name":"History","children":[{"name":"","size":1}]},{"name":"Music","children":[{"name":"","size":6}]},{"name":"News","children":[{"name":"","size":1}]},{"name":"Sport","children":[{"name":"","size":1}]},{"name":"War","children":[{"name":"","size":1}]}]},{"name":"Drama","children":[{"name":"","children":[{"name":"","size":74}]},{"name":"Family","children":[{"name":"","size":6},{"name":"Fantasy","size":1},{"name":"Music","size":3},{"name":"Romance","size":1},{"name":"Sport","size":1}]},{"name":"Fantasy","children":[{"name":"","size":4},{"name":"Horror","size":5},{"name":"Music","size":1},{"name":"Mystery","size":1},{"name":"Romance","size":5}]},{"name":"History","children":[{"name":"","size":5},{"name":"Romance","size":1},{"name":"War","size":4}]},{"name":"Horror","children":[{"name":"Mystery","size":15},{"name":"Sci-Fi","size":3},{"name":"Thriller","size":8}]},{"name":"Music","children":[{"name":"","size":12},{"name":"Musical","size":1},{"name":"Romance","size":3}]},{"name":"Musical","children":[{"name":"","size":2},{"name":"Romance","size":2},{"name":"Sci-Fi","size":1}]},{"name":"Mystery","children":[{"name":"","size":1},{"name":"Romance","size":4},{"name":"Sci-Fi","size":4},{"name":"Thriller","size":7},{"name":"War","size":1}]},{"name":"Romance","children":[{"name":"","size":36},{"name":"Sci-Fi","size":6},{"name":"Thriller","size":1},{"name":"War","size":2}]},{"name":"Sci-Fi","children":[{"name":"","size":4},{"name":"Thriller","size":6}]},{"name":"Sport","children":[{"name":"","size":6}]},{"name":"Thriller","children":[{"name":"","size":23},{"name":"War","size":1}]},{"name":"War","children":[{"name":"","size":7},{"name":"Western","size":1}]},{"name":"Western","children":[{"name":"","size":4}]}]},{"name":"Family","children":[{"name":"","children":[{"name":"","size":5}]},{"name":"Musical","children":[{"name":"","size":1}]},{"name":"Sci-Fi","children":[{"name":"","size":1}]}]},{"name":"Fantasy","children":[{"name":"","children":[{"name":"","size":2}]},{"name":"Horror","children":[{"name":"","size":3},{"name":"Mystery","size":6},{"name":"Thriller","size":4}]}]},{"name":"History","children":[{"name":"","children":[{"name":"","size":1}]}]},{"name":"Horror","children":[{"name":"","children":[{"name":"","size":26}]},{"name":"Musical","children":[{"name":"","size":1}]},{"name":"Mystery","children":[{"name":"","size":9},{"name":"Sci-Fi","size":2},{"name":"Thriller","size":12}]},{"name":"Sci-Fi","children":[{"name":"","size":7},{"name":"Short","size":1}]},{"name":"Thriller","children":[{"name":"","size":23}]}]},{"name":"Musical","children":[{"name":"","children":[{"name":"","size":2}]}]},{"name":"Mystery","children":[{"name":"Sci-Fi","children":[{"name":"Thriller","size":2}]},{"name":"Thriller","children":[{"name":"","size":6}]}]},{"name":"Romance","children":[{"name":"","children":[{"name":"","size":2}]},{"name":"Sci-Fi","children":[{"name":"Thriller","size":1}]}]},{"name":"Sci-Fi","children":[{"name":"","children":[{"name":"","size":1}]},{"name":"Thriller","children":[{"name":"","size":4}]}]},{"name":"Thriller","children":[{"name":"","children":[{"name":"","size":11}]}]},{"name":"Western","children":[{"name":"","children":[{"name":"","size":2}]}]}]}
var width = document.getElementById('vis').clientWidth;
var height = document.getElementById('vis').clientHeight;
var radius = (Math.min(width, height) / 2) - 10;
var data = {};
var x = d3.scaleLinear()
.range([0, 2 * Math.PI]);
var y = d3.scaleSqrt()
.range([0, radius]);
var partition = d3.partition();
var toPercent = d3.format("0.1%");
var colors = ["#5C86C4", "#656CCA", "#7A62C9", "#8F5DC7", "#AA56C5", "#D559B0", "#EA6292", "#FF6B6B", "#FF9B6B", "#FFB66B",
"#FFC86B", "#FFD76B", "#FFE66B", "#FFF46B", "#F1FC6A", "#D0F667", "#D0F667", "#5CDD5C", "#53C69D", "#53A6BE"
];
var arc = d3.arc()
.startAngle(function(d) {
return Math.max(0, Math.min(2 * Math.PI, x(d.x0)));
})
.endAngle(function(d) {
return Math.max(0, Math.min(2 * Math.PI, x(d.x1)));
})
.innerRadius(function(d) {
return Math.max(0, y(d.y0));
})
.outerRadius(function(d) {
return Math.max(0, y(d.y1));
});
var svg = d3.select("#chart")
.attr("preserveAspectRatio", "xMinYMin meet")
.attr("viewBox", "0 0 " + width + " " + height)
.append("g")
.attr("transform", "translate(" + width / 2 + "," + (height / 2) + ")");
var leg = d3.select("#legend");
var tips = d3.select('#tooltips');
d3.select("#togglelegend").on("click", toggleLegend);
d3.select("#toggletips").on("click", toggleTips);
d3.queue()
.defer(d3.json, "movies2010.json")
.defer(d3.json, "movies2000.json")
.defer(d3.json, "movies1990.json")
.defer(d3.json, "movies1980.json")
.defer(d3.json, "movies1970.json")
.defer(d3.json, "movies1960.json")
.defer(d3.json, "movies1950.json")
.defer(d3.json, "movies1940.json")
.defer(d3.json, "movies1930.json")
.await(function(error, d2010, d2000, d1990, d1980, d1970, d1960, d1950, d1940, d1930) {
data['1930'] = d1930;
data['1940'] = d1940;
data['1950'] = d1950;
data['1960'] = d1960;
data['1970'] = d1970;
data['1980'] = d1980;
data['1990'] = d1990;
data['2000'] = d2000;
data['2010'] = d2010
draw('2010')
drawLegend('2010');
});
var slider = d3.select('#decade');
slider.on('change', function() {
decadeSelected = this.value;
fadeOut()
setTimeout(function() {
svg.selectAll("path").remove()
leg.selectAll("svg").remove()
drawLegend(decadeSelected)
draw(decadeSelected);
}, 250)
setTimeout(function() {
fadeIn();
}, 250);
});
function draw(decade) {
var root = data[decade];
root = d3.hierarchy(root);
root.sum(function(d) {
return d.size;
});
var color = d3.scaleOrdinal(colors);
var sunburst = svg.selectAll("path")
.data(partition(root).descendants());
sunburst
.enter()
.append("path")
.attr("d", arc)
.style("fill", function(d) {
return color((d.children ? d : d.parent).data.name);
})
.style("opacity", function(d) {
if (d.data.name !== "") {
return 1;
} else {
return 0;
}
})
.on("click", click)
.append("title")
.text(function(d) {
return (d.data.name + ": " + toPercent(d.value / root.value));
});
};
function click(d) {
svg.transition()
.duration(750)
.tween("scale", function() {
var xd = d3.interpolate(x.domain(), [d.x0, d.x1]),
yd = d3.interpolate(y.domain(), [d.y0, 1]),
yr = d3.interpolate(y.range(), [d.y0 ? 20 : 0, radius]);
return function(t) {
x.domain(xd(t));
y.domain(yd(t)).range(yr(t));
};
})
.selectAll("path")
.attrTween("d", function(d) {
return function() {
return arc(d);
};
});
};
function drawLegend(decade) {
var root = data[decade];
var rootTotal = d3.hierarchy(root);
rootTotal.sum(function(d) {
return d.size;
});
var colorsLegend = colors.slice(1, colors.length);
var color = d3.scaleOrdinal(colorsLegend);
var li = {
w: 150,
h: 30,
s: 3,
r: 3
};
var legend = d3.select("#legend")
.append("svg:svg")
.attr("width", li.w)
.attr("height", root.children.length * (li.h + li.s));
var g = legend.selectAll("g")
.data(d3.values(root)[1])
.enter()
.append("svg:g")
.attr("transform", function(d, i) {
return "translate(0," + i * (li.h + li.s) + ")";
});
g.append("svg:rect")
.attr("rx", li.r)
.attr("ry", li.r)
.attr("width", li.w)
.attr("height", li.h)
.style("fill", function(d) {
return color(d.name);
})
g.append("svg:text")
.attr("x", li.w / 2)
.attr("y", li.h / 2)
.attr("dy", "0.3em")
.attr("text-anchor", "middle")
.text(function(d, i) {
return d.name + ": " + toPercent(rootTotal.children[i].value / rootTotal.value)
});
}
function toggleLegend() {
if (leg.style("opacity") == 0) {
leg.transition()
.style("opacity", 1);
} else {
leg.transition()
.style("opacity", 0);
}
}
function toggleTips() {
if (tips.style("opacity") == 0) {
tips.transition()
.style("opacity", 1);
} else {
tips.transition()
.style("opacity", 0);
}
}
function fadeOut() {
svg.transition()
.style("opacity", 0);
};
function fadeIn() {
svg.transition()
.style("opacity", 1);
};
d3.select(self.frameElement).style("height", height + "px");
html,body,#vis{display:block;margin:auto;height:90%}html{background-color:#FFDAE3}path{stroke:#FFDAE3}#title{display:block;font-size:1.6vw;font-family:sans-serif;text-align:center;color:#5C86C4}#tipsbar{float:right;padding:20px;margin-right:10vw;font-family:sans-serif;color:#5C86C4}#legendbar{position:absolute;padding:20px;font-family:sans-serif;color:#5C86C4}#legend{opacity:0}#tooltips{position:absolute;opacity:0}input[type=range]{-webkit-appearance:none;display:block;margin:auto;margin-top:30px;width:30%}input[type=range]::-webkit-slider-runnable-track{width:300px;height:5px;background:#a4bbde;border:none;border-radius:3px}input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;border:none;height:16px;width:16px;border-radius:50%;background:#5C86C4;margin-top:-4px}#selected_decade{display:block;text-align:center;margin-top:10px;margin-bottom:10px;font-size:2.5vw;font-family:sans-serif;color:#5C86C4}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment