Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

WV-1079 padding for tick overflow + some fixes with hover labels

Taylor Gunnoe76783247d377
diff --git a/web/css/new-ui.css b/web/css/new-ui.css
index 9af2b4cfd..69c92349c 100644
--- a/web/css/new-ui.css
+++ b/web/css/new-ui.css
@@ -117,6 +117,7 @@ g.plot rect.data-bar-invisible{
}
#timeline-header{
margin-top:2px;
+ width:250px;
}
#timeline-header .input-wrapper{
background: transparent;
@@ -260,9 +261,9 @@ display:inline-block;}
float:left;
}
#timeline-footer{
- display: inline-block;
height:65px;
- margin-left:0px;
+ border-left:1px solid #333;
+ border-right:1px solid #333;
}
#timeline-footer svg {
diff --git a/web/js/date/wv.date.timeline.js b/web/js/date/wv.date.timeline.js
index bd55d3aae..17e3bb764 100644
--- a/web/js/date/wv.date.timeline.js
+++ b/web/js/date/wv.date.timeline.js
@@ -36,9 +36,9 @@ wv.date.timeline = wv.date.timeline || function(models, config, ui) {
var mousedown = false;
var margin = {
top: 0,
- right: 0,
+ right: 30,
bottom: 20,
- left: 10
+ left: 30
};
/* Click or mousedown? */
@@ -50,7 +50,10 @@ wv.date.timeline = wv.date.timeline || function(models, config, ui) {
};
var width;
- var getTimelineWidth = function(){width = window.innerWidth - $("#timeline-header").outerWidth() - $("#timeline-zoom").outerWidth() - $("#timeline-hide").outerWidth() - 40;};
+
+ var getTimelineWidth = function(){
+ width = $(window).outerWidth(true) - $("#timeline-header").outerWidth(true) - $("#timeline-zoom").outerWidth(true) - $("#timeline-hide").outerWidth(true)-margin.left-margin.right - 22 //margin left + right + 1px border * 2
+ };
var height = 65 - margin.top - margin.bottom;
var monthNames = [ "JAN", "FEB", "MAR", "APR", "MAY", "JUN",
@@ -251,10 +254,10 @@ wv.date.timeline = wv.date.timeline || function(models, config, ui) {
if ( self.enabled ) {
getTimelineWidth();
d3.select('#timeline-footer svg')
- .attr('width', width + margin.left + margin.right);
- d3.select('#timeline-boundary rect').attr('width',width+margin.left+margin.right);
- d3.select('#guitarpick-boundary rect').attr('width',width+margin.left+margin.right);
- timeline.select(".x.axis line:first-child").attr("x2",width+10);
+ .attr('width', width);// + margin.left + margin.right);
+ d3.select('#timeline-boundary rect').attr('width',width);//+margin.left+margin.right);
+ d3.select('#guitarpick-boundary rect').attr('width',width+margin.left+margin.right);//+margin.left+margin.right);
+ timeline.select(".x.axis line:first-child").attr("x2",width);//+margin.left+margin.right);
setZoom(zoomLvl);
}
@@ -1007,7 +1010,7 @@ wv.date.timeline = wv.date.timeline || function(models, config, ui) {
.attr("transform", "translate(0," + height + ")")
.insert("line",":first-child")
.attr("x1",0)
- .attr("x2",width);
+ .attr("x2",width);//+margin.left+margin.right);
timeline.select(".x.axis")
@@ -1283,23 +1286,24 @@ wv.date.timeline = wv.date.timeline || function(models, config, ui) {
//create timeline elements
d3.select('#timeline-footer')
.append("svg:svg")
- .attr('width', width + margin.left + margin.right)
+ .attr('width', width)// + margin.left + margin.right)
.attr('height', height + margin.top + margin.bottom)
.call(zoom)
.append("svg:defs")
.append("svg:clipPath")
.attr("id","timeline-boundary")
.append("svg:rect")
- .attr('width', width + margin.left + margin.right)
+ .attr('width', width)// + margin.left + margin.right)
.attr('height', height + margin.top + margin.bottom);
d3.select("#timeline-footer svg defs")
.append("svg:clipPath")
.attr("id","guitarpick-boundary")
.append("svg:rect")
- .attr('width', width + margin.left + margin.right)
+ .attr('width', width+margin.left+margin.right)// + margin.left + margin.right)
.attr('height', height + margin.top + margin.bottom)
- .attr("y","-16");
+ .attr("y","-16")
+ .attr("x",-margin.left);
timeline = d3.select("#timeline-footer svg")
.append("svg:g")
@@ -1311,7 +1315,7 @@ wv.date.timeline = wv.date.timeline || function(models, config, ui) {
.attr("transform", "translate(0," + height + ")")
.insert("line",":first-child")
.attr("x1",0)
- .attr("x2",width);
+ .attr("x2",width);//+margin.left+margin.right);
zoom.translate([width/2 - x(model.selected),0]); //go to selected date
@@ -1390,6 +1394,7 @@ wv.date.timeline = wv.date.timeline || function(models, config, ui) {
.on("mouseup",function(){
mousedown = false;
guitarPick.classed('pick-clicked',false);
+
});
//update date when sliding guitarpick across small axis
@@ -1446,6 +1451,7 @@ wv.date.timeline = wv.date.timeline || function(models, config, ui) {
if (mousedown){
mousedown = false;
guitarPick.classed('pick-clicked',false);
+ unHoverTick();
}
});
////////////////////////////End Timeline/////////////////////////////////////
@@ -1758,6 +1764,8 @@ wv.date.timeline = wv.date.timeline || function(models, config, ui) {
updateTime();
resizeWindow();
wv.ui.mouse.wheel($("#timeline-footer svg")).change(zoomed);
+ $('#timeline-footer').css('margin-left',margin.left-1 + 'px');
+ $('#timeline-footer').css('margin-right',margin.right-1 + 'px');
}; // end init()
var forwardNextDay = function(){ //FIXME: Limit animation correctly
var nextDay = new Date(new Date(model.selected)