Re: [Simile-Widgets] I cant get these timelines to scroll together

2012-01-27 Thread Michael Nosal
Make sure that you are creating separate bandInfos for each timeline, not 
passing the same one to each call to create your new Timeline.
The centerVisibleDate depends on the ether being used for the band, and if you 
pass the same bandInfo objects to multiple timelines, they end up all using the 
same ether.

You might also find it easier to use a mediator pattern for synchronizing your 
timelines. You avoid having them refer to each other explicitly and can 
centralize the logic for how they interact. 
Super-trivial example:

function Mediator(listeners) {
  this._listeners = listeners;
  }

Mediator.prototype.sync = function(date) {
var i = this._listeners.length;
while (i--) {
this._listeners[i].getBand(0).setCenterVisibleDate(date);
}
}

var mediator = new Mediator([TEOI81A2X,XQK3K0LEY,VOY3K0LEW]);

TEOI81A2X.getBand(0).addOnScrollListener(function(band) {
  mediator.sync(band.getCenterVisibleDate());
});

XQK3K0LEY.getBand(0).addOnScrollListener(function(band) {
  mediator.sync(band.getCenterVisibleDate());
});

VOY3K0LEW.getBand(0).addOnScrollListener(function(band) {
  mediator.sync(band.getCenterVisibleDate());
});

--Mike

On Jan 26, 2012, at 8:45 PM, Jeff Roehl wrote:

 TEOI81A2X.getBand(0).addOnScrollListener(function(band) {
 Var centerDateXQK3K0LEY = band.getCenterVisibleDate();
 XQK3K0LEY.getBand(0).setCenterVisibleDate(centerDateXQK3K0LEY);
 });
 
 XQK3K0LEY.getBand(0).addOnScrollListener(function(band) {
 Var centerDateVOY3K0LEW = band.getCenterVisibleDate();
 VOY3K0LEW.getBand(0).setCenterVisibleDate(centerDateVOY3K0LEW);
 });
 
 VOY3K0LEW.getBand(0).addOnScrollListener(function(band) {
 Var centerDateTEOI81A2X = band.getCenterVisibleDate();
 TEOI81A2X.getBand(0).setCenterVisibleDate(centerDateTEOI81A2X);
 });
  

-- 
You received this message because you are subscribed to the Google Groups 
SIMILE Widgets group.
To post to this group, send email to simile-widgets@googlegroups.com.
To unsubscribe from this group, send email to 
simile-widgets+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/simile-widgets?hl=en.



Re: [Simile-Widgets] I cant get these timelines to scroll together

2012-01-27 Thread Jeff Roehl
Mr. Nosal,

You javascript guys are amazing.

Us database guys think having a programming language that is case sensitive is 
complete madness.

It has cost me many hours of frustration.

As the reason why my code didn't work is because my:

Var centerDateXQK3K0LEY = band.getCenterVisibleDate();

Where the command Var should be var.

It took one of my kids to spot this... I lost a whole day because of this...


Is there any way to avoid this type of mistake in the future, or do I have to 
waste many hours every time this type of thing occurs?

Javascript is so unforgiving with this type of thing, with no indication as to 
what the problem is.

I need a case sensitive programming language like a fish needs a bicycle. lol

 
Thanks 
Jeff Roehl
jroe...@yahoo.com
(818) 912-7530



 From: Michael Nosal mno...@mitre.org
To: simile-widgets@googlegroups.com 
Cc: simile-widgets-...@googlegroups.com 
simile-widgets-...@googlegroups.com 
Sent: Friday, January 27, 2012 9:03 AM
Subject: Re: [Simile-Widgets] I cant get these timelines to scroll together
 

Make sure that you are creating separate bandInfos for each timeline, not 
passing the same one to each call to create your new Timeline.
The centerVisibleDate depends on the ether being used for the band, and if you 
pass the same bandInfo objects to multiple timelines, they end up all using 
the same ether.


You might also find it easier to use a mediator pattern for synchronizing your 
timelines. You avoid having them refer to each other explicitly and can 
centralize the logic for how they interact. 
Super-trivial example:


function Mediator(listeners) {
  this._listeners = listeners;
  }


Mediator.prototype.sync = function(date) {
var i = this._listeners.length;
while (i--) {
this._listeners[i].getBand(0).setCenterVisibleDate(date);
}
}


var mediator = new Mediator([TEOI81A2X,XQK3K0LEY,VOY3K0LEW]);


