# HG changeset patch # User veltr # Date 1330451518 -3600 # Node ID 9d5d9e6b7fbfbee035be0051db730699e997d369 # Parent c8af52e4a047546295c06ca2f19549d88dc6a411 Created Home view for Hdalab diff -r c8af52e4a047 -r 9d5d9e6b7fbf web/hdalab/static/hdalab/css/common.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/hdalab/static/hdalab/css/common.css Tue Feb 28 18:51:58 2012 +0100 @@ -0,0 +1,95 @@ +@font-face +{ + font-family: "Open Sans"; src: url(OpenSans-Regular.ttf); +} + +@font-face +{ + font-family: "Open Sans"; font-weight: bold; src: url(OpenSans-Bold.ttf); +} + +@font-face +{ + font-family: "Open Sans"; font-style: italic; src: url(OpenSans-Italic.ttf); +} + +/* Browser-reset CSS */ + +html, body, div, span, applet, object, iframe, +h1, h2, h3, h4, h5, h6, p, blockquote, pre, +a, abbr, acronym, address, big, cite, code, +del, dfn, em, img, ins, kbd, q, s, samp, +small, strike, strong, sub, sup, tt, var, +b, u, i, center, +dl, dt, dd, ol, ul, li, +fieldset, form, label, legend, +table, caption, tbody, tfoot, thead, tr, th, td, +article, aside, canvas, details, embed, +figure, figcaption, footer, header, hgroup, +menu, nav, output, ruby, section, summary, +time, mark, audio, video { + margin: 0; + padding: 0; + border: 0; + font-size: 100%; + font: inherit; + vertical-align: baseline; +} + +input::-moz-focus-inner /*Remove button padding in FF*/ +{ + border: 0; + padding: 0; +} + +table { + border-collapse: separate; border-spacing: 0; +} + +th, td { + vertical-align: top; +} + +/* Body */ + +body { + font-family: "Open Sans", Arial, Helvetica, sans-serif; background: url(../img/bgdhdalab.png) top repeat-x #ffffff; color: #000000; font-size: 10px; +} + +input, textarea { + font-family: "Open Sans", Arial, Helvetica, sans-serif; background: transparent; +} + +a { + text-decoration: none; +} + +a:hover { + text-decoration: underline; +} + +/* Main container */ + +#container { + position: relative; width: 960px; margin: 0 auto; +} + +h1 { + margin: 5px 0 10px; font-size: 34px; color: #ffffff; +} + +#nav { + float: right; list-style: none; margin-top: 3px; +} + +#nav li { + float: left; font-size: 14px; margin-left: 10px; font-weight: bold; +} + +#nav a { + color: #ffffff; +} + +#nav a:hover { + color: #e07000; +} diff -r c8af52e4a047 -r 9d5d9e6b7fbf web/hdalab/static/hdalab/css/facettes.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/hdalab/static/hdalab/css/facettes.css Tue Feb 28 18:51:58 2012 +0100 @@ -0,0 +1,365 @@ +.barrebloc { + float: left; width: 473px; border: 1px solid #b0b0b0; + background-image: url(../img/bgdhdalab.png); background-position: 0 -22px; background-repeat: repeat-x; cursor: pointer; cursor: hand; + border-top-left-radius: 4px; border-top-right-radius: 4px +} + +.barrebloc h2 { + margin: 4px 0; font-size: 16px; text-align: center; color: #ffffff; font-weight: bold; +} + +.bloc, #bloc_gestvue { + float: left; width: 475px; margin-bottom: 10px; +} + +.corpsbloc { + float: left; width: 465px; border: 1px solid #b0b0b0; padding: 8px 4px; border-top-style: none; + background-color: #ffffff; background-image: url(../img/bgdhdalab.png); background-position: 0 -62px; background-repeat: repeat-x; + border-bottom-left-radius: 4px; border-bottom-right-radius: 4px +} + +#hdatitle { + float: left; width: 475px; margin: 5px 0; font-size: 20px; +} + +#sessionname { + color: #600000; font-size: 22px; +} + +#hdatitle .lectseul { + font-size: 17px; +} + +#hdatitle input { + display: inline; margin: 0; padding: 0; font-size: 18px; font-weight: bold; +} + +#apartager { + float: right; font-size: 14px; +} + +#vues { + float: right; text-align: right; width: 475px; margin: 2px 0; padding: 0; +} + +#vuestitre { + display: inline; padding: 2px 4px; font-size: 15px; +} + +#ongletsvues { + display: inline; list-style: none; margin: 0; padding: 0; +} + +li.lienvue { + display: inline; padding: 3px; font-size: 13px; font-weight: bold; +} + +.lienvue a, #apartager a { + color: #666666; +} + +.lienvue.actif a, #apartager.actif a { + color: #cc0066; +} + +#nouvellevue a { + font-weight: bold; color: #ff3000; font-size: 16px; +} + +#partageurls, #plusdevues { + float: right; text-align: right; clear: both; list-style: none; padding: 0; margin: 2px 0; + font-size: 13px; display: none; +} + +.myurl { + font-weight: bold; +} + +#timeline { + float: left; width: 100%; margin: 15px 0; +} + +#dates { + list-style: none; float: left; width: 100%; height: 0; padding: 0; margin: 0; +} + +#dates li { + position: absolute; width: 1px; height: 20px; background: rgba(0,0,0,.3); z-index: 2; margin: 0; padding: 0; +} + +div.datelabel { + width: 60px; margin: 4px 0 0 -30px; font-size: 10px; text-align: center; opacity: .8; +} + +#dateheat { + float: left; width: 100%; height: 20px; z-index: 1; +} + +.handle { + position: absolute; width: 0; z-index: 2; cursor: pointer; cursor: hand; +} + +.handleinner { + float: left; border: 5px solid #999; background: #fff; + height: 30px; width: 10px; margin-top: -10px; border-radius: 4px; + opacity: .8; +} + +.handleinner:hover { + background: #ccc; +} + +.ui-draggable-dragging .handleinner { + background: #660000; color: #ffffff; +} + +#leftcol { + float: left; width: 475px; margin-right: 5px; +} + +#bandefiltre { + float: left; width: 100%; margin-top: 10px; +} + +#filtertitle { + float: left; margin: 1px 0; padding: 0; font-size: 13px; font-weight: bold; +} + +#filters { + list-style: none; float: left; margin: 0 20px; padding: 0; font-size: 12px; +} + +#filters li { + float: left; padding: 2px 3px; margin-right: 5px; font-weight: bold; +} + +#filters a { + color: #666666; +} + +#filters li.nofilter { + font-style: italic; color: #ff3030; +} + +#filters li.filtag { + color: #ffffff; background: #000066; +} + +#filters li.filcountry { + color: #ffffff; background: #cc0066; +} + +#filters li.filperiod { + color: #ffffff; background: #e07000; +} + +span.spyr { + cursor: pointer; cursor: hand; +} + +.spyr input { + display: inline; margin: 0; padding: 0; font-size: 11px; +} + +#contentcount { + float: left; width: 100%; text-align: right; font-size: 13px; margin: 2px 0; +} + +#filters a.remfil { + color: #cccccc; margin-left: 2px; +} + +#map { + height: 250px; +} + +.leaflet-container { + background: #e3e9fd url(../img/bgmap.png); +} + +#tagcloud { + text-align: center; +} + +#tclist { + list-style: none; padding: 0; margin: 0; +} + +#tclist li { + display: inline-block; margin: 2px 5px; padding: 0; +} + +#tclist a { + color: #000000; +} + +#tclist a.tagmatch { + color: #0000cc; +} + +#tclist a:hover { + color: #800000; +} + + +#tagsearchwrap { + width: 50%; +} + +#tagsearch { + width: 100%; font-size: 16px; font-weight: bold; border-style: none; border-bottom: 1px solid #000; +} + +#tagsearch.grise { + color: #666; font-style: italic; font-weight: normal; +} + +#rightcol { + float: left; width: 475px; margin-left: 5px; +} + +#disciplines { + +} + +.disc-ul { + float: left; clear: both; list-style: none; +} + +.disc-li { + float: left; width: 230px; margin: 2px 0; +} + +.disc-label { + float: left; font-size: 13px; width: 100px; text-align: right; margin-right: 5px; line-height: 13px; +} + +.disc-bar { + float: left; height: 14px; margin: 2px 0; +} + +#contentlist { + list-style: none; padding: 0; margin: 0; +} + +li.content-item { + margin: 2px 0 12px; +} + +.content-item h3 { + font-size: 18px; margin: 3px 0; +} + +.content-item h4 { + font-size: 11px; margin: 3px 0; +} + +.content-item h4 a { + color: #000066; +} + +.maplet { + float: right; +} + +.content-item p { + font-size: 12px; margin: 3px 0; +} + +.content-annotation ul { + list-style : disc; margin: 2px 0; padding-left: 1.5em; font-size: 12px; + cursor: pointer; cursor: hand; +} + +.content-annotation li { + margin: 2px 0; +} + +.content-annotation textarea { + width: 99%; margin: 0; padding: 0; font-size: 12px; +} + +ul.content-tags { + list-style: none; padding: 0; margin: 0; +} + +li.content-tag-item { + display: inline-block; margin: 2px; padding: 2px; font-size: 13px; background: #666666; +} + +.content-tag-item a { + color: #ffffff; +} + +.content-tag-item a:hover { + color: #ff8080; +} + +.content-tag-item a.tagmatch { + color: #ffff00; font-weight: bold; +} + +#tagcount { + float: right; text-align: right; font-size: 14px; font-weight: bold; +} + +#taginfo p, h2, h3 { + margin: 5px 0; +} + +#taginfo h3 { + font-size: 14px; +} + +#taginfo p { + font-size: 11px; +} + +#img_wikipedia { + float: left; max-width: 160px; max-height: 120px; margin: 2px 2px 2px 0; +} + +#gestvue { + display: none; +} + +#div_titrevue { + margin: 5px 0; +} + +#div_titrevue label { + font-size: 14px; +} + +#titrevue { + font-size: 15px; margin: 0 0 0 5px; width: 220px; padding: 2px; border-style: none; border-bottom: 1px solid #000; +} + +#gestvue h4 { + margin: 2px 0; font-size: 14px; +} + +#widgetlist { + list-style: none; padding: 0; margin: 0; width: 100%; +} + +#widgetlist li { + float: left; width: 48%; +} + +#widgetlist label { + font-size: 13px; +} + +#notes ul { + font-size: 13px; margin: 0; padding-left: 1.5em; +} + +#notes textarea { + padding: 0; margin: 0; width: 99%; font-size: 13px; +} + +#lightboxbg { + position: absolute; left: 0; top: 0; bottom: 0; right: 0; + background: rgba(0,0,0,.5); z-index: 12; +} diff -r c8af52e4a047 -r 9d5d9e6b7fbf web/hdalab/static/hdalab/css/style.css --- a/web/hdalab/static/hdalab/css/style.css Tue Feb 28 11:43:29 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,383 +0,0 @@ -@font-face -{ - font-family: "Open Sans"; src: url(OpenSans-Regular.ttf); -} - -@font-face -{ - font-family: "Open Sans"; font-weight: bold; src: url(OpenSans-Bold.ttf); -} - -@font-face -{ - font-family: "Open Sans"; font-style: italic; src: url(OpenSans-Italic.ttf); -} - -body { - margin: 0; padding: 0; font-family: "Open Sans", Arial, Helvetica, sans-serif; - background: #ffffff; color: #000000; - font-size: 10px; -} - -input, textarea { - font-family: "Open Sans", Arial, Helvetica, sans-serif; -} - -a { - text-decoration: none; -} - -a:hover { - text-decoration: underline; -} - -#container { - position: relative; width: 960px; margin: 0 auto; -} - -.barrebloc { - float: left; width: 473px; border: 1px solid #b0b0b0; - background: #e0e0e0; cursor: pointer; cursor: hand; -} - -.barrebloc h2 { - margin: 4px 0; font-size: 16px; text-align: center; -} - -.bloc, #bloc_gestvue { - float: left; width: 475px; margin-bottom: 10px; -} - -.corpsbloc { - float: left; width: 465px; border: 1px solid #b0b0b0; padding: 8px 4px; border-top-style: none; -} - -h1 { - float: left; width: 475px; margin: 5px 0; font-size: 20px; -} - -#sessionname { - color: #600000; font-size: 22px; -} - -h1 .lectseul { - font-size: 17px; -} - -h1 input { - display: inline; margin: 0; padding: 0; font-size: 18px; font-weight: bold; -} - -#apartager { - float: right; font-size: 14px; -} - -#vues { - float: right; text-align: right; width: 475px; margin: 2px 0; padding: 0; -} - -#vuestitre { - display: inline; padding: 2px 4px; font-size: 15px; -} - -#ongletsvues { - display: inline; list-style: none; margin: 0; padding: 0; -} - -li.lienvue { - display: inline; padding: 3px; font-size: 13px; font-weight: bold; -} - -.lienvue a, #apartager a { - color: #666666; -} - -.lienvue.actif a, #apartager.actif a { - color: #990000; -} - -#nouvellevue a { - font-weight: bold; color: #ff3000; font-size: 16px; -} - -#partageurls, #plusdevues { - float: right; text-align: right; clear: both; list-style: none; padding: 0; margin: 2px 0; - font-size: 13px; display: none; -} - -.myurl { - font-weight: bold; -} - -#timeline { - float: left; width: 100%; margin: 15px 0; -} - -#dates { - list-style: none; float: left; width: 100%; height: 0; padding: 0; margin: 0; -} - -#dates li { - position: absolute; width: 1px; height: 20px; background: rgba(0,0,0,.3); z-index: 2; margin: 0; padding: 0; -} - -div.datelabel { - width: 60px; margin: 4px 0 0 -30px; font-size: 10px; text-align: center; opacity: .8; -} - -#dateheat { - float: left; width: 100%; height: 20px; z-index: 1; -} - -.handle { - position: absolute; width: 0; z-index: 2; cursor: pointer; cursor: hand; -} - -.handleinner { - float: left; border: 5px solid #999; background: #fff; - height: 30px; width: 10px; margin-top: -10px; border-radius: 4px; - opacity: .8; -} - -.handleinner:hover { - background: #ccc; -} - -.ui-draggable-dragging .handleinner { - background: #660000; color: #ffffff; -} - -#leftcol { - float: left; width: 475px; margin-right: 5px; -} - -#bandefiltre { - float: left; width: 100%; margin-top: 10px; -} - -#filtertitle { - float: left; margin: 1px 0; padding: 0; font-size: 13px; font-weight: bold; -} - -#filters { - list-style: none; float: left; margin: 0 20px; padding: 0; font-size: 12px; -} - -#filters li { - float: left; padding: 2px 3px; margin-right: 5px; font-weight: bold; -} - -#filters a { - color: #666666; -} - -#filters li.nofilter { - font-style: italic; color: #ff3030; -} - -#filters li.filtag { - color: #ffffff; background: #000066; -} - -#filters li.filcountry { - color: #ffffff; background: #cc0066; -} - -#filters li.filperiod { - color: #ffffff; background: #e07000; -} - -span.spyr { - cursor: pointer; cursor: hand; -} - -.spyr input { - display: inline; margin: 0; padding: 0; font-size: 11px; -} - -#contentcount { - float: left; width: 100%; text-align: right; font-size: 13px; margin: 2px 0; -} - -#filters a.remfil { - color: #cccccc; margin-left: 2px; -} - -#map { - height: 250px; -} - -#tagcloud { - text-align: center; -} - -#tclist { - list-style: none; padding: 0; margin: 0; -} - -#tclist li { - display: inline-block; margin: 2px 5px; padding: 0; -} - -#tclist a { - color: #000000; -} - -#tclist a.tagmatch { - color: #0000cc; -} - -#tclist a:hover { - color: #800000; -} - - -#tagsearchwrap { - width: 50%; -} - -#tagsearch { - width: 100%; font-size: 16px; font-weight: bold; border-style: none; border-bottom: 1px solid #000; -} - -#tagsearch.grise { - color: #666; font-style: italic; font-weight: normal; -} - -#rightcol { - float: left; width: 475px; margin-left: 5px; -} - -#disciplines { - height: 120px; -} - -#disciplines g { - cursor: pointer; cursor: hand; -} - -#contentlist { - list-style: none; padding: 0; margin: 0; -} - -li.content-item { - margin: 2px 0 12px; -} - -.content-item h3 { - font-size: 18px; margin: 3px 0; -} - -.content-item h4 { - font-size: 11px; margin: 3px 0; -} - -.content-item h4 a { - color: #000066; -} - -.maplet { - float: right; -} - -.content-item p { - font-size: 12px; margin: 3px 0; -} - -.content-annotation ul { - list-style : disc; margin: 2px 0; padding-left: 1.5em; font-size: 12px; - cursor: pointer; cursor: hand; -} - -.content-annotation li { - margin: 2px 0; -} - -.content-annotation textarea { - width: 99%; margin: 0; padding: 0; font-size: 12px; -} - -ul.content-tags { - list-style: none; padding: 0; margin: 0; -} - -li.content-tag-item { - display: inline-block; margin: 2px; padding: 2px; font-size: 13px; background: #666666; -} - -.content-tag-item a { - color: #ffffff; -} - -.content-tag-item a:hover { - color: #ff8080; -} - -.content-tag-item a.tagmatch { - color: #ffff00; font-weight: bold; -} - -#tagcount { - float: right; text-align: right; font-size: 14px; font-weight: bold; -} - -#taginfo p, h2, h3 { - margin: 5px 0; -} - -#taginfo h3 { - font-size: 14px; -} - -#taginfo p { - font-size: 11px; -} - -#img_wikipedia { - float: left; max-width: 160px; max-height: 120px; margin: 2px 2px 2px 0; -} - -#gestvue { - display: none; -} - -#div_titrevue { - margin: 5px 0; -} - -#div_titrevue label { - font-size: 14px; -} - -#titrevue { - font-size: 15px; margin: 0 0 0 5px; width: 220px; padding: 2px; border-style: none; border-bottom: 1px solid #000; -} - -#gestvue h4 { - margin: 2px 0; font-size: 14px; -} - -#widgetlist { - list-style: none; padding: 0; margin: 0; width: 100%; -} - -#widgetlist li { - float: left; width: 48%; -} - -#widgetlist label { - font-size: 13px; -} - -#notes ul { - font-size: 13px; margin: 0; padding-left: 1.5em; -} - -#notes textarea { - padding: 0; margin: 0; width: 99%; font-size: 13px; -} - -#lightboxbg { - position: absolute; left: 0; top: 0; bottom: 0; right: 0; - background: rgba(0,0,0,.5); z-index: 12; -} diff -r c8af52e4a047 -r 9d5d9e6b7fbf web/hdalab/static/hdalab/img/bgdhdalab.png Binary file web/hdalab/static/hdalab/img/bgdhdalab.png has changed diff -r c8af52e4a047 -r 9d5d9e6b7fbf web/hdalab/static/hdalab/img/bgmap.png Binary file web/hdalab/static/hdalab/img/bgmap.png has changed diff -r c8af52e4a047 -r 9d5d9e6b7fbf web/hdalab/static/hdalab/js/geojson_quickconv.js --- a/web/hdalab/static/hdalab/js/geojson_quickconv.js Tue Feb 28 11:43:29 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,64 +0,0 @@ -function polygon_to_gmap(polycoords, dbpedia_uri) { - var _opts = { - strokeColor: "#000000", - strokeWeight: .5, - fillColor: "#7070a0", - fillOpacity: .3 - } - _opts.paths = polycoords.map(function(path) { - return path.map(function(coord) { - return new google.maps.LatLng(coord[1], coord[0]); - }); - }); - var _polygon = new google.maps.Polygon(_opts); - _polygon.setMap(gomNs.map); - google.maps.event.addListener(_polygon, 'click', function(a,b) { - addFilter('country', dbpedia_uri); - }) - return _polygon; -} - -function showCountriesGmap(geoJson) { - gomNs.countries = {}; - _(geoJson.features).each(function(feature) { - var _el = { "properties" : feature.properties }; - if (feature.id == 'ATA') { - _el.gPolygons = []; - } else { - switch(feature.geometry.type) { - case('Polygon'): - _el.gPolygons = [ polygon_to_gmap(feature.geometry.coordinates, feature.properties.dbpedia_uri) ]; - break; - case('MultiPolygon'): - _el.gPolygons = feature.geometry.coordinates.map(function(polygon) { - return polygon_to_gmap(polygon, feature.properties.dbpedia_uri); - }) - break; - } - } - gomNs.countries[feature.properties.dbpedia_uri] = _el; - }); -} - -function showCountriesLeaflet(geoJson) { - gomNs.countries = {}; - var gJ = new L.GeoJSON(); - gJ.on('featureparse', function(_f) { - var isocode = _f.id; - _f.layer.setStyle({ - color: "#000000", - weight: .5, - fillColor: "#7070a0", - fillOpacity: .3 - }); - _f.layer.on('click', function() { - addFilter('country', _f.properties.dbpedia_uri); - }); - gomNs.countries[_f.properties.dbpedia_uri] = { - "properties" : _f.properties, - "layer" : _f.layer - } - }); - gJ.addGeoJSON(geoJson); - gomNs.map.addLayer(gJ); -} diff -r c8af52e4a047 -r 9d5d9e6b7fbf web/hdalab/static/hdalab/js/gomina.js --- a/web/hdalab/static/hdalab/js/gomina.js Tue Feb 28 11:43:29 2012 +0100 +++ b/web/hdalab/static/hdalab/js/gomina.js Tue Feb 28 18:51:58 2012 +0100 @@ -7,9 +7,12 @@ maxYear: 2010, tlPixels: 960, tlGamma: 6, - heatGamma: 4, - displayedDates: [-5000,0,500,1000,1200,1400,1600,1700,1750,1800,1850,1900,1950,2010], + heatGamma: 2, + displayedDates: [ -5000, 0, 500, 1000, 1200, 1400, 1600, 1700, 1750, 1800, 1850, 1900, 1950, 2010 ], mappingLibrary: 'leaflet', + gradientStart: [ 255, 255, 240 ], + gradientEnd: [ 255, 160, 30 ], + zeroColor: [ 230, 230, 235 ] } function yearToPx(year) { @@ -20,6 +23,84 @@ return gomNs.minYear + ( gomNs.maxYear - gomNs.minYear ) * Math.pow( px / gomNs.tlPixels, 1 / gomNs.tlGamma ); } +function getGradient(_pos) { + if (_pos == 0) { + var _rgb = gomNs.zeroColor; + } else { + var _rgb = [], + _exp = Math.pow(_pos, 1/gomNs.heatGamma); + for (var i=0; i<3; i++) { + _rgb.push(Math.floor(_exp*gomNs.gradientEnd[i] + (1-_exp)*gomNs.gradientStart[i])); + } + } + return "rgb(" + _rgb.join(",") + ")" +} + +function polygon_to_gmap(polycoords, dbpedia_uri) { + var _opts = { + strokeColor: "#000000", + strokeWeight: .5, + fillColor: "rgb(" + gomNs.zeroColor.join(",") + ")", + fillOpacity: 1 + } + _opts.paths = polycoords.map(function(path) { + return path.map(function(coord) { + return new google.maps.LatLng(coord[1], coord[0]); + }); + }); + var _polygon = new google.maps.Polygon(_opts); + _polygon.setMap(gomNs.map); + google.maps.event.addListener(_polygon, 'click', function(a,b) { + addFilter('country', dbpedia_uri); + }) + return _polygon; +} + +function showCountriesGmap(geoJson) { + gomNs.countries = {}; + _(geoJson.features).each(function(feature) { + var _el = { "properties" : feature.properties }; + if (feature.id == 'ATA') { + _el.gPolygons = []; + } else { + switch(feature.geometry.type) { + case('Polygon'): + _el.gPolygons = [ polygon_to_gmap(feature.geometry.coordinates, feature.properties.dbpedia_uri) ]; + break; + case('MultiPolygon'): + _el.gPolygons = feature.geometry.coordinates.map(function(polygon) { + return polygon_to_gmap(polygon, feature.properties.dbpedia_uri); + }) + break; + } + } + gomNs.countries[feature.properties.dbpedia_uri] = _el; + }); +} + +function showCountriesLeaflet(geoJson) { + gomNs.countries = {}; + var gJ = new L.GeoJSON(); + gJ.on('featureparse', function(_f) { + var isocode = _f.id; + _f.layer.setStyle({ + color: "#000000", + weight: .5, + fillOpacity: 1, + fillColor: "rgb(" + gomNs.zeroColor.join(",") + ")" + }); + _f.layer.on('click', function() { + addFilter('country', _f.properties.dbpedia_uri); + }); + gomNs.countries[_f.properties.dbpedia_uri] = { + "properties" : _f.properties, + "layer" : _f.layer + } + }); + gJ.addGeoJSON(geoJson); + gomNs.map.addLayer(gJ); +} + function tagInfo(_taglabel) { var _urlParam = { "label": _taglabel }; @@ -70,7 +151,6 @@ var _curView = gomNs.sessiondata.views[gomNs.sessiondata.view]; if (_curView.type == 'filter') { _curView[_type].push(_label); - console.log(_curView[_type]); updateFilters(); debouncedSaveChanges(); } @@ -320,23 +400,20 @@ } var _s = (data.count>1?'s':''); $("#contentcount").html(''+data.count+' notice'+_s); - var _sl = data.sparkline.length; - if (_sl) { - var _maxheat = _(data.sparkline).max(function(_d) { return parseInt(_d.score); }).score, - _exp = 1 / gomNs.heatGamma, - _scale = Math.pow(_maxheat, - _exp); - _(data.sparkline).each(function(_d, _i) { - var _nxt = (_i == _sl - 1) ? gomNs.maxYear + 1 : data.sparkline[_i + 1].year, - _x1 = yearToPx(_d.year), - _x2 = yearToPx(_nxt), - _heat = _scale * Math.pow(_d.score, _exp); - gomNs.dhmPaper.rect(_x1, 0, _x2 - _x1, 20).attr({ - "fill" : "rgb(255, 128, 128)", - "opacity" : _heat, - "stroke" : "none" - }) - }); + if (!data.sparkline.length || data.sparkline[0].year != gomNs.minYear) { + data.sparkline.splice(0,0,{"year": gomNs.minYear, "score": 0}); } + var _maxheat = _(data.sparkline).max(function(_d) { return parseInt(_d.score); }).score; + _(data.sparkline).each(function(_d, _i) { + var _nxt = (_i == data.sparkline.length - 1) ? (gomNs.maxYear + 1) : data.sparkline[_i + 1].year, + _x1 = yearToPx(_d.year), + _x2 = yearToPx(_nxt), + _heat = _d.score / _maxheat; + gomNs.dhmPaper.rect(_x1, 0, _x2 - _x1, 20).attr({ + "fill" : getGradient(_heat), + "stroke" : "none" + }) + }); if (gomNs.sessiondata.view == 0) { var _h0 = $("#handle_0").position().left, _h1 = $("#handle_1").position().left; @@ -371,22 +448,20 @@ var _max = Math.max(1, _(data.countries).max()); _(gomNs.countries).each(function(_country, _k) { var _val = data.countries[_k] || 0, - _gb = parseInt(255 * (1 - _val / _max )), - _fill = ( _val ? "rgb(255," + _gb + "," + _gb + ")" : "#7070a0" ), - _op = (_val ? .9 : .3); + _fill = getGradient(_val/_max); switch(gomNs.mappingLibrary) { case 'gmaps': _(_country.gPolygons).each(function(_p) { _p.setOptions({ "fillColor" : _fill, - "fillOpacity": _op + "fillOpacity" : 1 }); }); break; case 'leaflet': _country.layer.setStyle({ "fillColor" : _fill, - "fillOpacity": _op + "fillOpacity" : 1 }) break; } @@ -394,12 +469,30 @@ } if (data.disciplines) { var _disc = data.disciplines.filter(function(_d) { - return +_d.score > 0; - }), + return +_d.score > 0; + }), + _max = _disc.reduce(function(_a, _b) { + return Math.max(_a,_b.score) + }, 1); + $("#disciplines").html( + '