Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

Remove hourly step, adjust styles to select all times

ZachTRicec2ab748c7b8d
diff --git a/web/css/timeline.css b/web/css/timeline.css
index b1b7ca4bf..b89cc5ca4 100644
--- a/web/css/timeline.css
+++ b/web/css/timeline.css
@@ -349,9 +349,9 @@ g.plot rect.data-bar-invisible {
#timeline-zoom {
display: inline-block;
vertical-align: middle;
- overflow-y: scroll;
+ overflow-y: hidden;
height: 65px;
- width: 100px;
+ width: 136px;
box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
@@ -368,26 +368,26 @@ g.plot rect.data-bar-invisible {
#timeline-zoom a.zoom-btn.depth-1 {
color: #fff;
- font-size: 1.5em;
- line-height: 1.4em;
+ font-size: 18px;
+ line-height: 20px;
}
#timeline-zoom a.zoom-btn.depth-2 {
color: #999;
- font-size: 1em;
- line-height: 1em;
+ font-size: 14px;
+ line-height: 16px;
}
#timeline-zoom a.zoom-btn.depth-3 {
color: #666;
- font-size: 0.8em;
- line-height: 1em;
+ font-size: 12px;
+ line-height: 14px;
}
#timeline-zoom a.zoom-btn.depth-4 {
color: #666;
- font-size: 0.8em;
- line-height: 1em;
+ font-size: 10px;
+ line-height: 14px;
}
#timeline-zoom a.zoom-btn:hover {
diff --git a/web/index.html b/web/index.html
index 109048885..a611c3a4a 100644
--- a/web/index.html
+++ b/web/index.html
@@ -135,7 +135,6 @@ Licensed under the NASA Open Source Agreement, Version 1.3 (http://opensource.gs
</div><!--/timeline-footer-->
<div id="timeline-zoom">
<a class="zoom-btn" id="zoom-minutes">Minutes</a>
- <a class="zoom-btn" id="zoom-hours">Hours</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>
diff --git a/web/js/date/config.js b/web/js/date/config.js
index cb8b47806..5fce749a4 100644
--- a/web/js/date/config.js
+++ b/web/js/date/config.js
@@ -189,20 +189,13 @@ export function timelineConfig(models, config, ui) {
.css('margin', '')
.css('font-size', '');
$('#zoom-years')
- .addClass('depth-1')
- .css('font-size', '1.7em');
+ .addClass('depth-1');
$('#zoom-months')
- .addClass('depth-2')
- .css('font-size', '1.2em');
+ .addClass('depth-2');
$('#zoom-days')
- .addClass('depth-3')
- .css('margin', '-3px 0 5px 0');
- $('#zoom-hours')
- .addClass('depth-4')
- .css('margin', '-3px 0 5px 0');
+ .addClass('depth-3');
$('#zoom-minutes')
- .addClass('depth-4')
- .css('margin', '-3px 0 5px 0');
+ .addClass('depth-4');
self.currentZoom = 1;
break;
@@ -363,17 +356,11 @@ export function timelineConfig(models, config, ui) {
$('#zoom-years')
.addClass('depth-2');
$('#zoom-months')
- .addClass('depth-1')
- .css('font-size', '1.7em');
+ .addClass('depth-1');
$('#zoom-days')
- .addClass('depth-2')
- .css('margin', '5px 0 0 0');
- $('#zoom-hours')
- .addClass('depth-3')
- .css('margin', '5px 0 0 0');
+ .addClass('depth-2');
$('#zoom-minutes')
- .addClass('depth-4')
- .css('margin', '5px 0 0 0');
+ .addClass('depth-3');
self.currentZoom = 2;
break;
@@ -541,22 +528,18 @@ export function timelineConfig(models, config, ui) {
.css('margin', '')
.css('font-size', '');
$('#zoom-years')
- .addClass('depth-3')
- .css('margin', '6px 0 0 0');
+ .addClass('depth-3');
$('#zoom-months')
.addClass('depth-2');
$('#zoom-days')
- .addClass('depth-1')
- .css('margin', '8px 0 0 0')
- .css('font-size', '1.8em');
- $('#zoom-hours')
- .addClass('depth-2');
+ .addClass('depth-1');
$('#zoom-minutes')
- .addClass('depth-3');
+ .addClass('depth-2');
self.currentZoom = 3;
break;
- case 4: // Hour
+
+ case 4: // 10-Minute
labelFormat = d3.time.format.utc('%b');
dateInterval = d3.time.day.utc;
tickCount = (tl.data.end() - tl.data.start()) / 1000 / 60 / 60 / 24 / 60;
@@ -720,202 +703,17 @@ export function timelineConfig(models, config, ui) {
.css('margin', '')
.css('font-size', '');
$('#zoom-years')
- .addClass('depth-4')
- .css('margin', '6px 0 0 0');
+ .addClass('depth-4');
$('#zoom-months')
.addClass('depth-3');
$('#zoom-days')
.addClass('depth-2');
- $('#zoom-hours')
- .addClass('depth-1')
- .css('margin', '8px 0 0 0')
- .css('font-size', '1.8em');
$('#zoom-minutes')
- .addClass('depth-2');
+ .addClass('depth-1');
self.currentZoom = 4;
break;
- case 5: // Minute
- labelFormat = d3.time.format.utc('%b');
- dateInterval = d3.time.day.utc;
- tickCount = (tl.data.end() - tl.data.start()) / 1000 / 60 / 60 / 24 / 60;
- tickWidth = 11;
- tickCountMax = Math.ceil(tl.width / tickWidth);
-
- paddedRange = [
- new Date(tl.data.start().setUTCDate(tl.data.start().getUTCDate() - 15)),
- new Date(tl.data.end().setUTCDate(tl.data.end().getUTCDate() + 15))
- ];
-
- altEnd = new Date(tl.data.start()
- .getUTCFullYear(),
- tl.data.start()
- .getUTCMonth(),
- tl.data.start()
- .getUTCDate() + tickCountMax);
-
- tl.zoom.drawTicks(tickCount,
- tickCountMax,
- altEnd,
- tickWidth,
- dateInterval,
- dateStep,
- labelFormat,
- event,
- paddedRange);
-
- // Filters ticks for nonboundaries that have the following attribute
- tl.zoom.current.ticks.normal.all = function () {
- tl.ticks.normal.all = tl.ticks.all.filter(function (d) {
- return d.getUTCDate() !== 1;
- });
- tl.ticks.normal.setEnds();
- };
-
- // Filters ticks for boundaries that have the following attribute
- tl.zoom.current.ticks.boundary.all = function () {
- tl.ticks.boundary.all = tl.ticks.all.filter(function (d) {
- return d.getUTCDate() === 1;
- });
- };
-
- // Calculated next boundary tick by date
- tl.zoom.current.ticks.boundary.next = function (current) {
- var next = new Date(current);
- return new Date(next.setUTCMonth(next.getUTCMonth() + 1));
- };
-
- // Calculated next normal tick by date
- tl.zoom.current.ticks.normal.next = function (current) {
- var next = new Date(current);
- return new Date(next.setUTCDate(next.getUTCDate() + 1));
- };
-
- // Date of first printed boundary interval of this zoom level
- tl.zoom.current.ticks.boundary.first = function () {
- var first = tl.ticks.normal.firstDate;
- return new Date(Date.UTC(first.getUTCFullYear(),
- first.getUTCMonth(),
- 1));
- };
-
- // Date of first printed normal tick
- tl.zoom.current.ticks.normal.first = function () {
- var first = tl.ticks.normal.firstDate;
- return new Date(Date.UTC(first.getUTCFullYear(),
- first.getUTCMonth(),
- first.getUTCDate() - 1));
- };
-
- // Date of last printed boundary interval of this zoom level
- tl.zoom.current.ticks.boundary.last = function () {
- var last = tl.ticks.normal.lastDate;
- return new Date(Date.UTC(last.getUTCFullYear(),
- last.getUTCMonth() + 1,
- 1));
- };
-
- // Value for hovered normal label
- tl.zoom.current.ticks.normal.hover = function (d) {
- // No modifications to date obj at this zoom level
- return d;
- };
-
- // Value for clicked normal tick
- tl.zoom.current.ticks.normal.clickDate = function (d) {
- return new Date(d.getUTCFullYear(),
- d.getUTCMonth(),
- d.getUTCDate());
- };
-
- // Value for hovered boundary tick
- tl.zoom.current.ticks.boundary.hover = function (d) {
- return new Date(d.getUTCFullYear(),
- d.getUTCMonth(),
- model.selected.getUTCDate());
- };
-
- // Displayed default label
- tl.zoom.current.ticks.boundary.label = function (d) {
- return model.monthAbbr[d.getUTCMonth()];
- };
-
- // Displayed default sub-label (if any)
- tl.zoom.current.ticks.boundary.subLabel = function (d) {
- return d.getUTCFullYear();
- };
-
- // Value for clicked boundary tick
- tl.zoom.current.ticks.boundary.clickDate = function (d) {
- return new Date(d.getUTCFullYear(),
- d.getUTCMonth(),
- model.selected.getUTCDate());
- };
-
- // When the date updates while dragging the pick forward
- tl.zoom.current.pick.nextChange = function (d) {
- return new Date(Date.UTC(d.getUTCFullYear(),
- d.getUTCMonth(),
- d.getUTCDate() + 1));
- };
-
- // When the date updates while dragging the pick backward
- tl.zoom.current.pick.prevChange = function (d) {
- return new Date(Date.UTC(d.getUTCFullYear(),
- d.getUTCMonth(),
- d.getUTCDate()));
- };
-
- tl.zoom.current.pick.hoverTick = function (newDate) {
- tl.zoom.current.pick.hoveredTick = d3.selectAll('.x.axis>g.tick')
- .filter(function (d) {
- return (d.getUTCFullYear() === newDate.getUTCFullYear()) &&
- (d.getUTCMonth() === newDate.getUTCMonth() &&
- (d.getUTCDate() === newDate.getUTCDate()));
- });
- };
-
- d3.selectAll('.x.axis > g.tick')
- .each(function () {
- var currentTick = d3.select(this);
- var currentTickData = currentTick.data()[0];
- if ((currentTickData.getUTCDay() === 0) &&
- (currentTickData.getUTCDate() !== 1)) {
- currentTick
- .insert('line', 'rect')
- .attr('y1', 0)
- .attr('y2', -10)
- .attr('x2', 0)
- .classed('tick-week', true);
- }
- });
-
- // Update placement of zoom buttons
- $('.zoom-btn')
- .removeClass(function (index, css) {
- return (css.match(/(^|\s)depth-\S+/g) || [])
- .join(' ');
- })
- .css('margin', '')
- .css('font-size', '');
- $('#zoom-years')
- .addClass('depth-4')
- .css('margin', '6px 0 0 0');
- $('#zoom-months')
- .addClass('depth-4');
- $('#zoom-days')
- .addClass('depth-3');
- $('#zoom-hours')
- .addClass('depth-2');
- $('#zoom-minutes')
- .addClass('depth-1')
- .css('margin', '8px 0 0 0')
- .css('font-size', '1.8em');
-
- self.currentZoom = 5;
- break;
-
default:
console.log('Invalid Zoom level');
}
@@ -966,21 +764,13 @@ export function timelineConfig(models, config, ui) {
.addClass('zoom-btn-selected');
self.zoom(3);
});
- d3.select('#zoom-hours')
- .on('click', function (d) {
- $('.zoom-btn')
- .removeClass('zoom-btn-selected');
- $(this)
- .addClass('zoom-btn-selected');
- self.zoom(4);
- });
d3.select('#zoom-minutes')
.on('click', function (d) {
$('.zoom-btn')
.removeClass('zoom-btn-selected');
$(this)
.addClass('zoom-btn-selected');
- self.zoom(5);
+ self.zoom(4);
});
// Default zoom
self.zoom(zoomLevel);
diff --git a/web/js/date/timeline.js b/web/js/date/timeline.js
index 819e4f5fb..762ff666d 100644
--- a/web/js/date/timeline.js
+++ b/web/js/date/timeline.js
@@ -29,8 +29,7 @@ export function timeline(models, config, ui) {
.outerWidth(true) -
$('#timeline-hide')
.outerWidth(true) -
- self.margin.left - self.margin.right - 22;
-
+ self.margin.left - self.margin.right - 2;
return self.width;
};
@@ -199,7 +198,7 @@ export function timeline(models, config, ui) {
$timelineFooter.css('margin-right', self.margin.right - 1 + 'px');
} else {
$timelineFooter.css('margin-left', '10px');
- $timelineFooter.css('margin-right', (self.margin.right + self.margin.left) - 14 + 'px');
+ $timelineFooter.css('margin-right', (self.margin.right + self.margin.left) - 34 + 'px');
}
self.x = d3.time.scale.utc();
diff --git a/web/js/util/util.js b/web/js/util/util.js
index 7fee9ad63..b73ae60a9 100644
--- a/web/js/util/util.js
+++ b/web/js/util/util.js
@@ -285,9 +285,6 @@ export default (function (self) {
case 'minute':
newDate.setUTCDate(newDate.getUTCDate() + amount);
break;
- case 'hour':
- newDate.setUTCDate(newDate.getUTCDate() + amount);
- break;
case 'day':
newDate.setUTCDate(newDate.getUTCDate() + amount);
break;