TEOI81A2X.getBand(0).addOnScrollListener(function(band) {
  mediator.sync(band.getCenterVisibleDate());
});
            
XQK3K0LEY.getBand(0).addOnScrollListener(function(band) {
  mediator.sync(band.getCenterVisibleDate());
});
            
VOY3K0LEW.getBand(0).addOnScrollListener(function(band) {
  mediator.sync(band.getCenterVisibleDate());
});


--Mike


On Jan 26, 2012, at 8:45 PM, Jeff Roehl wrote:


TEOI81A2X.getBand(0).addOnScrollListener(function(band) {
Var centerDateXQK3K0LEY = band.getCenterVisibleDate();
XQK3K0LEY.getBand(0).setCenterVisibleDate(centerDateXQK3K0LEY);
});

XQK3K0LEY.getBand(0).addOnScrollListener(function(band) {
Var centerDateVOY3K0LEW = band.getCenterVisibleDate();
VOY3K0LEW.getBand(0).setCenterVisibleDate(centerDateVOY3K0LEW);
});

VOY3K0LEW.getBand(0).addOnScrollListener(function(band) {
Var centerDateTEOI81A2X = band.getCenterVisibleDate();
TEOI81A2X.getBand(0).setCenterVisibleDate(centerDateTEOI81A2X);
});
 

-- 
You received this message because you are subscribed to the Google Groups 
SIMILE Widgets group.
To post to this group, send email to simile-widgets@googlegroups.com.
To unsubscribe from this group, send email to 
simile-widgets+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/simile-widgets?hl=en.




-- 
You received this message because you are subscribed to the Google Groups 
SIMILE Widgets group.
To post to this group, send email to simile-widgets@googlegroups.com.
To unsubscribe from this group, send email to 
simile-widgets+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/simile-widgets?hl=en.



Re: [Simile-Widgets] I cant get these timelines to scroll together

2012-01-27 Thread Michael Nosal
Make sure you are using the developer's tools in your browser.
Firebug is essential for Firefox development. The developer console in Chrome 
and Safari is also very helpful. All produce an error on Var foo

JSLint.com is a tool that can be used for better understanding finer points of 
the language, though it is usually more strict about the language than is 
necessary.

--Mike

On Jan 27, 2012, at 12:22 PM, Jeff Roehl wrote:

 Mr. Nosal,
 
 You javascript guys are amazing.
 
 Us database guys think having a programming language that is case sensitive 
 is complete madness.
 
 It has cost me many hours of frustration.
 
 As the reason why my code didn't work is because my:
 
 Var centerDateXQK3K0LEY = band.getCenterVisibleDate();
 
 Where the command Var should be var.
 
 It took one of my kids to spot this... I lost a whole day because of this...
 
 Is there any way to avoid this type of mistake in the future, or do I have to 
 waste many hours every time this type of thing occurs?
 
 Javascript is so unforgiving with this type of thing, with no indication as 
 to what the problem is.
 
 I need a case sensitive programming language like a fish needs a bicycle. lol
  
 Thanks Jeff Roehl jroe...@yahoo.com (818) 912-7530

-- 
You received this message because you are subscribed to the Google Groups 
SIMILE Widgets group.
To post to this group, send email to simile-widgets@googlegroups.com.
To unsubscribe from this group, send email to 
simile-widgets+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/simile-widgets?hl=en.



Re: [Simile-Widgets] I cant get these timelines to scroll together

2012-01-27 Thread Jeff Roehl
When I use JSLint.com to find a bug, it gives me a whole list of stuff that has 
nothing to do with an app end error.

Presumably being picky about formatting.

Thus it tends to cloud the issue rather than illuminating it.

I have found http://jsbeautifier.org/ and Notepad++ useful though.

 All produce an error on Var foo

I didn't see this in Firebug, under Console - Errors.

Am I looking in the right place?

 
Thanks 
Jeff Roehl
jroe...@yahoo.com
(818) 912-7530




-- 
You received this message because you are subscribed to the Google Groups 
SIMILE Widgets group.
To post to this group, send email to simile-widgets@googlegroups.com.
To unsubscribe from this group, send email to 
simile-widgets+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/simile-widgets?hl=en.



Re: [Simile-Widgets] I cant get these timelines to scroll together

2012-01-27 Thread Jeff Roehl
Mr. Nosal and Oliver,

Is there an interactive way to reset hotzones?

First blank out the existing zones. Call layout(). Issue a new set of zones, 
and call layout() again. Or should I redeploy the complete timeline from 

new Timeline.DefaultEventSource();

Interactively would be sort of like this:

/*---*/

var bandInfosVOY3K0LEW = [
Timeline.createHotZoneBandInfo({
zones: [{}]
})];


VOY3K0LEW.layout();

var bandInfosVOY3K0LEW = [
Timeline.createHotZoneBandInfo({
zones: [
{ start: Jan 07 2012 00:00:00 GMT-0500,
    end: Jan 10 2012 00:00:00 GMT-0500,
 magnify: 5, 
 unit: Timeline.DateTime.YEAR},
{ start: Oct 01 1980 00:00:00 GMT-0500,
    end: Oct 04 1980 00:00:00 GMT-0500,
 magnify: 2, 
 unit: Timeline.DateTime.MONTH}]

})];


VOY3K0LEW.layout();


/*---*/

Thanks 
Jeff Roehl
jroe...@yahoo.com
(818) 912-7530




-- 
You received this message because you are subscribed to the Google Groups 
SIMILE Widgets group.
To post to this group, send email to simile-widgets@googlegroups.com.
To unsubscribe from this group, send email to 
simile-widgets+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/simile-widgets?hl=en.



Re: [Simile-Widgets] I cant get these timelines to scroll together

2012-01-27 Thread Michael Nosal

 
  All produce an error on Var foo
 
 I didn't see this in Firebug, under Console - Errors.
 
 Am I looking in the right place?


My mistake - you're right - it fails silently in Firefox 9.0.1.

--Mike



-- 
You received this message because you are subscribed to the Google Groups 
SIMILE Widgets group.
To post to this group, send email to simile-widgets@googlegroups.com.
To unsubscribe from this group, send email to 
simile-widgets+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/simile-widgets?hl=en.



Re: [Simile-Widgets] I cant get these timelines to scroll together

2012-01-27 Thread Jeff Roehl
 My mistake - you're right - it fails silently in Firefox 9.0.1.

Which makes this type of error almost impossible for a newbie like me to figure 
out.

I cant tell you how frustrating this is.

I like your fails silently. I have never heard it put that way before. lol


fails silently = your screwed.

or

fails silently = the rest of your day is shot

 
Thanks 
Jeff Roehl
jroe...@yahoo.com
(818) 912-7530



 From: Michael Nosal mno...@mitre.org
To: simile-widgets@googlegroups.com 
Sent: Friday, January 27, 2012 10:54 AM
Subject: Re: [Simile-Widgets] I cant get these timelines to scroll together
 





 All produce an error on Var foo


I didn't see this in Firebug, under Console - Errors.


Am I looking in the right place?


My mistake - you're right - it fails silently in Firefox 9.0.1.


--Mike






-- 
You received this message because you are subscribed to the Google Groups 
SIMILE Widgets group.
To post to this group, send email to simile-widgets@googlegroups.com.
To unsubscribe from this group, send email to 
simile-widgets+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/simile-widgets?hl=en.




-- 
You received this message because you are subscribed to the Google Groups 
SIMILE Widgets group.
To post to this group, send email to simile-widgets@googlegroups.com.
To unsubscribe from this group, send email to 
simile-widgets+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/simile-widgets?hl=en.



[Simile-Widgets] I cant get these timelines to scroll together

2012-01-26 Thread Jeff Roehl


Can you see the problem with the following code?

The 3 timelines refuse to scroll with each other. Fail to synchronize.



TEOI81A2X.getBand(0).addOnScrollListener(function(band) {
Var centerDateXQK3K0LEY = band.getCenterVisibleDate();
XQK3K0LEY.getBand(0).setCenterVisibleDate(centerDateXQK3K0LEY);
});

XQK3K0LEY.getBand(0).addOnScrollListener(function(band) {
Var centerDateVOY3K0LEW = band.getCenterVisibleDate();
VOY3K0LEW.getBand(0).setCenterVisibleDate(centerDateVOY3K0LEW);
});

VOY3K0LEW.getBand(0).addOnScrollListener(function(band) {
Var centerDateTEOI81A2X = band.getCenterVisibleDate();
TEOI81A2X.getBand(0).setCenterVisibleDate(centerDateTEOI81A2X);
});

 
Thanks 
Jeff Roehl
jroe...@yahoo.com
(818) 912-7530




-- 
You received this message because you are subscribed to the Google Groups 
SIMILE Widgets group.
To post to this group, send email to simile-widgets@googlegroups.com.
To unsubscribe from this group, send email to 
simile-widgets+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/simile-widgets?hl=en.