Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

WV-1073 Removed weeks zoom levels and renamed other levels

Taylor Gunnoea806ecd5eaee
diff --git a/web/css/new-ui.css b/web/css/new-ui.css
index d43a05115..36c9ba715 100644
--- a/web/css/new-ui.css
+++ b/web/css/new-ui.css
@@ -289,7 +289,7 @@ display:inline-block;}
#timeline-zoom a.zoom-btn.depth-1{
color:#ffffff;
font-size:1.5em;
- line-height:1.5em;
+ line-height:1.4em;
}
#timeline-zoom a.zoom-btn.depth-2{
color:#999999;
@@ -297,8 +297,8 @@ display:inline-block;}
line-height:1em;
}
#timeline-zoom a.zoom-btn.depth-3{
- color:#222;
- font-size:0.7em;
+ color:#666;
+ font-size:0.8em;
line-height:1em;
}
#timeline-zoom a.zoom-btn.depth-4{
diff --git a/web/index.html b/web/index.html
index 8503f5fca..ab7c7f102 100644
--- a/web/index.html
+++ b/web/index.html
@@ -286,10 +286,10 @@
</div><!--/timeline-footer-->
<div id="timeline-zoom">
- <a class="zoom-btn" id="zoom-weeks">Weeks</a>
+ <!--<a class="zoom-btn" id="zoom-weeks">Weeks</a>-->
+ <a class="zoom-btn" id="zoom-days">Days</a>
<a class="zoom-btn" id="zoom-months">Months</a>
<a class="zoom-btn" id="zoom-years">Years</a>
- <a class="zoom-btn" id="zoom-decades">Decades</a>
</div><!--/timeline-zoom-->
<div id="timeline-hide">
<svg class="hamburger" width="10" height="9">
diff --git a/web/js/date/wv.date.timeline.js b/web/js/date/wv.date.timeline.js
index 685e00d08..842896c9a 100644
--- a/web/js/date/wv.date.timeline.js
+++ b/web/js/date/wv.date.timeline.js
@@ -598,47 +598,48 @@ wv.date.timeline = wv.date.timeline || function(models, config, ui) {
};
var setZoomBtns = function(interval){
switch (interval){
- case 'week':
- case 3:
- $('.zoom-btn').removeClass(function (index, css) {
- return (css.match (/(^|\s)depth-\S+/g) || []).join(' ');
- }).css("margin","").css("font-size","");
- $('#zoom-decades').addClass("depth-4");
- $('#zoom-years').addClass("depth-3").css("margin","5px 0 0 0");
- $('#zoom-months').addClass("depth-2");
- $('#zoom-weeks').addClass("depth-1").css("margin","25px 0 0 0");
+ case 'week':
+ case 3:
+ $('.zoom-btn').removeClass(function (index, css) {
+ return (css.match (/(^|\s)depth-\S+/g) || []).join(' ');
+ }).css("margin","").css("font-size","");
+ $('#zoom-years').addClass("depth-4");
+ $('#zoom-months').addClass("depth-3").css("margin","5px 0 0 0");
+ $('#zoom-days').addClass("depth-2");
+ //$('#zoom-weeks').addClass("depth-1").css("margin","25px 0 0 0");
break;
-
- case 'month':
- case 2:
- $('.zoom-btn').removeClass(function (index, css) {
- return (css.match (/(^|\s)depth-\S+/g) || []).join(' ');
- }).css("margin","").css("font-size","");
- $('#zoom-decades').addClass("depth-3").css("margin","5px 0 0 0");
- $('#zoom-years').addClass("depth-2");
- $('#zoom-months').addClass("depth-1");
- $('#zoom-weeks').addClass("depth-2").css("margin","10px 0 0 0");
+
+ case 'days':
+ case 2:
+ $('.zoom-btn').removeClass(function (index, css) {
+ return (css.match (/(^|\s)depth-\S+/g) || []).join(' ');
+ }).css("margin","").css("font-size","");
+ $('#zoom-years').addClass("depth-3").css("margin","6px 0 0 0");
+ $('#zoom-months').addClass("depth-2");
+ $('#zoom-days').addClass("depth-1").css("margin", "10px 0 0 0").css('font-size','1.8em');
+ //$('#zoom-weeks').addClass("depth-2").css("margin","10px 0 0 0");
break;
-
- case 'year':
- case 1:
- $('.zoom-btn').removeClass(function (index, css) {
- return (css.match (/(^|\s)depth-\S+/g) || []).join(' ');
- }).css("margin","").css("font-size","");
- $('#zoom-decades, #zoom-months').addClass("depth-2");
- $('#zoom-years').addClass("depth-1").css("font-size","1.7em");
- $('#zoom-weeks').addClass("depth-3").css("margin","-3px 0 3px 0");
+
+ case 'months':
+ case 1:
+ $('.zoom-btn').removeClass(function (index, css) {
+ return (css.match (/(^|\s)depth-\S+/g) || []).join(' ');
+ }).css("margin","").css("font-size","");
+ $('#zoom-days').addClass("depth-2").css("margin","5px 0 0 0");
+ $('#zoom-years').addClass("depth-2");
+ $('#zoom-months').addClass("depth-1").css("font-size","1.7em");
+ //$('#zoom-weeks').addClass("depth-3").css("margin","-3px 0 3px 0");
break;
-
- case 'decade':
- case 0:
- $('.zoom-btn').removeClass(function (index, css) {
- return (css.match (/(^|\s)depth-\S+/g) || []).join(' ');
- }).css("margin","").css("font-size","");
- $('#zoom-decades').addClass("depth-1");
- $('#zoom-years').addClass("depth-2").css("font-size","1.2em");
- $('#zoom-months').addClass("depth-3").css("margin","-3px 0 5px 0");
- $('#zoom-weeks').addClass("depth-4");
+
+ case 'years':
+ case 0:
+ $('.zoom-btn').removeClass(function (index, css) {
+ return (css.match (/(^|\s)depth-\S+/g) || []).join(' ');
+ }).css("margin","").css("font-size","");
+ $('#zoom-years').addClass("depth-1");
+ $('#zoom-months').addClass("depth-2").css("font-size","1.2em");
+ $('#zoom-days').addClass("depth-3").css("margin","-3px 0 5px 0");
+ //$('#zoom-weeks').addClass("depth-4");
}
};
var removeLabelOnlyStuff = function(){
@@ -713,7 +714,7 @@ wv.date.timeline = wv.date.timeline || function(models, config, ui) {
setZoomBtns(interval);
switch (interval){
- case 'decade':
+ case 'years':
case 0:
tw = 150/10;
//Each tick is one year, see how many there are until xExtent
@@ -741,7 +742,7 @@ wv.date.timeline = wv.date.timeline || function(models, config, ui) {
zoomLvl = 0;
break;
- case 'year':
+ case 'months':
case 1:
tw = 150/12;
@@ -770,9 +771,9 @@ wv.date.timeline = wv.date.timeline || function(models, config, ui) {
zoomLvl = 1;
break;
- case 'month': //FIXME: needs to be fixed for being tooSmall
+ case 'days': //FIXME: needs to be fixed for being tooSmall
case 2:
- tw = 7;
+ tw = 11;
//Each tick is one year, see how many there are until xExtent
numberOfTicks = (extEndDate - extStartDate)/1000/60/60/24;
@@ -1194,12 +1195,10 @@ wv.date.timeline = wv.date.timeline || function(models, config, ui) {
timeline.select(".x.axis")
.call(xAxis); //update view after translate
- setZoom('year');
+ setZoom('months');
//initial setup of zoom buttons FIXME: make this much better
- $('#zoom-decades, #zoom-months').addClass("depth-2");
- $('#zoom-years').addClass("depth-1").css("font-size","1.7em");
- $('#zoom-weeks').addClass("depth-3").css("margin","-3px 0 3px 0");
+ setZoomBtns('months');
//draw vertical ticks
verticalAxis = timeline.append("svg:g")
@@ -1560,28 +1559,28 @@ wv.date.timeline = wv.date.timeline || function(models, config, ui) {
});
///////////////////////////End Datepicker////////////////////////////////////
////////////////////////////Click bindings///////////////////////////////////
- d3.select("#zoom-decades").on("click",function(d){
+ d3.select("#zoom-years").on("click",function(d){
$('.zoom-btn').removeClass("zoom-btn-selected");
$(this).addClass("zoom-btn-selected");
- setZoom('decade');
+ setZoom('years');
});
- d3.select("#zoom-years").on("click",function(d){
+ d3.select("#zoom-months").on("click",function(d){
$('.zoom-btn').removeClass("zoom-btn-selected");
$(this).addClass("zoom-btn-selected");
- setZoom('year');
+ setZoom('months');
});
- d3.select("#zoom-months").on("click",function(d){
+ d3.select("#zoom-days").on("click",function(d){
$('.zoom-btn').removeClass("zoom-btn-selected");
$(this).addClass("zoom-btn-selected");
- setZoom('month');
+ setZoom('days');
});
- d3.select("#zoom-weeks").on("click",function(d){
+ /*d3.select("#zoom-weeks").on("click",function(d){
$('.zoom-btn').removeClass("zoom-btn-selected");
$(this).addClass("zoom-btn-selected");
setZoom('week');
- });
+ });*/
$('#timeline-hide').click(function() { self.toggle(); });
@@ -1657,7 +1656,7 @@ wv.date.timeline = wv.date.timeline || function(models, config, ui) {
position += deltaY;
if ( position < 0 ) {
- if ( zoomLvl < 3 ) {
+ if ( zoomLvl < 2 ) {
setZoom.call(this, zoomLvl + 1);
position = threshold - Math.abs(position % threshold);
} else {
@@ -1672,8 +1671,8 @@ wv.date.timeline = wv.date.timeline || function(models, config, ui) {
position = threshold;
}
}
- else {
- if ( !(tooSmall) ) {
+ else {
+ if ( !(tooSmall) ) { //pan by mousedown and drag
redrawAxis();
}
}