Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

Added other zoom levels

Taylor Gunnoe508f1e4fa67d
diff --git a/web/index.html b/web/index.html
index 0444c801c..c72fead09 100644
--- a/web/index.html
+++ b/web/index.html
@@ -161,7 +161,7 @@
<!-- link.dev --> <script type="text/javascript" src="js/date/wv.date.timeline.pick.js"></script>
<!-- link.dev --> <script type="text/javascript" src="js/date/wv.date.timeline.pan.js"></script>
<!-- link.dev --> <script type="text/javascript" src="js/date/wv.date.timeline.input.js"></script>
- <!-- link.dev --> <script type="text/javascript" src="js/date/wv.date.timeline.configure.js"></script>
+ <!-- link.dev --> <script type="text/javascript" src="js/date/wv.date.timeline.config.js"></script>
<!-- link.dev --> <script type="text/javascript" src="js/date/wv.date.wheels.js"></script>
diff --git a/web/js/date/wv.date.timeline.config.js b/web/js/date/wv.date.timeline.config.js
index 72ba18985..12d47ec45 100644
--- a/web/js/date/wv.date.timeline.config.js
+++ b/web/js/date/wv.date.timeline.config.js
@@ -12,7 +12,149 @@ wv.date.timeline.config = wv.date.timeline.config || function(models, config, ui
var tl = ui.timeline;
var model = models.date;
self.level1 = function(){
-/*
+ var altEnd, fNormData;
+ //format of the label
+ var labelFormat = d3.time.format.utc("%Y");
+ //printed type of tick
+ var dateInterval = d3.time.year.utc;
+ //step of the ticks
+ var dateStep = 1;
+ //number of ticks total of data range, in days
+ var tickCount = tl.data.end().getUTCFullYear() - tl.data.start().getUTCFullYear();
+
+ var tickCountMax;
+ //width in pixels of each tick
+ var tickWidth = 15;
+
+ //Max number of ticks able to be shown on this resolution
+ tickCountMax = Math.ceil(tl.width/tickWidth);
+
+ //end tick date if tickCount is less than tickCountMax
+ altEnd = new Date(tl.data.start().getUTCFullYear() + tickCountMax,
+ tl.data.start().getUTCMonth(),
+ tl.data.start().getUTCDate());
+
+ tl.zoom.drawTicks(tickCount,
+ tickCountMax,
+ altEnd,
+ tickWidth,
+ dateInterval,
+ dateStep,
+ labelFormat);
+
+
+ //Filters ticks for nonboundaries for this zoom level
+ tl.zoom.current.ticks.normal.all = function(){
+ tl.ticks.normal.all = tl.ticks.all.filter(function(d){
+ return d.getUTCFullYear() % 10 !== 0;
+ });
+ tl.ticks.normal.setEnds();
+ };
+
+ //Filters ticks for boundaries for this zoom level
+ tl.zoom.current.ticks.boundary.all = function(){
+ tl.ticks.boundary.all = tl.ticks.all.filter(function(d){
+ return d.getUTCFullYear() % 10 === 0;
+ });
+ };
+
+ //Calculated next boundary tick by date
+ tl.zoom.current.ticks.boundary.next = function(current){
+ var next = new Date(current);
+ return new Date(next.setUTCFullYear(next.getUTCFullYear()+10));
+ };
+
+ //Calculated next normal tick by date
+ tl.zoom.current.ticks.normal.next = function(current){
+ var next = new Date(current);
+ return new Date(next.setUTCFullYear(next.getUTCFullYear()+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(Math.floor(first.getUTCFullYear()/10)*10,
+ 0,
+ 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(Math.ceil(last.getUTCFullYear()/10)*10,
+ 0,
+ 1));
+ };
+
+ //Value for hovered normal label
+ tl.zoom.current.ticks.normal.hover = function(d){
+ //No modifications to date obj at this zoom level
+ return new Date(d.getUTCFullYear(),
+ model.selected.getUTCMonth(),
+ model.selected.getUTCDate());
+ };
+
+ //Value for clicked normal tick
+ tl.zoom.current.ticks.normal.clickDate = function(d){
+ return new Date(d.getUTCFullYear(),
+ model.selected.getUTCMonth(),
+ model.selected.getUTCDate());
+ };
+
+ //Value for hovered boundary tick
+ tl.zoom.current.ticks.boundary.hover = function(d){
+ var yearOffset = model.selected.getUTCFullYear() -
+ Math.ceil(new Date(model.selected.getUTCFullYear()/10)*10);
+
+ return new Date(d.getUTCFullYear() + yearOffset,
+ model.selected.getUTCMonth(),
+ model.selected.getUTCDate());
+ };
+
+ //Displayed default label
+ tl.zoom.current.ticks.boundary.label = function(d){
+ return d.getUTCFullYear();
+ };
+
+ //Displayed default sub-label (if any)
+ tl.zoom.current.ticks.boundary.subLabel = function(d){
+ return null;
+ };
+
+ //Value for clicked boundary tick, FIXME: This is exactly the same as hover value
+ tl.zoom.current.ticks.boundary.clickDate = function(d){
+ var yearOffset = model.selected.getUTCFullYear() -
+ Math.ceil(new Date(model.selected.getUTCFullYear()/10)*10);
+
+ return new Date(d.getUTCFullYear() + yearOffset,
+ model.selected.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() + 1,
+ model.selected.getUTCMonth(),
+ model.selected.getUTCDate()));
+ };
+
+ //When the date updates while dragging the pick backward
+ tl.zoom.current.pick.prevChange = function(d){
+ return new Date(Date.UTC(d.getUTCFullYear(),
+ model.selected.getUTCMonth(),
+ model.selected.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();
+ });
+ };
+
+ tl.ticks.check();
+ initTicks();
+ /*
tl.ticks.normalTicks = tl.ticks.all.filter(function(d){
return d.getUTCFullYear() % 10 !== 0;
});
@@ -25,20 +167,141 @@ wv.date.timeline.config = wv.date.timeline.config || function(models, config, ui
*/
};
self.level2 = function(){
-/*
- tl.ticks.normalTicks = tl.ticks.all.filter(function(d){
- return d.getUTCMonth() !== 0;
- });
+ var altEnd, fNormData;
+ //format of the label
+ var labelFormat = d3.time.format.utc("%Y");
+ //printed type of tick
+ var dateInterval = d3.time.month.utc;
+ //step of the ticks
+ var dateStep = 1;
+ //number of ticks total of data range, in days
+ var tickCount = (tl.data.end().getUTCFullYear() - tl.data.start().getUTCFullYear()) * 12 +
+ tl.data.end().getUTCMonth() + 1 - tl.data.start().getUTCMonth();
- tl.ticks.boundaryTicks = tl.ticks.all.filter(function(d){
- return d.getUTCMonth() === 0;
- });
+ var tickCountMax;
+ //width in pixels of each tick
+ var tickWidth = 11;
+
+ //Max number of ticks able to be shown on this resolution
+ tickCountMax = Math.ceil(tl.width/tickWidth);
+
+ //end tick date if tickCount is less than tickCountMax
+ altEnd = new Date(tl.data.start().getUTCFullYear(),
+ tl.data.start().getUTCMonth() + tickCountMax,
+ tl.data.start().getUTCDate());
+
+ tl.zoom.drawTicks(tickCount,
+ tickCountMax,
+ altEnd,
+ tickWidth,
+ dateInterval,
+ dateStep,
+ labelFormat);
+
+
+ //Filters ticks for nonboundaries for this zoom level
+ tl.zoom.current.ticks.normal.all = function(){
+ tl.ticks.normal.all = tl.ticks.all.filter(function(d){
+ return d.getUTCMonth() !== 0;
+ });
+ tl.ticks.normal.setEnds();
+ };
+
+ //Filters ticks for boundaries for this zoom level
+ tl.zoom.current.ticks.boundary.all = function(){
+ tl.ticks.boundary.all = tl.ticks.all.filter(function(d){
+ return d.getUTCMonth() === 0;
+ });
+ };
+
+ //Calculated next boundary tick by date
+ tl.zoom.current.ticks.boundary.next = function(current){
+ var next = new Date(current);
+ return new Date(next.setUTCFullYear(next.getUTCFullYear()+1));
+ };
+
+ //Calculated next normal tick by date
+ tl.zoom.current.ticks.normal.next = function(current){
+ var next = new Date(current);
+ return new Date(next.setUTCMonth(next.getUTCMonth()+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(),
+ 0,
+ 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()+1,
+ 0,
+ 1));
+ };
+
+ //Value for hovered normal label
+ tl.zoom.current.ticks.normal.hover = function(d){
+ //No modifications to date obj at this zoom level
+ return new Date(d.getUTCFullYear(),d.getUTCMonth(),model.selected.getUTCDate());
+ };
+
+ //Value for clicked normal tick
+ tl.zoom.current.ticks.normal.clickDate = function(d){
+ return new Date(d.getUTCFullYear(),d.getUTCMonth(),model.selected.getUTCDate());
+ };
+
+ //Value for hovered boundary tick
+ tl.zoom.current.ticks.boundary.hover = function(d){
+ return new Date(d.getUTCFullYear(),model.selected.getUTCMonth(),model.selected.getUTCDate());
+ };
+
+ //Displayed default label
+ tl.zoom.current.ticks.boundary.label = function(d){
+ return d.getUTCFullYear();
+ };
+
+ //Displayed default sub-label (if any)
+ tl.zoom.current.ticks.boundary.subLabel = function(d){
+ return null;
+ };
+
+ //Value for clicked boundary tick
+ tl.zoom.current.ticks.boundary.clickDate = function(d){
+ return new Date(d.getUTCFullYear(),model.selected.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()+1,model.selected.getUTCDate()));
+ };
+
+ //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(),model.selected.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());
+ });
+ };
+
+ tl.ticks.check();
+ initTicks();
+ /*
var protoData = new Date(Date.UTC(tl.ticks.all.data[0].getUTCFullYear(),
tl.ticks.all.data[0].getUTCMonth()-1,
1));
- tl.ticks.refresh('month','year');*/
+ tl.ticks.refresh('month','year');
+
+ */
};
self.level3 = function(){
var altEnd,
@@ -64,12 +327,12 @@ wv.date.timeline.config = wv.date.timeline.config || function(models, config, ui
tl.data.start().getUTCDate() + tickCountMax);
tl.zoom.drawTicks(tickCount,
- tickCountMax,
- altEnd,
- tickWidth,
- dateInterval,
- dateStep,
- labelFormat);
+ tickCountMax,
+ altEnd,
+ tickWidth,
+ dateInterval,
+ dateStep,
+ labelFormat);
//Filters ticks for nonboundaries that have the following attribute
tl.zoom.current.ticks.normal.all = function(){
@@ -98,6 +361,22 @@ wv.date.timeline.config = wv.date.timeline.config || function(models, config, ui
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 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
@@ -166,7 +445,7 @@ wv.date.timeline.config = wv.date.timeline.config || function(models, config, ui
var init = function(){
//Default zoom
- self.level3();
+ self.level2();
};
init();
diff --git a/web/js/date/wv.date.timeline.ticks.js b/web/js/date/wv.date.timeline.ticks.js
index 3ea41f614..7a1fad09d 100644
--- a/web/js/date/wv.date.timeline.ticks.js
+++ b/web/js/date/wv.date.timeline.ticks.js
@@ -41,18 +41,16 @@ wv.date.timeline.ticks = wv.date.timeline.ticks || function(models, config, ui)
self.firstDate = self.all.data()[0];
self.lastDate = self.all.data()[self.all.data().length-1];
//remove previous classes for labels
- self.all.classed('tick-labeled',false).classed('label-only',false);
+ self.all.classed('tick-labeled',false);//.classed('label-only',false);
};
self.normal = {
setEnds: function(){
- //FIXME: this is actually the ends of all ticks,
- //not just the normal ticks.
var all = self.normal.all;
self.normal.firstDate = all.data()[0];
self.normal.firstElem = all[0][0];
self.normal.lastDate = all.data()[all.data().length-1];
- self.normal.lastElem = all[0][all.length-1];
+ self.normal.lastElem = all[0][all[0].length-1];
},
update: function(){
var ticks = self.normal.all;
@@ -291,14 +289,21 @@ wv.date.timeline.ticks = wv.date.timeline.ticks || function(models, config, ui)
}
};
+
+ // compare the first and last ticks with the first and last
+ // dates of data range, if they exceed it, add these ticks
self.compare = function(proto, end){
+ console.log(self.firstDate);
+ console.log(' > ' + tl.data.start());
if(self.firstDate > tl.data.start()){
//the data and what element to insert it before
//probably a better way of doing this
- self.add(proto, 'g.tick');
+ console.log('first yep');
+ //self.add(proto, 'g.tick');
}
if(self.lastDate <= wv.util.today()){
- self.add(end, 'path.domain');
+ console.log('yep');
+ //self.add(end, 'path.domain');
}
};
self.add = function(data, elem){
@@ -375,51 +380,47 @@ wv.date.timeline.ticks = wv.date.timeline.ticks || function(models, config, ui)
self.check = function(){
var first, last, proto, end;
- tl.ticks.setAll();
+ self.setAll();
//Checks to see if all of the ticks fit onto the timeline space
//and if so check to see that first and last major ticks are printed
if(!tl.isCropped){
- first = tl.ticks.firstDate;
- last = tl.ticks.lastDate;
+ first = self.firstDate;
+ last = self.lastDate;
proto = new Date(Date.UTC(first.getUTCFullYear(),
first.getUTCMonth(),
first.getUTCDate()-1));
end = new Date(Date.UTC(last.getUTCFullYear(),
last.getUTCMonth(),
last.getUTCDate()+1));
- tl.ticks.compare(proto, end);
+ self.compare(proto, end);
}
//set normal ticks
tl.zoom.current.ticks.normal.all();
//FIXME: Section below is terrible {
//For determining needed boundary ticks
- if($(tl.ticks.normal.firstElem).is(':nth-child(2)')){
- first = tl.ticks.normal.firstDate;
- proto = new Date(Date.UTC(first.getUTCFullYear(),
- first.getUTCMonth(),
- 1));
- tl.ticks.add(proto, 'g.tick');
+ self.all.classed('label-only',false);
+
+ if($(self.normal.firstElem).is(':nth-child(2)')){
+ proto = tl.zoom.current.ticks.boundary.first();
+ self.add(proto, 'g.tick');
}
//FIXME: Passing from d3 to jQuery to d3 in order to check if its the last tick elem. WAT.
- if(d3.select($(tl.ticks.normal.lastElem)
+ if(d3.select($(self.normal.lastElem)
.next()[0]).classed('domain')){
- last = tl.ticks.normal.lastDate;
- end = new Date(Date.UTC(last.getUTCFullYear()+1,
- last.getUTCMonth()+1,
- 1));
- tl.ticks.add(end, 'path.domain');
+ end = tl.zoom.current.ticks.boundary.last();
+ self.add(end, 'path.domain');
}
// } End terrible
- tl.ticks.setAll();
+ self.setAll();
//update boundary ticks
tl.zoom.current.ticks.boundary.all();
- tl.ticks.boundary.all.classed('tick-labeled',true);
+ self.boundary.all.classed('tick-labeled',true);
};
diff --git a/web/js/date/wv.date.timeline.zoom.js b/web/js/date/wv.date.timeline.zoom.js
index 900f1d173..ab428c5a2 100644
--- a/web/js/date/wv.date.timeline.zoom.js
+++ b/web/js/date/wv.date.timeline.zoom.js
@@ -82,6 +82,8 @@ wv.date.timeline.zoom = wv.date.timeline.zoom || function(models, config, ui) {
var update = function(d1, d2, r1, r2, i, s, f){
+
+
tl.x.domain([d1,d2])
.range([r1,r2]);
@@ -99,6 +101,8 @@ wv.date.timeline.zoom = wv.date.timeline.zoom || function(models, config, ui) {
tl.pan.toSelection();
//??need to remove first?
+ tl.axis.selectAll('.tick').remove();
+
tl.axis.call(tl.xAxis);
};
@@ -111,228 +115,3 @@ wv.date.timeline.zoom = wv.date.timeline.zoom || function(models, config, ui) {
init();
return self;
};
-
-/**
- * Modify zoom levels here. Maybe this isnt the best way to do this.
- * It could be called just level without the zoom part instead.
- *
- * When the zoom level is changed, this re renders everything of the timeline.
- *
- * @class wv.date.timeline.zoom.lvl
- */
-
-//TODO: Maybe reorganize this somewhere else/in another file
-wv.date.timeline.zoom.lvl = wv.date.timeline.zoom.lvl || function(models, config, ui) {
- var self = {};
- var tl = ui.timeline;
- var model = models.date;
- self.level1 = function(){
-/*
- tl.ticks.normalTicks = tl.ticks.all.filter(function(d){
- return d.getUTCFullYear() % 10 !== 0;
- });
-
- tl.ticks.boundaryTicks = tl.ticks.all.filter(function(d){
- return d.getUTCFullYear() % 10 === 0;
- });
-
- tl.ticks.refresh('year','decade');
- */
- };
- self.level2 = function(){
-/*
- tl.ticks.normalTicks = tl.ticks.all.filter(function(d){
- return d.getUTCMonth() !== 0;
- });
-
- tl.ticks.boundaryTicks = tl.ticks.all.filter(function(d){
- return d.getUTCMonth() === 0;
- });
-
- var protoData = new Date(Date.UTC(tl.ticks.all.data[0].getUTCFullYear(),
- tl.ticks.all.data[0].getUTCMonth()-1,
- 1));
-
- tl.ticks.refresh('month','year');*/
- };
- self.level3 = function(){
- var altEnd,
- fNormData,
- //format of the label
- labelFormat = d3.time.format.utc("%b"),
- //printed type of tick
- dateInterval = d3.time.day.utc,
- //step of the ticks
- dateStep = 1,
- //number of ticks total of data range, in days
- tickCount = (tl.data.end() - tl.data.start())/1000/60/60/24,
- tickCountMax,
- //width in pixels of each tick
- tickWidth = 11;
-
- //Max number of ticks able to be shown on this resolution
- tickCountMax = Math.ceil(tl.width/tickWidth);
-
- //end tick date if tickCount is less than tickCountMax
- 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);
-
- //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));
- };
-
- //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()));
- });
- };
-
- self.configure();
- initTicks();
-
- };
-
- self.configure = function(){
- var first, last, proto, end;
- tl.ticks.setAll();
-
- //Checks to see if all of the ticks fit onto the timeline space
- //and if so check to see that first and last major ticks are printed
- if(!tl.isCropped){
- first = tl.ticks.firstDate;
- last = tl.ticks.lastDate;
- proto = new Date(Date.UTC(first.getUTCFullYear(),
- first.getUTCMonth(),
- first.getUTCDate()-1));
- end = new Date(Date.UTC(last.getUTCFullYear(),
- last.getUTCMonth(),
- last.getUTCDate()+1));
- tl.ticks.compare(proto, end);
- }
- //set normal ticks
- tl.zoom.current.ticks.normal.all();
-
- //FIXME: Section below is terrible {
- //For determining needed boundary ticks
- if($(tl.ticks.normal.firstElem).is(':nth-child(2)')){
- first = tl.ticks.normal.firstDate;
- proto = new Date(Date.UTC(first.getUTCFullYear(),
- first.getUTCMonth(),
- 1));
- tl.ticks.add(proto, 'g.tick');
- }
-
- //FIXME: Passing from d3 to jQuery to d3 in order to check if its the last tick elem. WAT.
- if(d3.select($(tl.ticks.normal.lastElem)
- .next()[0]).classed('domain')){
- last = tl.ticks.normal.lastDate;
- end = new Date(Date.UTC(last.getUTCFullYear()+1,
- last.getUTCMonth()+1,
- 1));
- tl.ticks.add(end, 'path.domain');
- }
- // } End terrible
-
- tl.ticks.setAll();
-
- //update boundary ticks
- tl.zoom.current.ticks.boundary.all();
-
- tl.ticks.boundary.all.classed('tick-labeled',true);
-
- };
-
- var initTicks = function(){
- tl.ticks.boundary.init();
- tl.ticks.normal.init();
- tl.ticks.normal.set(); //could probably combine set and bind
- tl.ticks.normal.bind();
- tl.ticks.boundary.set();
- tl.ticks.boundary.bind();
- };
-
- var init = function(){
-
- //Default zoom
- self.level3();
- };
-
- init();
- return self;
-};
diff --git a/web/js/wv.main.js b/web/js/wv.main.js
index 27816142f..56573adaf 100644
--- a/web/js/wv.main.js
+++ b/web/js/wv.main.js
@@ -159,7 +159,7 @@ $(function() {
ui.timeline.ticks = wv.date.timeline.ticks(models, config, ui);
ui.timeline.pick = wv.date.timeline.pick(models, config, ui);
ui.timeline.pan = wv.date.timeline.pan(models, config, ui);
- ui.timeline.configure = wv.date.timeline.zoom.lvl(models, config, ui);
+ ui.timeline.config = wv.date.timeline.config(models, config, ui);
ui.timeline.input = wv.date.timeline.input(models, config, ui);
ui.dateLabel = wv.date.label(models);
ui.dateWheels = wv.date.wheels(models, config);