D3
OG
Old school D3 from simpler times
All examples
By author
By category
About
dukevis
Full window
Github gist
autism streamgraph
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <link href="nv.d3.css" rel="stylesheet" type="text/css"> <script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.2/d3.min.js" charset="utf-8"></script> <script src="nv.d3.js"></script> <script src="colorbrewer.js"></script> <style> text { font: 12px sans-serif; } svg { display: block; } html, body, svg { margin: 0px; padding: 0px; height: 100%; width: 100%; } </style> </head> <!--body class='with-3d-shadow with-transitions'--> <body> <svg id="chart1"></svg> <script> var autism_data = "category,date,val\nASD,1946,0.0000000000000000000\nASD,1947,0.0000000000000000000\nASD,1951,0.0000000000000000000\nASD,1953,0.0000000000000000000\nASD,1954,0.0000000000000000000\nASD,1956,0.0000000000000000000\nASD,1957,0.0000000000000000000\nASD,1958,0.0000000000000000000\nASD,1959,0.0000000000000000000\nASD,1960,0.0000000000000000000\nASD,1961,0.0000000000000000000\nASD,1962,0.0000000000000000000\nASD,1963,0.0000000000000000000\nASD,1964,0.0000000000000000000\nASD,1965,0.0000000000000000000\nASD,1966,0.0000000000000000000\nASD,1967,0.0000000000000000000\nASD,1968,0.0000000000000000000\nASD,1969,0.0000000000000000000\nASD,1970,0.0000000000000000000\nASD,1971,0.0000000000000000000\nASD,1972,0.0000000000000000000\nASD,1973,0.0000000000000000000\nASD,1974,0.0000000000000000000\nASD,1975,0.0000000000000000000\nASD,1976,0.0000000000000000000\nASD,1977,0.0000000000000000000\nASD,1978,0.0000000000000000000\nASD,1979,0.0000000000000000000\nASD,1980,0.0000000000000000000\nASD,1981,0.0000000000000000000\nASD,1982,0.0000000000000000000\nASD,1983,0.0000000000000000000\nASD,1984,0.0000000000000000000\nASD,1985,0.0001526018617427130\nASD,1986,0.0000000000000000000\nASD,1987,0.0000000000000000000\nASD,1988,0.0001242544731610340\nASD,1989,0.0000000000000000000\nASD,1990,0.0000000000000000000\nASD,1991,0.0000000000000000000\nASD,1992,0.0000000000000000000\nASD,1993,0.0000000000000000000\nASD,1994,0.0000000000000000000\nASD,1995,0.0000000000000000000\nASD,1996,0.0000000000000000000\nASD,1997,0.0000000000000000000\nASD,1998,0.0000000000000000000\nASD,1999,0.0000000000000000000\nASD,2000,0.0000000000000000000\nASD,2001,0.0000000000000000000\nASD,2002,0.0000687474219716761\nASD,2003,0.0001258099012392280\nASD,2004,0.0001156938740093710\nASD,2005,0.0000550478916657492\nASD,2006,0.0002989238740534080\nASD,2007,0.0001894118761246330\nASD,2008,0.0007606263982102910\nASD,2009,0.0006533954785032890\nASD,2010,0.0010795100685073700\nASD,2011,0.0012369324076290800\nASD,2012,0.0013848860276228600\nASD,2013,0.0022552454593049000\nASD,2014,0.0012914334911752000\nASDs,1946,0.0000000000000000000\nASDs,1947,0.0000000000000000000\nASDs,1951,0.0000000000000000000\nASDs,1953,0.0000000000000000000\nASDs,1954,0.0000000000000000000\nASDs,1956,0.0000000000000000000\nASDs,1957,0.0000000000000000000\nASDs,1958,0.0000000000000000000\nASDs,1959,0.0000000000000000000\nASDs,1960,0.0000000000000000000\nASDs,1961,0.0000000000000000000\nASDs,1962,0.0000000000000000000\nASDs,1963,0.0000000000000000000\nASDs,1964,0.0000000000000000000\nASDs,1965,0.0000000000000000000\nASDs,1966,0.0000000000000000000\nASDs,1967,0.0000000000000000000\nASDs,1968,0.0000000000000000000\nASDs,1969,0.0000000000000000000\nASDs,1970,0.0000000000000000000\nASDs,1971,0.0000000000000000000\nASDs,1972,0.0000000000000000000\nASDs,1973,0.0000000000000000000\nASDs,1974,0.0000000000000000000\nASDs,1975,0.0000000000000000000\nASDs,1976,0.0000000000000000000\nASDs,1977,0.0000000000000000000\nASDs,1978,0.0000000000000000000\nASDs,1979,0.0000000000000000000\nASDs,1980,0.0000000000000000000\nASDs,1981,0.0000000000000000000\nASDs,1982,0.0000000000000000000\nASDs,1983,0.0000000000000000000\nASDs,1984,0.0000000000000000000\nASDs,1985,0.0000000000000000000\nASDs,1986,0.0000000000000000000\nASDs,1987,0.0000000000000000000\nASDs,1988,0.0000000000000000000\nASDs,1989,0.0000000000000000000\nASDs,1990,0.0000000000000000000\nASDs,1991,0.0000000000000000000\nASDs,1992,0.0000000000000000000\nASDs,1993,0.0000000000000000000\nASDs,1994,0.0000000000000000000\nASDs,1995,0.0000000000000000000\nASDs,1996,0.0000000000000000000\nASDs,1997,0.0000000000000000000\nASDs,1998,0.0000000000000000000\nASDs,1999,0.0000000000000000000\nASDs,2000,0.0000000000000000000\nASDs,2001,0.0000000000000000000\nASDs,2002,0.0000000000000000000\nASDs,2003,0.0000000000000000000\nASDs,2004,0.0000000000000000000\nASDs,2005,0.0000000000000000000\nASDs,2006,0.0000000000000000000\nASDs,2007,0.0000000000000000000\nASDs,2008,0.0000447427293064877\nASDs,2009,0.0000871193971337718\nASDs,2010,0.0001245588540585430\nASDs,2011,0.0000399010454073897\nASDs,2012,0.0000374293520979152\nASDs,2013,0.0000402722403447304\nASDs,2014,0.0004304778303917350\nasperger syndrome,1946,0.0000000000000000000\nasperger syndrome,1947,0.0000000000000000000\nasperger syndrome,1951,0.0000000000000000000\nasperger syndrome,1953,0.0000000000000000000\nasperger syndrome,1954,0.0000000000000000000\nasperger syndrome,1956,0.0000000000000000000\nasperger syndrome,1957,0.0000000000000000000\nasperger syndrome,1958,0.0000000000000000000\nasperger syndrome,1959,0.0000000000000000000\nasperger syndrome,1960,0.0000000000000000000\nasperger syndrome,1961,0.0000000000000000000\nasperger syndrome,1962,0.0000000000000000000\nasperger syndrome,1963,0.0000000000000000000\nasperger syndrome,1964,0.0000000000000000000\nasperger syndrome,1965,0.0000000000000000000\nasperger syndrome,1966,0.0000000000000000000\nasperger syndrome,1967,0.0000000000000000000\nasperger syndrome,1968,0.0000000000000000000\nasperger syndrome,1969,0.0000000000000000000\nasperger syndrome,1970,0.0000000000000000000\nasperger syndrome,1971,0.0000000000000000000\nasperger syndrome,1972,0.0000000000000000000\nasperger syndrome,1973,0.0000000000000000000\nasperger syndrome,1974,0.0000000000000000000\nasperger syndrome,1975,0.0000000000000000000\nasperger syndrome,1976,0.0000000000000000000\nasperger syndrome,1977,0.0000000000000000000\nasperger syndrome,1978,0.0000000000000000000\nasperger syndrome,1979,0.0000000000000000000\nasperger syndrome,1980,0.0000000000000000000\nasperger syndrome,1981,0.0000000000000000000\nasperger syndrome,1982,0.0000000000000000000\nasperger syndrome,1983,0.0000000000000000000\nasperger syndrome,1984,0.0000000000000000000\nasperger syndrome,1985,0.0000000000000000000\nasperger syndrome,1986,0.0000000000000000000\nasperger syndrome,1987,0.0001354279523293610\nasperger syndrome,1988,0.0000000000000000000\nasperger syndrome,1989,0.0002351005054660870\nasperger syndrome,1990,0.0001143118427069040\nasperger syndrome,1991,0.0003450258769407710\nasperger syndrome,1992,0.0003334815473543800\nasperger syndrome,1993,0.0002192501644376230\nasperger syndrome,1994,0.0004067934506254450\nasperger syndrome,1995,0.0007147232999795790\nasperger syndrome,1996,0.0005630630630630630\nasperger syndrome,1997,0.0008787346221441120\nasperger syndrome,1998,0.0005188516084399860\nasperger syndrome,1999,0.0010616578195181700\nasperger syndrome,2000,0.0008429764732929730\nasperger syndrome,2001,0.0010894037330234600\nasperger syndrome,2002,0.0017186855492919000\nasperger syndrome,2003,0.0015726237654903400\nasperger syndrome,2004,0.0013883264881124500\nasperger syndrome,2005,0.0019266762083012200\nasperger syndrome,2006,0.0018433638899960100\nasperger syndrome,2007,0.0022255895444644400\nasperger syndrome,2008,0.0016554809843400400\nasperger syndrome,2009,0.0012632312584396900\nasperger syndrome,2010,0.0014947062487025100\nasperger syndrome,2011,0.0011571303168143000\nasperger syndrome,2012,0.0010105925066437100\nasperger syndrome,2013,0.0010068060086182600\nasperger syndrome,2014,0.0000000000000000000\nasperger's,1946,0.0000000000000000000\nasperger's,1947,0.0000000000000000000\nasperger's,1951,0.0000000000000000000\nasperger's,1953,0.0000000000000000000\nasperger's,1954,0.0000000000000000000\nasperger's,1956,0.0000000000000000000\nasperger's,1957,0.0000000000000000000\nasperger's,1958,0.0000000000000000000\nasperger's,1959,0.0000000000000000000\nasperger's,1960,0.0000000000000000000\nasperger's,1961,0.0000000000000000000\nasperger's,1962,0.0000000000000000000\nasperger's,1963,0.0000000000000000000\nasperger's,1964,0.0000000000000000000\nasperger's,1965,0.0000000000000000000\nasperger's,1966,0.0000000000000000000\nasperger's,1967,0.0000000000000000000\nasperger's,1968,0.0000000000000000000\nasperger's,1969,0.0000000000000000000\nasperger's,1970,0.0000000000000000000\nasperger's,1971,0.0000000000000000000\nasperger's,1972,0.0000000000000000000\nasperger's,1973,0.0000000000000000000\nasperger's,1974,0.0000000000000000000\nasperger's,1975,0.0000000000000000000\nasperger's,1976,0.0000000000000000000\nasperger's,1977,0.0000000000000000000\nasperger's,1978,0.0000000000000000000\nasperger's,1979,0.0000000000000000000\nasperger's,1980,0.0000000000000000000\nasperger's,1981,0.0000000000000000000\nasperger's,1982,0.0000000000000000000\nasperger's,1983,0.0000000000000000000\nasperger's,1984,0.0000000000000000000\nasperger's,1985,0.0000000000000000000\nasperger's,1986,0.0000000000000000000\nasperger's,1987,0.0001354279523293610\nasperger's,1988,0.0000000000000000000\nasperger's,1989,0.0000000000000000000\nasperger's,1990,0.0000000000000000000\nasperger's,1991,0.0001150086256469240\nasperger's,1992,0.0000000000000000000\nasperger's,1993,0.0001096250822188120\nasperger's,1994,0.0001016983626563610\nasperger's,1995,0.0000000000000000000\nasperger's,1996,0.0000938438438438438\nasperger's,1997,0.0000000000000000000\nasperger's,1998,0.0000000000000000000\nasperger's,1999,0.0000000000000000000\nasperger's,2000,0.0000000000000000000\nasperger's,2001,0.0000000000000000000\nasperger's,2002,0.0000000000000000000\nasperger's,2003,0.0000000000000000000\nasperger's,2004,0.0000578469370046856\nasperger's,2005,0.0000000000000000000\nasperger's,2006,0.0000498206456755680\nasperger's,2007,0.0000947059380623165\nasperger's,2008,0.0000447427293064877\nasperger's,2009,0.0000000000000000000\nasperger's,2010,0.0000415196180195142\nasperger's,2011,0.0000000000000000000\nasperger's,2012,0.0000000000000000000\nasperger's,2013,0.0000805444806894607\nasperger's,2014,0.0000000000000000000\nasperger's disorder,1946,0.0000000000000000000\nasperger's disorder,1947,0.0000000000000000000\nasperger's disorder,1951,0.0000000000000000000\nasperger's disorder,1953,0.0000000000000000000\nasperger's disorder,1954,0.0000000000000000000\nasperger's disorder,1956,0.0000000000000000000\nasperger's disorder,1957,0.0000000000000000000\nasperger's disorder,1958,0.0000000000000000000\nasperger's disorder,1959,0.0000000000000000000\nasperger's disorder,1960,0.0000000000000000000\nasperger's disorder,1961,0.0000000000000000000\nasperger's disorder,1962,0.0000000000000000000\nasperger's disorder,1963,0.0000000000000000000\nasperger's disorder,1964,0.0000000000000000000\nasperger's disorder,1965,0.0000000000000000000\nasperger's disorder,1966,0.0000000000000000000\nasperger's disorder,1967,0.0000000000000000000\nasperger's disorder,1968,0.0000000000000000000\nasperger's disorder,1969,0.0000000000000000000\nasperger's disorder,1970,0.0000000000000000000\nasperger's disorder,1971,0.0000000000000000000\nasperger's disorder,1972,0.0000000000000000000\nasperger's disorder,1973,0.0000000000000000000\nasperger's disorder,1974,0.0000000000000000000\nasperger's disorder,1975,0.0000000000000000000\nasperger's disorder,1976,0.0000000000000000000\nasperger's disorder,1977,0.0000000000000000000\nasperger's disorder,1978,0.0000000000000000000\nasperger's disorder,1979,0.0000000000000000000\nasperger's disorder,1980,0.0000000000000000000\nasperger's disorder,1981,0.0000000000000000000\nasperger's disorder,1982,0.0000000000000000000\nasperger's disorder,1983,0.0000000000000000000\nasperger's disorder,1984,0.0000000000000000000\nasperger's disorder,1985,0.0000000000000000000\nasperger's disorder,1986,0.0000000000000000000\nasperger's disorder,1987,0.0000000000000000000\nasperger's disorder,1988,0.0000000000000000000\nasperger's disorder,1989,0.0000000000000000000\nasperger's disorder,1990,0.0001143118427069040\nasperger's disorder,1991,0.0000000000000000000\nasperger's disorder,1992,0.0000000000000000000\nasperger's disorder,1993,0.0001096250822188120\nasperger's disorder,1994,0.0000000000000000000\nasperger's disorder,1995,0.0000000000000000000\nasperger's disorder,1996,0.0001876876876876880\nasperger's disorder,1997,0.0002636203866432340\nasperger's disorder,1998,0.0003459010722933240\nasperger's disorder,1999,0.0004083299305839120\nasperger's disorder,2000,0.0002299026745344470\nasperger's disorder,2001,0.0004357614932093830\nasperger's disorder,2002,0.0005499793757734090\nasperger's disorder,2003,0.0002516198024784550\nasperger's disorder,2004,0.0003470816220281140\nasperger's disorder,2005,0.0004954310249917430\nasperger's disorder,2006,0.0006476683937823830\nasperger's disorder,2007,0.0007102945354673740\nasperger's disorder,2008,0.0004474272930648770\nasperger's disorder,2009,0.0004791566842357450\nasperger's disorder,2010,0.0003321569441561140\nasperger's disorder,2011,0.0004788125448886760\nasperger's disorder,2012,0.0003368641688812370\nasperger's disorder,2013,0.0002013612017236520\nasperger's disorder,2014,0.0000000000000000000\nasperger's syndrome,1946,0.0000000000000000000\nasperger's syndrome,1947,0.0000000000000000000\nasperger's syndrome,1951,0.0000000000000000000\nasperger's syndrome,1953,0.0000000000000000000\nasperger's syndrome,1954,0.0000000000000000000\nasperger's syndrome,1956,0.0000000000000000000\nasperger's syndrome,1957,0.0000000000000000000\nasperger's syndrome,1958,0.0000000000000000000\nasperger's syndrome,1959,0.0000000000000000000\nasperger's syndrome,1960,0.0000000000000000000\nasperger's syndrome,1961,0.0000000000000000000\nasperger's syndrome,1962,0.0000000000000000000\nasperger's syndrome,1963,0.0000000000000000000\nasperger's syndrome,1964,0.0000000000000000000\nasperger's syndrome,1965,0.0000000000000000000\nasperger's syndrome,1966,0.0000000000000000000\nasperger's syndrome,1967,0.0000000000000000000\nasperger's syndrome,1968,0.0000000000000000000\nasperger's syndrome,1969,0.0000000000000000000\nasperger's syndrome,1970,0.0000000000000000000\nasperger's syndrome,1971,0.0000000000000000000\nasperger's syndrome,1972,0.0000000000000000000\nasperger's syndrome,1973,0.0000000000000000000\nasperger's syndrome,1974,0.0000000000000000000\nasperger's syndrome,1975,0.0000000000000000000\nasperger's syndrome,1976,0.0000000000000000000\nasperger's syndrome,1977,0.0000000000000000000\nasperger's syndrome,1978,0.0000000000000000000\nasperger's syndrome,1979,0.0000000000000000000\nasperger's syndrome,1980,0.0000000000000000000\nasperger's syndrome,1981,0.0001962323390894820\nasperger's syndrome,1982,0.0000000000000000000\nasperger's syndrome,1983,0.0001743071291615830\nasperger's syndrome,1984,0.0000000000000000000\nasperger's syndrome,1985,0.0006104074469708530\nasperger's syndrome,1986,0.0004128819157720890\nasperger's syndrome,1987,0.0005417118093174430\nasperger's syndrome,1988,0.0006212723658051690\nasperger's syndrome,1989,0.0003526507581991300\nasperger's syndrome,1990,0.0011431184270690400\nasperger's syndrome,1991,0.0005750431282346180\nasperger's syndrome,1992,0.0004446420631391730\nasperger's syndrome,1993,0.0005481254110940580\nasperger's syndrome,1994,0.0004067934506254450\nasperger's syndrome,1995,0.0006126199714110680\nasperger's syndrome,1996,0.0003753753753753750\nasperger's syndrome,1997,0.0001757469244288230\nasperger's syndrome,1998,0.0001729505361466620\nasperger's syndrome,1999,0.0002449979583503470\nasperger's syndrome,2000,0.0009196106981377880\nasperger's syndrome,2001,0.0003631345776744860\nasperger's syndrome,2002,0.0008249690636601130\nasperger's syndrome,2003,0.0007548594074353650\nasperger's syndrome,2004,0.0010412448660843400\nasperger's syndrome,2005,0.0005504789166574920\nasperger's syndrome,2006,0.0004982064567556800\nasperger's syndrome,2007,0.0010891182877166400\nasperger's syndrome,2008,0.0004921700223713650\nasperger's syndrome,2009,0.0006098357799364030\nasperger's syndrome,2010,0.0003736765621756280\nasperger's syndrome,2011,0.0005985156811108450\nasperger's syndrome,2012,0.0004865815772728970\nasperger's syndrome,2013,0.0005235391244814950\nasperger's syndrome,2014,0.0000000000000000000\nautism,1946,0.0000000000000000000\nautism,1947,0.0000000000000000000\nautism,1951,0.0000000000000000000\nautism,1953,0.0010460251046025100\nautism,1954,0.0000000000000000000\nautism,1956,0.0000000000000000000\nautism,1957,0.0009259259259259260\nautism,1958,0.0009191176470588240\nautism,1959,0.0016313213703099500\nautism,1960,0.0000000000000000000\nautism,1961,0.0007739938080495360\nautism,1962,0.0007315288953913680\nautism,1963,0.0032626427406199000\nautism,1964,0.0023084025854109000\nautism,1965,0.0004432624113475180\nautism,1966,0.0016715419974926900\nautism,1967,0.0011398176291793300\nautism,1968,0.0020401224073444400\nautism,1969,0.0026507620941020500\nautism,1970,0.0051948051948051900\nautism,1971,0.0042143287176399800\nautism,1972,0.0032525133057362500\nautism,1973,0.0034374104841019800\nautism,1974,0.0033491487580240000\nautism,1975,0.0024979184013322200\nautism,1976,0.0037323380431884800\nautism,1977,0.0033358994098024100\nautism,1978,0.0051495831289848000\nautism,1979,0.0045034902049088000\nautism,1980,0.0048118985126859100\nautism,1981,0.0037284144427001600\nautism,1982,0.0051612903225806500\nautism,1983,0.0036604497123932400\nautism,1984,0.0041179377367814200\nautism,1985,0.0050358614375095400\nautism,1986,0.0056427195155518900\nautism,1987,0.0060942578548212400\nautism,1988,0.0078280318091451300\nautism,1989,0.0072881156694486900\nautism,1990,0.0064014631915866500\nautism,1991,0.0093156986774008000\nautism,1992,0.0107825700311249000\nautism,1993,0.0095373821530366200\nautism,1994,0.0083392657378216200\nautism,1995,0.0089850929140290000\nautism,1996,0.0109797297297297000\nautism,1997,0.0107205623901582000\nautism,1998,0.0140089934278796000\nautism,1999,0.0120048999591670000\nautism,2000,0.0149436738447391000\nautism,2001,0.0202629094342363000\nautism,2002,0.0221366698748797000\nautism,2003,0.0200666792476568000\nautism,2004,0.0219239891247758000\nautism,2005,0.0226246834746229000\nautism,2006,0.0260063770426465000\nautism,2007,0.0310161947154087000\nautism,2008,0.0362863534675615000\nautism,2009,0.0357625125234133000\nautism,2010,0.0389038820842848000\nautism,2011,0.0420158008139813000\nautism,2012,0.0471984129954710000\nautism,2013,0.0483669606540212000\nautism,2014,0.0469220835126991000\nautistic,1946,0.0000000000000000000\nautistic,1947,0.0049751243781094500\nautistic,1951,0.0011792452830188700\nautistic,1953,0.0020920502092050200\nautistic,1954,0.0000000000000000000\nautistic,1956,0.0000000000000000000\nautistic,1957,0.0009259259259259260\nautistic,1958,0.0009191176470588240\nautistic,1959,0.0008156606851549760\nautistic,1960,0.0007776049766718510\nautistic,1961,0.0054179566563467500\nautistic,1962,0.0021945866861741000\nautistic,1963,0.0032626427406199000\nautistic,1964,0.0050784856879039700\nautistic,1965,0.0062056737588652500\nautistic,1966,0.0058503969912244000\nautistic,1967,0.0068389057750759900\nautistic,1968,0.0088405304318259100\nautistic,1969,0.0076209410205434100\nautistic,1970,0.0107142857142857000\nautistic,1971,0.0087296809151113800\nautistic,1972,0.0059136605558840900\nautistic,1973,0.0063019192208536200\nautistic,1974,0.0086519676248953400\nautistic,1975,0.0102692200943658000\nautistic,1976,0.0090642495334577400\nautistic,1977,0.0130869899923018000\nautistic,1978,0.0129965669445807000\nautistic,1979,0.0108083764917811000\nautistic,1980,0.0115923009623797000\nautistic,1981,0.0090266875981161700\nautistic,1982,0.0082949308755760400\nautistic,1983,0.0099355063622102200\nautistic,1984,0.0107066381156317000\nautistic,1985,0.0076300930871356600\nautistic,1986,0.0061932287365813400\nautistic,1987,0.0102925243770314000\nautistic,1988,0.0082007952286282300\nautistic,1989,0.0083460679440460800\nautistic,1990,0.0069730224051211700\nautistic,1991,0.0056354226566992500\nautistic,1992,0.0050022232103157000\nautistic,1993,0.0051523788642841500\nautistic,1994,0.0036611410556290000\nautistic,1995,0.0034715131713293900\nautistic,1996,0.0030030030030030000\nautistic,1997,0.0029876977152899800\nautistic,1998,0.0023348322379799400\nautistic,1999,0.0026949775418538200\nautistic,2000,0.0018392213962755800\nautistic,2001,0.0031229573680005800\nautistic,2002,0.0028186443008387200\nautistic,2003,0.0022645782223061000\nautistic,2004,0.0024874182912014800\nautistic,2005,0.0026422987999559600\nautistic,2006,0.0030390593862096500\nautistic,2007,0.0025570603276825500\nautistic,2008,0.0030872483221476500\nautistic,2009,0.0037461340767521900\nautistic,2010,0.0036537263857172500\nautistic,2011,0.0036708961774798500\nautistic,2012,0.0026574839989519800\nautistic,2013,0.0035036849099915400\nautistic,2014,0.0021523891519586700\nautistic disorder,1946,0.0000000000000000000\nautistic disorder,1947,0.0000000000000000000\nautistic disorder,1951,0.0011792452830188700\nautistic disorder,1953,0.0000000000000000000\nautistic disorder,1954,0.0000000000000000000\nautistic disorder,1956,0.0000000000000000000\nautistic disorder,1957,0.0009259259259259260\nautistic disorder,1958,0.0000000000000000000\nautistic disorder,1959,0.0000000000000000000\nautistic disorder,1960,0.0000000000000000000\nautistic disorder,1961,0.0000000000000000000\nautistic disorder,1962,0.0000000000000000000\nautistic disorder,1963,0.0000000000000000000\nautistic disorder,1964,0.0000000000000000000\nautistic disorder,1965,0.0000000000000000000\nautistic disorder,1966,0.0000000000000000000\nautistic disorder,1967,0.0000000000000000000\nautistic disorder,1968,0.0000000000000000000\nautistic disorder,1969,0.0000000000000000000\nautistic disorder,1970,0.0000000000000000000\nautistic disorder,1971,0.0000000000000000000\nautistic disorder,1972,0.0000000000000000000\nautistic disorder,1973,0.0002864508736751650\nautistic disorder,1974,0.0000000000000000000\nautistic disorder,1975,0.0000000000000000000\nautistic disorder,1976,0.0000000000000000000\nautistic disorder,1977,0.0000000000000000000\nautistic disorder,1978,0.0000000000000000000\nautistic disorder,1979,0.0000000000000000000\nautistic disorder,1980,0.0000000000000000000\nautistic disorder,1981,0.0000000000000000000\nautistic disorder,1982,0.0000000000000000000\nautistic disorder,1983,0.0000000000000000000\nautistic disorder,1984,0.0000000000000000000\nautistic disorder,1985,0.0001526018617427130\nautistic disorder,1986,0.0001376273052573630\nautistic disorder,1987,0.0001354279523293610\nautistic disorder,1988,0.0002485089463220680\nautistic disorder,1989,0.0005877512636652170\nautistic disorder,1990,0.0005715592135345220\nautistic disorder,1991,0.0011500862564692400\nautistic disorder,1992,0.0010004446420631400\nautistic disorder,1993,0.0008770006577504930\nautistic disorder,1994,0.0010169836265636100\nautistic disorder,1995,0.0007147232999795790\nautistic disorder,1996,0.0013138138138138100\nautistic disorder,1997,0.0013181019332161700\nautistic disorder,1998,0.0012971290210999700\nautistic disorder,1999,0.0021233156390363400\nautistic disorder,2000,0.0029887347689478100\nautistic disorder,2001,0.0026145689592563000\nautistic disorder,2002,0.0026124020349236900\nautistic disorder,2003,0.0030194376297414600\nautistic disorder,2004,0.0032972754092670800\nautistic disorder,2005,0.0033028734999449500\nautistic disorder,2006,0.0032881626145874800\nautistic disorder,2007,0.0029358840799318100\nautistic disorder,2008,0.0019686800894854600\nautistic disorder,2009,0.0023086640240449500\nautistic disorder,2010,0.0022835789910732800\nautistic disorder,2011,0.0019551512249620900\nautistic disorder,2012,0.0020211850132874200\nautistic disorder,2013,0.0016914340944786800\nautistic disorder,2014,0.0012914334911752000\nHFA,1946,0.0000000000000000000\nHFA,1947,0.0000000000000000000\nHFA,1951,0.0000000000000000000\nHFA,1953,0.0000000000000000000\nHFA,1954,0.0000000000000000000\nHFA,1956,0.0000000000000000000\nHFA,1957,0.0000000000000000000\nHFA,1958,0.0000000000000000000\nHFA,1959,0.0000000000000000000\nHFA,1960,0.0000000000000000000\nHFA,1961,0.0000000000000000000\nHFA,1962,0.0000000000000000000\nHFA,1963,0.0000000000000000000\nHFA,1964,0.0000000000000000000\nHFA,1965,0.0000000000000000000\nHFA,1966,0.0000000000000000000\nHFA,1967,0.0000000000000000000\nHFA,1968,0.0000000000000000000\nHFA,1969,0.0000000000000000000\nHFA,1970,0.0000000000000000000\nHFA,1971,0.0000000000000000000\nHFA,1972,0.0000000000000000000\nHFA,1973,0.0000000000000000000\nHFA,1974,0.0000000000000000000\nHFA,1975,0.0000000000000000000\nHFA,1976,0.0000000000000000000\nHFA,1977,0.0000000000000000000\nHFA,1978,0.0000000000000000000\nHFA,1979,0.0000000000000000000\nHFA,1980,0.0000000000000000000\nHFA,1981,0.0000000000000000000\nHFA,1982,0.0000000000000000000\nHFA,1983,0.0000000000000000000\nHFA,1984,0.0000000000000000000\nHFA,1985,0.0000000000000000000\nHFA,1986,0.0000000000000000000\nHFA,1987,0.0000000000000000000\nHFA,1988,0.0000000000000000000\nHFA,1989,0.0000000000000000000\nHFA,1990,0.0000000000000000000\nHFA,1991,0.0000000000000000000\nHFA,1992,0.0000000000000000000\nHFA,1993,0.0000000000000000000\nHFA,1994,0.0000000000000000000\nHFA,1995,0.0000000000000000000\nHFA,1996,0.0000000000000000000\nHFA,1997,0.0000000000000000000\nHFA,1998,0.0000864752680733310\nHFA,1999,0.0000000000000000000\nHFA,2000,0.0000000000000000000\nHFA,2001,0.0000000000000000000\nHFA,2002,0.0000000000000000000\nHFA,2003,0.0000000000000000000\nHFA,2004,0.0000000000000000000\nHFA,2005,0.0000550478916657492\nHFA,2006,0.0000000000000000000\nHFA,2007,0.0000473529690311583\nHFA,2008,0.0000894854586129754\nHFA,2009,0.0000000000000000000\nHFA,2010,0.0000415196180195142\nHFA,2011,0.0000000000000000000\nHFA,2012,0.0000000000000000000\nHFA,2013,0.0000000000000000000\nHFA,2014,0.0000000000000000000\ninfantile autism,1946,0.0053475935828877000\ninfantile autism,1947,0.0000000000000000000\ninfantile autism,1951,0.0011792452830188700\ninfantile autism,1953,0.0000000000000000000\ninfantile autism,1954,0.0010183299389002000\ninfantile autism,1956,0.0009920634920634920\ninfantile autism,1957,0.0000000000000000000\ninfantile autism,1958,0.0009191176470588240\ninfantile autism,1959,0.0000000000000000000\ninfantile autism,1960,0.0023328149300155500\ninfantile autism,1961,0.0000000000000000000\ninfantile autism,1962,0.0014630577907827400\ninfantile autism,1963,0.0016313213703099500\ninfantile autism,1964,0.0018467220683287200\ninfantile autism,1965,0.0017730496453900700\ninfantile autism,1966,0.0012536564981195200\ninfantile autism,1967,0.0000000000000000000\ninfantile autism,1968,0.0034002040122407300\ninfantile autism,1969,0.0026507620941020500\ninfantile autism,1970,0.0025974025974026000\ninfantile autism,1971,0.0039133052378085500\ninfantile autism,1972,0.0035481963335304600\ninfantile autism,1973,0.0037238613577771400\ninfantile autism,1974,0.0025118615685180000\ninfantile autism,1975,0.0047182903136275300\ninfantile autism,1976,0.0034657424686750200\ninfantile autism,1977,0.0025660764690787800\ninfantile autism,1978,0.0034330554193232000\ninfantile autism,1979,0.0031524431434361600\ninfantile autism,1980,0.0013123359580052500\ninfantile autism,1981,0.0027472527472527500\ninfantile autism,1982,0.0035023041474654400\ninfantile autism,1983,0.0034861425832316500\ninfantile autism,1984,0.0034590676988963900\ninfantile autism,1985,0.0032046390965969800\ninfantile autism,1986,0.0034406826314340800\ninfantile autism,1987,0.0023022751895991300\ninfantile autism,1988,0.0022365805168986100\ninfantile autism,1989,0.0022334548019278200\ninfantile autism,1990,0.0008001828989483310\ninfantile autism,1991,0.0014951121334100100\ninfantile autism,1992,0.0017785682525566900\ninfantile autism,1993,0.0013155009866257400\ninfantile autism,1994,0.0011186819892199700\ninfantile autism,1995,0.0011231366142536200\ninfantile autism,1996,0.0006569069069069070\ninfantile autism,1997,0.0004393673110720560\ninfantile autism,1998,0.0003459010722933240\ninfantile autism,1999,0.0008166598611678240\ninfantile autism,2000,0.0004598053490688940\ninfantile autism,2001,0.0004357614932093830\ninfantile autism,2002,0.0005499793757734090\ninfantile autism,2003,0.0000629049506196138\ninfantile autism,2004,0.0001156938740093710\ninfantile autism,2005,0.0001651436749972480\ninfantile autism,2006,0.0003487445197289760\ninfantile autism,2007,0.0002367648451557910\ninfantile autism,2008,0.0002237136465324380\ninfantile autism,2009,0.0002177984928344300\ninfantile autism,2010,0.0000415196180195142\ninfantile autism,2011,0.0000798020908147793\ninfantile autism,2012,0.0001122880562937460\ninfantile autism,2013,0.0001208167210341910\ninfantile autism,2014,0.0000000000000000000" var new_string_data = d3.csv.parse(autism_data) console.log(new_string_data) var exampleData = [ ]; // populate the empty object with your data new_string_data.forEach(function (d){ //new_string_data.forEach(function (d){ d.date = +d.date d.val = +d.val var pushed = false; var cat; for (cat in exampleData) { if(exampleData[cat].key == d.category) { //console.log(exampleData) exampleData[cat].values.push([d.date, d.val]) pushed = true; } } if(!pushed) { exampleData.push({key: d.category, values: [[d.date, d.val]]}) } //console.log(d.category) }) console.log(exampleData) //var colors = ["#BE6528", "#D39163", "#054C38", "#1D6D54", "#468E76", "#84BFA9"]; //var colors = d3.scale.category20(); var autism_colors = colorbrewer.Purples[8].slice(1) var asperber_colors = colorbrewer.Greys[6].slice(1,5) var colors = [autism_colors[2], autism_colors[0], asperber_colors[0], asperber_colors[1], asperber_colors[2], asperber_colors[3], autism_colors[5], autism_colors[4], autism_colors[3], autism_colors[1], autism_colors[6]] var chart; nv.addGraph(function() { chart = nv.models.stackedAreaChart() .useInteractiveGuideline(true) .x(function(d) { console.log(d[0]); return d[0] }) .y(function(d) { console.log(d[1]); return d[1] }) //.controlLabels({stacked: "Stacked"}) .color(colors) .showControls(false) .style('stream-center') //.style('stream') .duration(300); //chart.xAxis.tickFormat(function(d) { return d3.time.format('%x')(new Date(d)) }); //chart.xAxis.tickFormat(d3.format(',.2f')); chart.yAxis.tickFormat(d3.format('.01%')); chart.legend.vers('furious') .expanded(false); d3.select('#chart1') .datum(exampleData) .transition().duration(1000) .call(chart) .each('start', function() { setTimeout(function() { d3.selectAll('#chart1 *').each(function() { if(this.__transition__) this.__transition__.duration = 1; }) }, 0) }); nv.utils.windowResize(chart.update); return chart; }); //}); </script> </body> </html>
https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.2/d3.min.js