Skip to content

Instantly share code, notes, and snippets.

@poezn
Last active August 29, 2015 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save poezn/3b242f127391f8314e4c to your computer and use it in GitHub Desktop.
Save poezn/3b242f127391f8314e4c to your computer and use it in GitHub Desktop.
PPM CO2/year
{"description":"PPM CO2/year","endpoint":"","display":"svg","public":true,"require":[],"fileconfigs":{"inlet.js":{"default":true,"vim":false,"emacs":false,"fontSize":12},"data_yearly.json":{"default":true,"vim":false,"emacs":false,"fontSize":12},"data_monthly.json":{"default":true,"vim":false,"emacs":false,"fontSize":12},"data_yearly.tsv":{"default":true,"vim":false,"emacs":false,"fontSize":12},"_.md":{"default":true,"vim":false,"emacs":false,"fontSize":12},"config.json":{"default":true,"vim":false,"emacs":false,"fontSize":12},"data_yearly.csv":{"default":true,"vim":false,"emacs":false,"fontSize":12},"content.svg":{"default":true,"vim":false,"emacs":false,"fontSize":12},"styles.css":{"default":true,"vim":false,"emacs":false,"fontSize":12},"data_monthly.csv":{"default":true,"vim":false,"emacs":false,"fontSize":12}},"fullscreen":false,"play":false,"loop":false,"restart":false,"autoinit":true,"pause":true,"loop_type":"pingpong","bv":false,"nclones":15,"clone_opacity":0.4,"duration":3000,"ease":"linear","dt":0.01,"ajax-caching":true,"inline-console":true,"thumbnail":"http://i.imgur.com/WZMxXPv.png"}
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
year month average trend
1980 1 338.44 337.82
1980 2 339.17 338.12
1980 3 339.49 338.14
1980 4 339.87 338.25
1980 5 340.30 338.78
1980 6 339.86 339.08
1980 7 338.33 339.18
1980 8 337.12 339.38
1980 9 336.95 339.33
1980 10 337.71 339.05
1980 11 338.83 339.17
1980 12 339.55 339.31
1981 1 340.10 339.47
1981 2 340.66 339.61
1981 3 341.29 339.94
1981 4 341.57 339.96
1981 5 341.28 339.76
1981 6 340.47 339.70
1981 7 339.11 339.95
1981 8 337.98 340.24
1981 9 337.86 340.24
1981 10 338.95 340.30
1981 11 340.06 340.39
1981 12 340.64 340.42
1982 1 341.27 340.66
1982 2 341.86 340.80
1982 3 342.13 340.75
1982 4 342.42 340.81
1982 5 342.27 340.75
1982 6 341.39 340.63
1982 7 339.66 340.51
1982 8 338.02 340.30
1982 9 338.08 340.44
1982 10 339.53 340.88
1982 11 340.85 341.19
1982 12 341.68 341.45
1983 1 342.28 341.63
1983 2 342.65 341.61
1983 3 342.94 341.60
1983 4 343.41 341.83
1983 5 343.72 342.20
1983 6 343.41 342.62
1983 7 342.05 342.82
1983 8 340.54 342.75
1983 9 340.48 342.89
1983 10 341.67 343.08
1983 11 342.71 343.06
1983 12 343.37 343.15
1984 1 344.22 343.56
1984 2 344.73 343.73
1984 3 344.85 343.50
1984 4 345.09 343.46
1984 5 345.24 343.70
1984 6 344.46 343.71
1984 7 343.10 343.91
1984 8 342.13 344.40
1984 9 342.03 344.47
1984 10 342.89 344.28
1984 11 344.07 344.38
1984 12 344.91 344.63
1985 1 345.26 344.58
1985 2 345.72 344.70
1985 3 346.57 345.25
1985 4 346.85 345.24
1985 5 346.67 345.10
1985 6 346.18 345.39
1985 7 344.88 345.69
1985 8 343.39 345.69
1985 9 343.33 345.77
1985 10 344.58 345.97
1985 11 345.70 346.03
1985 12 346.45 346.16
1986 1 347.02 346.33
1986 2 347.24 346.25
1986 3 347.62 346.30
1986 4 348.15 346.53
1986 5 348.25 346.68
1986 6 347.68 346.91
1986 7 346.22 347.06
1986 8 344.86 347.14
1986 9 344.76 347.16
1986 10 345.94 347.31
1986 11 347.25 347.59
1986 12 347.68 347.41
1987 1 347.92 347.14
1987 2 348.48 347.39
1987 3 349.21 347.80
1987 4 349.91 348.22
1987 5 350.19 348.62
1987 6 349.42 348.75
1987 7 347.88 348.85
1987 8 346.63 349.00
1987 9 346.67 349.11
1987 10 347.93 349.32
1987 11 349.21 349.53
1987 12 350.17 349.86
1988 1 350.89 350.11
1988 2 351.46 350.39
1988 3 351.86 350.40
1988 4 352.32 350.54
1988 5 352.46 350.83
1988 6 351.77 351.06
1988 7 350.30 351.28
1988 8 349.10 351.54
1988 9 349.28 351.79
1988 10 350.46 351.88
1988 11 351.64 352.00
1988 12 352.52 352.24
1989 1 353.05 352.23
1989 2 353.48 352.38
1989 3 354.03 352.60
1989 4 354.41 352.62
1989 5 354.25 352.56
1989 6 353.31 352.59
1989 7 351.55 352.57
1989 8 350.19 352.68
1989 9 350.53 353.07
1989 10 351.79 353.24
1989 11 352.97 353.32
1989 12 353.84 353.52
1990 1 354.39 353.65
1990 2 354.80 353.74
1990 3 355.10 353.69
1990 4 355.44 353.66
1990 5 355.35 353.67
1990 6 354.26 353.59
1990 7 352.65 353.72
1990 8 351.52 354.04
1990 9 351.72 354.25
1990 10 353.13 354.52
1990 11 354.36 354.65
1990 12 355.09 354.63
1991 1 355.65 354.89
1991 2 356.05 354.95
1991 3 356.61 355.18
1991 4 357.14 355.38
1991 5 357.02 355.39
1991 6 356.13 355.51
1991 7 354.45 355.55
1991 8 352.94 355.46
1991 9 352.86 355.39
1991 10 353.90 355.29
1991 11 355.04 355.29
1991 12 355.88 355.38
1992 1 356.46 355.67
1992 2 356.83 355.70
1992 3 357.20 355.73
1992 4 357.67 355.87
1992 5 357.73 356.09
1992 6 356.82 356.22
1992 7 355.12 356.25
1992 8 353.53 356.10
1992 9 353.45 356.02
1992 10 354.71 356.12
1992 11 355.89 356.13
1992 12 356.65 356.16
1993 1 357.12 356.28
1993 2 357.46 356.31
1993 3 357.87 356.42
1993 4 358.33 356.57
1993 5 358.29 356.64
1993 6 357.27 356.60
1993 7 355.63 356.64
1993 8 354.31 356.80
1993 9 354.36 356.95
1993 10 355.61 357.09
1993 11 356.85 357.19
1993 12 357.75 357.38
1994 1 358.36 357.51
1994 2 358.90 357.75
1994 3 359.24 357.78
1994 4 359.58 357.79
1994 5 359.60 357.92
1994 6 358.66 357.94
1994 7 357.16 358.14
1994 8 355.95 358.47
1994 9 355.89 358.56
1994 10 357.13 358.67
1994 11 358.60 358.95
1994 12 359.48 359.07
1995 1 360.03 359.18
1995 2 360.50 359.39
1995 3 360.97 359.60
1995 4 361.43 359.72
1995 5 361.32 359.70
1995 6 360.49 359.79
1995 7 358.86 359.86
1995 8 357.57 360.07
1995 9 357.90 360.51
1995 10 359.28 360.75
1995 11 360.63 360.90
1995 12 361.51 361.03
1996 1 362.01 361.09
1996 2 362.37 361.19
1996 3 362.68 361.26
1996 4 363.00 361.29
1996 5 363.15 361.55
1996 6 362.75 362.09
1996 7 361.47 362.51
1996 8 359.94 362.47
1996 9 359.56 362.18
1996 10 360.56 362.04
1996 11 361.67 361.96
1996 12 362.52 362.07
1997 1 363.15 362.20
1997 2 363.50 362.31
1997 3 363.87 362.46
1997 4 364.38 362.68
1997 5 364.42 362.85
1997 6 363.52 362.88
1997 7 361.83 362.88
1997 8 360.28 362.79
1997 9 360.27 362.88
1997 10 361.80 363.27
1997 11 363.49 363.75
1997 12 364.55 364.08
1998 1 365.06 364.12
1998 2 365.37 364.21
1998 3 365.84 364.44
1998 4 366.46 364.79
1998 5 366.70 365.16
1998 6 366.12 365.51
1998 7 364.66 365.72
1998 8 363.59 366.10
1998 9 363.87 366.46
1998 10 365.22 366.65
1998 11 366.49 366.72
1998 12 367.33 366.83
1999 1 367.99 367.06
1999 2 368.37 367.23
1999 3 368.75 367.37
1999 4 369.14 367.50
1999 5 369.07 367.56
1999 6 368.20 367.62
1999 7 366.47 367.52
1999 8 365.13 367.60
1999 9 365.32 367.88
1999 10 366.63 368.05
1999 11 367.92 368.13
1999 12 368.75 368.20
2000 1 369.26 368.35
2000 2 369.55 368.41
2000 3 369.87 368.48
2000 4 370.22 368.56
2000 5 370.13 368.59
2000 6 369.19 368.66
2000 7 367.76 368.91
2000 8 366.59 369.13
2000 9 366.57 369.12
2000 10 367.82 369.19
2000 11 369.20 369.35
2000 12 370.01 369.42
2001 1 370.53 369.64
2001 2 370.98 369.83
2001 3 371.37 369.96
2001 4 371.71 370.04
2001 5 371.63 370.10
2001 6 370.71 370.17
2001 7 369.30 370.43
2001 8 368.15 370.65
2001 9 368.19 370.72
2001 10 369.54 370.92
2001 11 370.90 371.09
2001 12 371.82 371.28
2002 1 372.34 371.38
2002 2 372.72 371.49
2002 3 373.22 371.70
2002 4 373.56 371.81
2002 5 373.55 371.97
2002 6 372.69 372.15
2002 7 371.26 372.42
2002 8 370.18 372.73
2002 9 370.49 373.11
2002 10 371.76 373.23
2002 11 373.12 373.39
2002 12 374.13 373.66
2003 1 374.78 373.78
2003 2 375.31 374.01
2003 3 375.75 374.18
2003 4 376.22 374.43
2003 5 376.36 374.75
2003 6 375.51 374.95
2003 7 373.96 375.11
2003 8 372.73 375.32
2003 9 372.93 375.60
2003 10 374.23 375.75
2003 11 375.51 375.82
2003 12 376.34 375.90
2004 1 376.99 376.02
2004 2 377.52 376.22
2004 3 377.94 376.35
2004 4 378.30 376.51
2004 5 378.23 376.63
2004 6 377.35 376.80
2004 7 375.81 376.99
2004 8 374.36 377.00
2004 9 374.25 376.92
2004 10 375.57 377.07
2004 11 377.02 377.32
2004 12 378.00 377.51
2005 1 378.59 377.63
2005 2 379.03 377.73
2005 3 379.66 378.06
2005 4 380.17 378.35
2005 5 380.27 378.63
2005 6 379.44 378.84
2005 7 377.75 378.91
2005 8 376.51 379.15
2005 9 376.59 379.28
2005 10 377.92 379.47
2005 11 379.40 379.73
2005 12 380.38 379.90
2006 1 381.10 380.11
2006 2 381.75 380.40
2006 3 382.16 380.54
2006 4 382.48 380.64
2006 5 382.43 380.76
2006 6 381.56 380.94
2006 7 379.88 381.07
2006 8 378.31 381.01
2006 9 378.42 381.18
2006 10 379.82 381.40
2006 11 381.18 381.51
2006 12 382.15 381.67
2007 1 382.82 381.82
2007 2 383.35 381.97
2007 3 383.81 382.17
2007 4 384.10 382.27
2007 5 383.96 382.33
2007 6 383.09 382.51
2007 7 381.39 382.63
2007 8 380.12 382.86
2007 9 380.50 383.27
2007 10 381.89 383.44
2007 11 383.21 383.49
2007 12 384.21 383.70
2008 1 384.97 383.97
2008 2 385.49 384.11
2008 3 385.90 384.29
2008 4 386.31 384.51
2008 5 386.30 384.67
2008 6 385.35 384.79
2008 7 383.82 385.12
2008 8 382.50 385.28
2008 9 382.29 385.03
2008 10 383.43 384.91
2008 11 384.92 385.14
2008 12 386.00 385.46
2009 1 386.77 385.74
2009 2 387.21 385.78
2009 3 387.43 385.78
2009 4 387.73 385.92
2009 5 387.72 386.13
2009 6 386.74 386.24
2009 7 384.87 386.25
2009 8 383.50 386.34
2009 9 383.71 386.44
2009 10 385.24 386.66
2009 11 386.77 386.95
2009 12 387.70 387.14
2010 1 388.43 387.42
2010 2 389.13 387.73
2010 3 389.45 387.82
2010 4 389.73 387.93
2010 5 389.68 388.09
2010 6 388.79 388.29
2010 7 387.22 388.59
2010 8 386.09 388.87
2010 9 386.52 389.22
2010 10 388.08 389.51
2010 11 389.48 389.67
2010 12 390.21 389.68
2011 1 390.74 389.70
2011 2 391.19 389.77
2011 3 391.50 389.88
2011 4 391.89 390.11
2011 5 391.90 390.31
2011 6 390.97 390.45
2011 7 389.04 390.37
2011 8 387.73 390.51
2011 9 388.14 390.85
2011 10 389.73 391.18
2011 11 391.10 391.30
2011 12 391.90 391.37
2012 1 392.47 391.43
2012 2 393.09 391.68
2012 3 393.60 391.98
2012 4 393.83 392.06
2012 5 393.68 392.10
2012 6 392.68 392.16
2012 7 390.91 392.24
2012 8 389.81 392.59
2012 9 390.41 393.12
2012 10 392.03 393.48
2012 11 393.43 393.63
2012 12 394.21 393.69
2013 1 394.96 393.92
2013 2 395.62 394.20
2013 3 396.16 394.54
2013 4 396.66 394.88
2013 5 396.71 395.12
2013 6 395.89 395.37
2013 7 394.39 395.72
2013 8 393.20 395.98
2013 9 393.17 395.88
2013 10 394.42 395.87
2013 11 395.83 396.04
2013 12 396.77 396.25
2014 1 397.46 396.42
2014 2 397.93 396.52
2014 3 398.16 396.54
2014 4 398.40 396.63
2014 5 398.59 397.00
2014 6 397.82 397.30
year ppm
1980 338.80
1981 340.00
1982 340.76
1983 342.44
1984 343.98
1985 345.46
1986 346.89
1987 348.63
1988 351.17
1989 352.78
1990 353.99
1991 355.30
1992 356.01
1993 356.74
1994 358.21
1995 360.04
1996 361.81
1997 362.92
1998 365.56
1999 367.64
2000 368.85
2001 370.40
2002 372.42
2003 374.97
2004 376.78
2005 378.81
2006 380.94
2007 382.70
2008 384.77
2009 386.28
2010 388.57
2011 390.49
2012 392.51
2013 395.31
2035 600
var data_raw = tb["data_yearly"];
var data_raw_monthly = tb["data_monthly"];
var data = _.map(data_raw, function(d, i) {
return {
"dt": new Date(d.year, 0, 1),
"ppm": parseFloat(d.ppm)
}
});
var dataMonthly = _.map(data_raw_monthly, function(d, i) {
return {
"dt": new Date(d.year, d.month, 1),
"ppm": parseFloat(d.average),
"ppm-trend": parseFloat(d.trend)
}
});
var w = 500,
h = 235;
var gChart = g.select("#chart");
var scaleX = d3.time.scale()
.domain(d3.extent(data, function(d) { return d.dt; }))
.range([0, w]);
var scaleY = d3.scale.linear()
.domain(d3.extent(data, function(d) { return d.ppm; }))
.range([h, 0]);
var line = d3.svg.line()
.x(function(d, i) { return scaleX(d.dt); })
.y(function(d, i) { return scaleY(d.ppm); })
var lineTrend = d3.svg.line()
.x(function(d, i) { return scaleX(d.dt); })
.y(function(d, i) { return scaleY(d["ppm-trend"]); })
gChart.append("path")
.datum(dataMonthly)
.attr({
"class": "ppm",
"d": line
});
gChart.append("path")
.datum(dataMonthly)
.attr({
"class": "ppm trend",
"d": lineTrend
});
var axisX = d3.svg.axis()
.scale(scaleX)
.ticks(5);
var axisY = d3.svg.axis()
.scale(scaleY)
.orient("left")
.ticks(6);
gChart.select(".axis.x")
.call(axisX);
gChart.select(".axis.y")
.call(axisY);
#display {
background-color: #FFFFFF;
}
#chart path {
fill: none;
stroke-width: 2px;
stroke: #e8e8e8;
}
#chart path.trend {
stroke: #888888;
}
.axis text {
fill: #bababa;
font-size: 12px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment