Last active
December 17, 2015 02:49
-
-
Save blmarket/5538982 to your computer and use it in GitHub Desktop.
Commit activity by hours
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype HTML> | |
<html ng-app> | |
<head> | |
<title>result</title> | |
<meta charset="utf-8"/> | |
<!--<link rel="stylesheet" href="css/bootstrap.min.css"/>--> | |
<style type="text/css"> | |
table { | |
font-size: 6px; | |
} | |
table.table-calendar tbody td { | |
width: 4px; | |
line-height: 4px; | |
} | |
table.table-calendar tbody td.number1 { | |
background: #afa; | |
} | |
table.table-calendar tbody td.number2 { | |
background: #8f8; | |
} | |
table.table-calendar tbody td.number3 { | |
background: #6f6; | |
} | |
table.table-calendar tbody td.number4 { | |
background: #4f4; | |
} | |
table.table-calendar tbody td.number5 { | |
background: #0f0; | |
} | |
svg rect { | |
fill: #eee; | |
} | |
svg rect.number0 { | |
fill: #eee; | |
} | |
svg rect.number1 { | |
fill: #afa; | |
} | |
svg rect.number2 { | |
fill: #8f8; | |
} | |
svg rect.number3 { | |
fill: #6f6; | |
} | |
svg rect.number4 { | |
fill: #4f4; | |
} | |
svg rect.number5 { | |
fill: #0f0; | |
} | |
</style> | |
</head> | |
<body> | |
<div id="contents" class=""> | |
<div id="months" ng-controller="CalendarCtrl" ng-init="init()"> | |
<p>asdf</p> | |
<svg id="calendar" ng-init="month=1;maxdate=100" width="1200" height="288"> | |
<g transform="translate({{12*date}},0)" ng-repeat="date in create_list(maxdate)"> | |
<rect width="10" height="10" y="{{hour*12}}" ng-init="cls=get_class(hour,date,month)" ng-click="click(this)" class="{{cls}}" ng-repeat="hour in create_list(24)"></rect> | |
</g> | |
</svg> | |
<!-- | |
<div class="month" style="display: block;" ng-repeat="(month,maxdate) in month_list"> | |
<table class="table table-bordered table-calendar" style="width: auto;"> | |
<thead> | |
<tr> | |
<th>hr</th> | |
<th ng-repeat="date in create_list(maxdate)">{{date+1}}</th> | |
</tr> | |
</thead> | |
<tbody> | |
<tr ng-repeat="hour in create_list(24)"> | |
<td>{{hour+1}}</td> | |
<td ng-class="get_class(hour,date,month)" ng-repeat="date in create_list(maxdate)"></td> | |
</tr> | |
</tbody> | |
</table> | |
</div> | |
--> | |
</div> | |
</div> | |
<script src="//code.jquery.com/jquery-1.9.1.min.js"></script> | |
<script src="//code.jquery.com/jquery-migrate-1.1.1.js"></script> | |
<!--<script src="js/bootstrap.min.js"></script>--> | |
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.0.6/angular.min.js"></script> | |
<script src="res2.js"></script> | |
<script type="text/javascript"> | |
function CalendarCtrl($scope) { | |
function init() { | |
$scope.data = data; | |
var res = []; | |
var rhash = {}; | |
var committer_list = ["JH", "LCH", "OTHER", "PSR"]; | |
for(var i=0;i<committer_list.length;i++) { | |
res = res.concat(data[committer_list[i]]); | |
} | |
for(var i=0,len=res.length;i<len;i++) { | |
res[i] = new Date(res[i]*1000); | |
var m = res[i].getMonth(); | |
var d = res[i].getDate(); | |
var h = res[i].getHours(); | |
if(!rhash[m]) rhash[m] = {}; | |
if(!rhash[m][d]) rhash[m][d] = {}; | |
if(!rhash[m][d][h]) rhash[m][d][h] = 0; | |
rhash[m][d][h] = rhash[m][d][h] + 1; | |
}; | |
$scope.rhash = rhash; | |
console.log($scope.rhash); | |
} | |
function create_list(maxdate) { | |
var ret = []; | |
for(var i=0;i<maxdate;i++) { ret.push(i); } | |
return ret; | |
} | |
function count(hour, date, month) { | |
var rhash = $scope.rhash; | |
var dd = new Date(); | |
dd.setMonth(month); | |
dd.setDate(date); | |
dd.setHours(hour); | |
var m = dd.getMonth(), d = dd.getDate(), h = dd.getHours(); | |
if(!rhash[m]) return 0; | |
if(!rhash[m][d]) return 0; | |
if(!rhash[m][d][h]) return 0; | |
return rhash[dd.getMonth()][dd.getDate()][dd.getHours()]; | |
} | |
function get_class(hour, date, month) { | |
var cnt = count(hour, date, month); | |
if(cnt === 0) return ""; | |
if(cnt > 5) cnt = 5; | |
return "number" + cnt; | |
} | |
function click(item) { | |
var next = { | |
number0: 'number1', | |
number1: 'number2', | |
number2: 'number3', | |
number3: 'number4', | |
number4: 'number5', | |
number5: 'number0', | |
}; | |
if(next[item.cls]) item.cls = next[item.cls]; else item.cls = 'number1'; | |
} | |
$scope.init = init; | |
$scope.create_list = create_list; | |
$scope.count = count; | |
$scope.get_class = get_class; | |
$scope.click = click; | |
}; | |
</script> | |
</body> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var data={"JH":[1367987613,1367572053,1367571616,1367571523,1367571015,1367568915,1367568309,1366102521,1366089332,1366014074,1366006359,1366004479,1365936321,1365935483,1365935229,1365778918,1365759549,1365759160,1365758967,1365758125,1365757711,1365745943,1365745768,1365744376,1365739840,1365739595,1365672285,1365671466,1365654809,1365647766,1365642597,1365642490,1365581585,1365578837,1365577090,1365577009,1365576889,1365576763,1365576551,1365573520,1365572886,1365560666,1365556039,1365497381,1365495195,1365493987,1365490316,1365487916,1365485293,1365485281,1365484667,1365484294,1365406266,1365405653,1365398388,1365398139,1365398089,1365397451,1365396530,1365386796,1365147354,1365143889,1365143671,1365048005,1365046406,1364894135,1364875833,1364868718,1364868667,1364868656,1364868379,1364867801,1364867786,1364867615,1364866293,1364802633,1364801152,1364798073,1364532179,1364531796,1364531106,1364523991,1364523365,1364523340,1364522854,1364522396,1364522220,1364458677,1364457876,1364457074,1364452683,1364177173,1364176066,1364173768,1363845632,1363845495,1363845244,1363832550,1363672451,1363590514,1363155134,1363155106,1363154978,1363154929,1363151483,1363151380,1363073809,1363071899,1363068809,1363068590,1362990026,1362989937,1362988225,1362986033,1362730900,1362709711,1362709701,1362639265,1362638982,1362637975,1362637119,1362636593,1362557785,1362557750,1362556735,1362555922,1362555726,1362555156,1362554692,1362554316,1362551772,1362548819,1362547740,1362545898,1362537484,1362537340,1362537094,1362536977,1362536705,1362535039,1362535025,1362386053,1362384662,1362373407,1362373072,1361943005,1361941985,1361757583,1361756573,1361756102,1361519199,1361518818,1361518732,1361518418,1361518378,1361429961,1361429890,1365153248,1365153131,1365141921,1365138826,1365138539,1365061901,1365060476,1365060387,1365058998,1365058550,1364194706,1364194684,1364190644,1364189907,1364185506,1364078457,1364078382,1363996354,1363995483,1363943561,1363942256,1363942174,1363915271,1363857245,1363856991,1363856511,1363856420,1363856403,1363856383,1363855093,1362467335,1362467112,1362463026,1362462157,1362462147,1362462121,1362379292,1362111148,1362033867,1362033577,1361858018,1361854996,1361408771,1361408635,1361408531,1361406301,1361368285,1361367291,1361367140,1361351950,1361351727,1361351356,1361351274,1361350066,1361349744,1361349131,1361348399,1361346989,1361346287,1361346010,1361343268,1361336511,1361336482,1361335807,1361334494,1361334436,1361334349,1361255213,1360981364,1360980895,1360980536,1360980520,1360978998,1360978767,1360903707,1360901266,1360829998,1360829991,1360829954,1360829805,1360829775,1360818685,1360818659,1360818648,1360818604,1360818346,1360818266,1360818242,1360306265,1360305005,1360304136,1360130395,1360128400,1366167492,1366165944,1366165822,1365654745,1365580459,1365052420,1365052362,1364797869,1364793522,1364793501,1364793474,1364792486,1364779545,1364779059,1364778491,1363237517,1363234916,1363227724,1363224742,1363154293,1363153824,1363148396,1363147732,1366255208,1366098058,1366097916,1366016019,1366014778,1366010276,1365581085,1364791002,1364449542,1364447320,1363917371,1363584189,1363073856,1363072566,1362984655,1362984585,1362983323,1362382502,1362382447,1362382332,1362381938,1362381586,1366098173,1365988039,1365987906,1365755838,1363931906,1363931353,1363931178,1363931044,1363930665,1363930490,1363685679,1363684250,1363683648,1363683472,1363683248,1363683097,1363683072,1363669839,1363589011,1362468262,1362372225,1362270013,1362123462,1362121583,1362121534,1362121527,1362120108,1361953382,1361953343,1361952703,1361846233,1361845632,1361845454,1361516198,1361516065,1361493468,1361493014,1361460925,1361248142,1361241228,1360824952,1360807160,1360806985,1360806963,1360657883,1360657872,1360657826,1360636901,1360636882,1365583726,1364534437,1364533658,1364533493,1364533134,1364532949,1364532839,1362727609,1362727423,1362726764,1362726480,1362725894,1362725758,1362034850,1362033108,1362032159,1362032010,1362031866,1361867128,1361866913,1361866345,1361861544,1361499295,1361499097,1361498628,1361498248,1361498025,1361497506,1361496815,1361435978,1361435201,1361435187,1361435003,1361432412,1361431056,1361430709,1361430578,1361430162,1361429961,1361429890,1364288400,1364276693,1363151185,1363150735,1363150641,1363148451,1363092765,1363091666,1363090469,1363085313,1363085224,1363085069,1362999342,1362556243,1362458756,1362456346,1362454996,1362454805,1362454747,1362453757,1361944009,1361943651,1361943124,1361943114,1361942174,1361940424,1361937111,1361937043,1361262966,1361262938,1361261489,1361260829,1361260452,1361260336,1363847196,1363243875,1363243628,1363243421,1363243104,1363241808,1363241775,1363241733,1362554038,1362363953,1362103391,1362038959,1362037952,1362037389,1362037203,1362036789,1362035009,1361846467,1361845367,1361422866,1361422155,1361237223,1360918157,1360821253,1360819874,1360659234,1360658322,1360300752,1360300652,1360299644,1360299434,1360299303,1360298910,1360298903,1360298492,1360298432,1360298372,1360298316,1360226307,1360225923,1360216680,1360215872,1360215865,1360215534,1360214394,1360214351,1360140916,1360140411,1360140320,1360140274,1360140261,1360140157,1360140101,1360138153,1360128103,1360126010,1360125969,1360051701,1360051587,1360051443,1360050275,1361423725,1360657883,1360657872,1360657826,1360636901,1360636882],"OTHER":[1367475100,1367474975,1367466396,1367326401,1366804508,1366781572,1366710614,1366697213,1366632605,1366630255,1366629014,1366366097,1366364268,1366335734,1366277346,1366171751,1366168455,1366104028,1366103986,1366095070,1366095048,1366081466,1366081404,1366020305,1366016603,1366016592,1366015258,1366013730,1366013467,1365760176,1365759899,1365758645,1365758643,1365758535,1365758535,1365758505,1365758464,1365754873,1365674273,1365674249,1365674131,1365591931,1365555004,1366999896,1366207569,1366168062,1365800648,1365655363,1365558739,1365531730,1365495348,1365412429,1365281969,1365281819,1365139092,1365139076,1365103194,1365102857,1365102776,1365102451],"PSR":[1366016556,1366009689,1365751685,1365751353,1365751237,1365743739,1365137763,1364975524,1364974274,1364528010,1364527740,1364527636,1364527636,1364459362,1364459341,1364456945,1364456843,1364456780,1364456148,1364456148,1364287643,1363932503,1363929840,1363929168,1363927421,1363927278,1363917531,1363917578,1367491850,1367482510,1367305792,1367218777,1367209281,1367208570,1367208539,1367201116,1367201069,1367046707,1367046217,1367041442,1367041424,1367041239,1366968074,1366964419,1366958570,1366958434,1366953802,1366953659,1366951308,1366951287,1366950609,1366950002,1366877968,1366877939,1366865305,1366865274,1365499761,1365497321,1365494708,1365150243,1365148994,1365148940,1365145046,1365144303,1365143428,1365142259,1365142215,1365128051,1365128034,1364892048,1364809571,1364803354,1364535945,1364531647,1364531617,1364388580,1364388340,1364388270,1364373482,1364373394,1363942176,1363938361,1362994635,1362994355,1362992744,1362990337,1362732391,1362731173,1362731155,1361944486,1361938716,1361936605,1361935964,1361928304,1361861703,1361860284,1361860272,1361430260,1361429708,1361429690,1361429122,1361429067,1361422842,1361422365,1361422210,1361422174,1361353241,1361353112,1361352847,1361352576,1361352448,1361348307,1361348244,1361347976,1360817967,1360740734,1360737358,1360737276,1360291169,1364783574,1363759281,1363759142,1363672054,1363340021,1363336173,1363335520,1363327913,1363252561,1363251807,1363250710,1363250543,1363250429,1363250246,1363248561,1363248303,1363248059,1363247942,1363238223,1363238195,1363235372,1363235353,1363235320,1363227889,1363155461,1363155439,1363155424,1363155011,1362705588,1362705489,1362705087,1362645075,1362640203,1362547271,1362476542,1362476495,1362389132,1362385910,1362042115,1365760641,1365760342,1365759964,1365741619,1365741167,1365676176,1363227000,1363085376,1363085288,1363085118,1363085066,1363084936,1362999388,1362719761,1362459130,1362458120,1362457613,1362449123,1362372343,1362044054,1361262681,1361262569,1361261935,1361253224,1361253039,1361252587,1361251810,1361251491],"LCH":[1367940379,1367332070,1367260774,1367260709,1367257637,1367254740,1367254265,1367253330,1367250160,1367248586,1367247209,1367246698,1367246161,1367245921,1367235267,1367235247,1367207301,1367207272,1367198991,1367140897,1367140543,1367140531,1367077817,1367075662,1367054171,1367052442,1367032539,1367019255,1367018945,1367018777,1367018507,1366977436,1366974968,1366971395,1366969981,1366969966,1366965605,1366964486,1366964425,1366964403,1366962805,1366962783,1366958634,1366953850,1366952839,1366952161,1366952140,1366951318,1366951288,1366951113,1366951080,1366943158,1366943156,1366943139,1366907613,1366907591,1366905846,1366905618,1366904897,1366904859,1366904758,1366903689,1366903681,1366900402,1366900358,1366898011,1366897979,1366877957,1366877720,1366877588,1366865293,1366820284,1366820215,1366819349,1366819334,1366819275,1366816000,1366811162,1366811157,1366810605,1366810596,1366804615,1366804599,1366802793,1366802770,1366800969,1366768571,1366768547,1366735510,1366735478,1366734447,1366734382,1366732860,1366732828,1366732053,1366731990,1366731483,1366691089,1366691059,1366687553,1366644064,1366634111,1366628694,1366628665,1366628063,1366628061,1366608409,1366602901,1366598227,1366596113,1366552869,1366511741,1366511545,1366418246,1366416951,1366415414,1366415370,1366386458,1366382222,1366382049,1366380911,1366380838,1366127695,1366127396,1366127078,1365868168,1365749104,1365749107,1365688194,1365678752,1365676028,1365675848,1365674837,1365674822,1365581850,1365519500,1365499783,1365497320,1365494732,1365490412,1365483165,1365482709,1365475468,1365440350,1365439793,1365439416,1365439414,1365438985,1365438981,1365436464,1365436464,1365386103,1365386098,1365176988,1365176970,1365176900,1365175821,1365168484,1365168471,1365154707,1365154705,1365150261,1365148987,1365148937,1365145069,1365144297,1365143424,1365142290,1365142273,1364996489,1364996477,1364996055,1364995715,1364995676,1364995548,1364914990,1364825344,1364819308,1364809608,1364805069,1364791129,1364708640,1364574222,1364573892,1364483068,1364482017,1364481881,1364393196,1364347580,1364311656,1364310146,1364310036,1364286966,1364283366,1364264098,1364264049,1364215917,1364215865,1364183843,1364183614,1364179958,1364130163,1364104022,1363914400,1363880439,1363878218,1363877800,1363877650,1363877314,1363876262,1363873097,1363871539,1363870325,1363848633,1363846863,1363841144,1363841102,1363755746,1363754598,1363746835,1363678683,1363678370,1363573882,1363344309,1363176147,1363163783,1363163609,1363163044,1363162993,1363162878,1363162807,1363162657,1363154908,1363014185,1363013381,1363012423,1363011323,1363008822,1362994642,1362994363,1362992787,1362990404,1362732455,1362731121,1362730901,1362724274,1362667260,1362637438,1362634451,1362568536,1362568054,1362565052,1362558597,1362556730,1362555734,1362554549,1362554328,1362553231,1362551950,1362551827,1362550955,1362502699,1362500341,1362500033,1362494285,1362493586,1362493387,1362491507,1362486829,1362468568,1362468533,1362463714,1362450230,1362375606,1362372732,1362372708,1362367436,1362040334,1362040301,1362017367,1361965203,1361964033,1361960369,1361956243,1361956176,1361253172,1361236660,1361153936,1361153875,1361153714,1366775085,1366291300,1366291292,1366120502,1366119846,1366119621,1363934407,1363934369,1365742797,1365742696,1365742669,1365741447,1365645448,1365577029,1365576825,1365576283,1365575325,1365573470,1365571953,1365570430,1365570249,1365433556,1365408095,1365408042,1365406990,1365405729,1365149241,1364994248,1364987223,1361367235,1362503187,1362463292,1362454942,1362042089,1361929269]} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment