Skip to content

Instantly share code, notes, and snippets.

@magneticnorth
Created March 24, 2016 19:13
Show Gist options
  • Save magneticnorth/b6f48498209bf4313717 to your computer and use it in GitHub Desktop.
Save magneticnorth/b6f48498209bf4313717 to your computer and use it in GitHub Desktop.
Nobel Prize Winners
{
"domID": "#demo_Browser",
"itemName": "Laureates",
"source": {
"gdocId": "0Ai6LdDWgaqgNdDNVcXlscjl4RzRZNl9ZSkNJLU1DWVE",
"tables": [
{
"name": "Prizes",
"id": "id"
},
{
"name": "Laureates",
"id": "id"
}
],
"url": "https://docs.google.com/spreadsheets/d/0Ai6LdDWgaqgNdDNVcXlscjl4RzRZNl9ZSkNJLU1DWVE"
},
"summaries": [
{
"name": "Category",
"panel": "left",
"catLabel": "function (){ return this.id+\" \"+getIcon(this.id); }"
},
{
"name": "Born Country",
"panel": "left",
"value": "function (){ return kshf.dt_id.Laureates[this.laureate_id].data.bornCountry; }"
},
{
"name": "Joint Awards",
"panel": "left",
"catLabel": "function () { return this.id+\" awardee\"+(this.id===1?\"\":\"s\"); }"
},
{
"name": "Gender",
"panel": "left",
"value": "function (){ return kshf.dt_id.Laureates[this.laureate_id].data.gender; }",
"catLabel": {
"1": "Male <i class='fa fa-male'></i>",
"2": "Female <i class='fa fa-female'></i>",
"3": "Organization <i class='fa fa-university'></i>"
}
},
{
"name": "Affiliation",
"panel": "right",
"value": "function (){ return kshf.dt_id.Laureates[this.laureate_id].data.name; }"
},
{
"name": "Overall Motivation",
"panel": "right"
},
{
"name": "Year",
"panel": "bottom",
"value": "function (){ return new Date(this.Year,1,1); }",
"intervalScale": "time"
}
],
"leftPanelLabelWidth": 120,
"rightPanelLabelWidth": 190,
"middlePanelLabelWidth": 190,
"recordDisplay": {
"displayType": "grid",
"textSearch": "name",
"recordView": "function (){\n var laureate = kshf.dt_id.Laureates[this.laureate_id];\n var surname_short = (laureate.data.surname||\"\").toLowerCase().replace(/ /g,\"_\");\n surname_short = surname_short.replace(\"von_\",\"\").replace(\"la_\",\"\");\n var fullname = laureate.data.firstname + \" \" + (laureate.data.surname||\"\");\n var imgUrl=\"\";\n if(laureate.data.gender!==3){\n imgUrl = \"http://www.cs.umd.edu/~yalcin/keshif_res/nobel_photo/\"+surname_short+\".jpg\";\n }\n return \"<span class='thumbnail'><img class='thumbImg' src='\"+imgUrl+\"'></span>\"+\n \"<b>\"+fullname+\"</b>\"+\n \"<div style='text-align: center;'>\"+\n \"<span styke='font-size: 0.8em;'>\"+getIcon(this.Category)+\" \"+this.Category+\"</span> \"+\n //getIcon(getGender(laureate.data.gender))+\n \"</div>\";\n }",
"sortBy": "Year",
"detailsToggle": "zoom"
}
}
.theLabel > .fa{
width: 15px;
text-align: center;
}
.kshfRecord{ width: 130px; }
.content{
padding: 3px;
text-align: center;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment