diff --git a/example.html b/example.html deleted file mode 100644 index ecdb39f..0000000 --- a/example.html +++ /dev/null @@ -1,187 +0,0 @@ - -
- - - - - - -+// Insert code here: +// it'll get eval()-ed and prettyprinted. ++ diff --git a/examples/days.html b/examples/days.html new file mode 100644 index 0000000..4d57f05 --- /dev/null +++ b/examples/days.html @@ -0,0 +1,36 @@ + + + + + + + + + + + +
+// data stolen from http://howmanyleft.co.uk/vehicle/jaguar_'e'_type +var day_data = [ + {"period": "2012-10-01", "licensed": 3407, "sorned": 660}, + {"period": "2011-08-12", "licensed": 3351, "sorned": 629}, + {"period": "2011-03-03", "licensed": 3269, "sorned": 618}, + {"period": "2010-08-08", "licensed": 3246, "sorned": 661}, + {"period": "2010-05-10", "licensed": 3257, "sorned": 667}, + {"period": "2010-03-14", "licensed": 3248, "sorned": 627}, + {"period": "2010-01-10", "licensed": 3171, "sorned": 660}, + {"period": "2009-12-10", "licensed": 3171, "sorned": 676}, + {"period": "2009-10-07", "licensed": 3201, "sorned": 656}, + {"period": "2009-09-25", "licensed": 3215, "sorned": 622}, +]; +Morris.Line({ + element: 'graph', + data: day_data, + xkey: 'period', + ykeys: ['licensed', 'sorned'], + labels: ['Licensed', 'SORN'] +}); ++ diff --git a/examples/lib/example.css b/examples/lib/example.css new file mode 100644 index 0000000..4805c5e --- /dev/null +++ b/examples/lib/example.css @@ -0,0 +1,13 @@ +body { + width: 800px; + margin: 0 auto; +} +#graph { + width: 800px; + height: 250px; + margin: 20px auto 0 auto; +} +pre { + height: 250px; + overflow: auto; +} diff --git a/examples/lib/example.js b/examples/lib/example.js new file mode 100644 index 0000000..80b19f4 --- /dev/null +++ b/examples/lib/example.js @@ -0,0 +1,4 @@ +$(function () { + eval($('#code').text()); + prettyPrint(); +}); \ No newline at end of file diff --git a/examples/lib/prettify.css b/examples/lib/prettify.css new file mode 100644 index 0000000..d44b3a2 --- /dev/null +++ b/examples/lib/prettify.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} \ No newline at end of file diff --git a/examples/lib/prettify.js b/examples/lib/prettify.js new file mode 100644 index 0000000..eef5ad7 --- /dev/null +++ b/examples/lib/prettify.js @@ -0,0 +1,28 @@ +var q=null;window.PR_SHOULD_USE_CONTINUATION=!0; +(function(){function L(a){function m(a){var f=a.charCodeAt(0);if(f!==92)return f;var b=a.charAt(1);return(f=r[b])?f:"0"<=b&&b<="7"?parseInt(a.substring(1),8):b==="u"||b==="x"?parseInt(a.substring(2),16):a.charCodeAt(1)}function e(a){if(a<32)return(a<16?"\\x0":"\\x")+a.toString(16);a=String.fromCharCode(a);if(a==="\\"||a==="-"||a==="["||a==="]")a="\\"+a;return a}function h(a){for(var f=a.substring(1,a.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),a= +[],b=[],o=f[0]==="^",c=o?1:0,i=f.length;c122||(d<65||j>90||b.push([Math.max(65,j)|32,Math.min(d,90)|32]),d<97||j>122||b.push([Math.max(97,j)&-33,Math.min(d,122)&-33]))}}b.sort(function(a,f){return a[0]-f[0]||f[1]-a[1]});f=[];j=[NaN,NaN];for(c=0;c
+// data stolen from http://howmanyleft.co.uk/vehicle/jaguar_'e'_type +var month_data = [ + {"period": "2012-10", "licensed": 3407, "sorned": 660}, + {"period": "2011-08", "licensed": 3351, "sorned": 629}, + {"period": "2011-03", "licensed": 3269, "sorned": 618}, + {"period": "2010-08", "licensed": 3246, "sorned": 661}, + {"period": "2010-05", "licensed": 3257, "sorned": 667}, + {"period": "2010-03", "licensed": 3248, "sorned": 627}, + {"period": "2010-01", "licensed": 3171, "sorned": 660}, + {"period": "2009-12", "licensed": 3171, "sorned": 676}, + {"period": "2009-10", "licensed": 3201, "sorned": 656}, + {"period": "2009-09", "licensed": 3215, "sorned": 622}, +]; +Morris.Line({ + element: 'graph', + data: month_data, + xkey: 'period', + ykeys: ['licensed', 'sorned'], + labels: ['Licensed', 'SORN'], + smooth: false +}); ++ diff --git a/examples/non-date.html b/examples/non-date.html new file mode 100644 index 0000000..895ef4b --- /dev/null +++ b/examples/non-date.html @@ -0,0 +1,36 @@ + + + + + + + + + + + +
+var day_data = [ + {"elapsed": "I", "value": 34}, + {"elapsed": "II", "value": 24}, + {"elapsed": "III", "value": 3}, + {"elapsed": "IV", "value": 12}, + {"elapsed": "V", "value": 13}, + {"elapsed": "VI", "value": 22}, + {"elapsed": "VII", "value": 5}, + {"elapsed": "VIII", "value": 26}, + {"elapsed": "IX", "value": 12}, + {"elapsed": "X", "value": 19}, +]; +Morris.Line({ + element: 'graph', + data: day_data, + xkey: 'elapsed', + ykeys: ['value'], + labels: ['value'], + parseTime: false +}); ++ diff --git a/examples/quarters.html b/examples/quarters.html new file mode 100644 index 0000000..7e928fa --- /dev/null +++ b/examples/quarters.html @@ -0,0 +1,53 @@ + + + + + + + + + + + +
+// data stolen from http://howmanyleft.co.uk/vehicle/jaguar_'e'_type +var quarter_data = [ + {"period": "2011 Q3", "licensed": 3407, "sorned": 660}, + {"period": "2011 Q2", "licensed": 3351, "sorned": 629}, + {"period": "2011 Q1", "licensed": 3269, "sorned": 618}, + {"period": "2010 Q4", "licensed": 3246, "sorned": 661}, + {"period": "2010 Q3", "licensed": 3257, "sorned": 667}, + {"period": "2010 Q2", "licensed": 3248, "sorned": 627}, + {"period": "2010 Q1", "licensed": 3171, "sorned": 660}, + {"period": "2009 Q4", "licensed": 3171, "sorned": 676}, + {"period": "2009 Q3", "licensed": 3201, "sorned": 656}, + {"period": "2009 Q2", "licensed": 3215, "sorned": 622}, + {"period": "2009 Q1", "licensed": 3148, "sorned": 632}, + {"period": "2008 Q4", "licensed": 3155, "sorned": 681}, + {"period": "2008 Q3", "licensed": 3190, "sorned": 667}, + {"period": "2007 Q4", "licensed": 3226, "sorned": 620}, + {"period": "2006 Q4", "licensed": 3245, "sorned": 0}, + {"period": "2005 Q4", "licensed": 3289, "sorned": 0}, + {"period": "2004 Q4", "licensed": 3263, "sorned": 0}, + {"period": "2003 Q4", "licensed": 3189, "sorned": 0}, + {"period": "2002 Q4", "licensed": 3079, "sorned": 0}, + {"period": "2001 Q4", "licensed": 3085, "sorned": 0}, + {"period": "2000 Q4", "licensed": 3055, "sorned": 0}, + {"period": "1999 Q4", "licensed": 3063, "sorned": 0}, + {"period": "1998 Q4", "licensed": 2943, "sorned": 0}, + {"period": "1997 Q4", "licensed": 2806, "sorned": 0}, + {"period": "1996 Q4", "licensed": 2674, "sorned": 0}, + {"period": "1995 Q4", "licensed": 1702, "sorned": 0}, + {"period": "1994 Q4", "licensed": 1732, "sorned": 0} +]; +Morris.Line({ + element: 'graph', + data: quarter_data, + xkey: 'period', + ykeys: ['licensed', 'sorned'], + labels: ['Licensed', 'SORN'] +}); ++ diff --git a/examples/weeks.html b/examples/weeks.html new file mode 100644 index 0000000..f2db24d --- /dev/null +++ b/examples/weeks.html @@ -0,0 +1,52 @@ + + + + + + + + + + + +
+var week_data = [ + {"period": "2011 W27", "licensed": 3407, "sorned": 660}, + {"period": "2011 W26", "licensed": 3351, "sorned": 629}, + {"period": "2011 W25", "licensed": 3269, "sorned": 618}, + {"period": "2011 W24", "licensed": 3246, "sorned": 661}, + {"period": "2011 W23", "licensed": 3257, "sorned": 667}, + {"period": "2011 W22", "licensed": 3248, "sorned": 627}, + {"period": "2011 W21", "licensed": 3171, "sorned": 660}, + {"period": "2011 W20", "licensed": 3171, "sorned": 676}, + {"period": "2011 W19", "licensed": 3201, "sorned": 656}, + {"period": "2011 W18", "licensed": 3215, "sorned": 622}, + {"period": "2011 W17", "licensed": 3148, "sorned": 632}, + {"period": "2011 W16", "licensed": 3155, "sorned": 681}, + {"period": "2011 W15", "licensed": 3190, "sorned": 667}, + {"period": "2011 W14", "licensed": 3226, "sorned": 620}, + {"period": "2011 W13", "licensed": 3245, "sorned": 0}, + {"period": "2011 W12", "licensed": 3289, "sorned": 0}, + {"period": "2011 W11", "licensed": 3263, "sorned": 0}, + {"period": "2011 W10", "licensed": 3189, "sorned": 0}, + {"period": "2011 W09", "licensed": 3079, "sorned": 0}, + {"period": "2011 W08", "licensed": 3085, "sorned": 0}, + {"period": "2011 W07", "licensed": 3055, "sorned": 0}, + {"period": "2011 W06", "licensed": 3063, "sorned": 0}, + {"period": "2011 W05", "licensed": 2943, "sorned": 0}, + {"period": "2011 W04", "licensed": 2806, "sorned": 0}, + {"period": "2011 W03", "licensed": 2674, "sorned": 0}, + {"period": "2011 W02", "licensed": 1702, "sorned": 0}, + {"period": "2011 W01", "licensed": 1732, "sorned": 0} +]; +Morris.Line({ + element: 'graph', + data: week_data, + xkey: 'period', + ykeys: ['licensed', 'sorned'], + labels: ['Licensed', 'SORN'] +}); ++