I actually try to get the described Timeline working within the context of the Semantic Mediawiki extension, which allows to specify the Simile Timeline as output format. As it basically generates the HTML code (like bandinfos) on the fly it makes it difficult to show a meaningful example (although I don't think that something is wrong at this step as Timelines show correct (see Q1 on http://mbi.molgen.mpg.de:14195/mbi/mediawiki/index.php/Testtimeline) as long as I use the normal timeline and not those in the /ext/ folder (see Q1a on http://mbi.molgen.mpg.de:14195/mbi/mediawiki/index.php/Testtimeline1)
I therefore generated now a HTML file which uses the same scripts although I'm not sure if it's similar enough as I get now a different error: Error: Timeline.DetailedEventPainter is not a constructor Source File: http://malariabase.molgen.mpg.de/mbi/mediawiki/extensions/SemanticMediaWiki/skins/SimileTimeline/ext/genomeannotation/scripts/genomeannotation.js Line: 37 The example file can be seen here: http://malariabase.molgen.mpg.de/mbi/mediawiki/testga.html The source is: <html> <head> <title>Genomeannotation Example</title> <script type="text/javascript" src="/mbi/mediawiki/extensions/SemanticMediaWiki/skins/SimileTimeline/timeline-api.js"></script> <script type="text/javascript" src="/mbi/mediawiki/extensions/SemanticMediaWiki/skins/SimileTimeline/ext/genomeannotation/genomeannotation-api.js"></script> </head> <script> var tl; function onLoad() { var eventSource = new Timeline.DefaultEventSource(new Timeline.EventIndex(Timeline.genomeannotationUnit)); var bandInfos = [ Timeline.genomeannotation.createBandInfo({ eventSource: eventSource, width: "50%", intervalUnit: Timeline.genomeannotation.BASE, intervalPixels: 50 }), Timeline.Planning.createBandInfo({ width: "25%", intervalUnit: Timeline.genomeannotation.KILOBASE, intervalPixels: 10, showEventText: false }), Timeline.Planning.createBandInfo({ width: "25%", intervalUnit: Timeline.genomeannotation.MEGABASE, intervalPixels: 10, showEventText: false }) ]; bandInfos[1].syncWith = 0; bandInfos[1].highlight = true; bandInfos[2].syncWith = 1; bandInfos[2].highlight = true; tl = Timeline.create(document.getElementById("tl"), bandInfos, Timeline.HORIZONTAL, Timeline.genomeannotationUnit); } var resizeTimerID = null; function onResize() { if (resizeTimerID == null) { resizeTimerID = window.setTimeout(function() { resizeTimerID = null; tl.layout(); }, 500); } } </script> </head> <body onload="onLoad();" onresize="onResize();"> <div id="body"> <h1>GA Example</h1> <div id="tl" class="timeline-default" style="height: 400px;"> </div> </div> </body> </html> The file genomeannotation.js looks like this: /*================================================== * Genomeannotation *================================================== */ Timeline.genomeannotation = new Object(); Timeline.genomeannotation.createBandInfo = function(params) { var theme = ("theme" in params) ? params.theme : Timeline.getDefaultTheme(); var eventSource = ("eventSource" in params) ? params.eventSource : null; var ether = new Timeline.LinearEther({ centersOn: ("date" in params) ? params.date : Timeline.genomeannotationUnit.makeDefaultValue(), interval: 1, pixelsPerInterval: params.intervalPixels }); var etherPainter = new Timeline.genomeannotationEtherPainter({ intervalUnit: params.intervalUnit, multiple: ("multiple" in params) ? params.multiple : 1, align: params.align, theme: theme }); var eventPainterParams = { theme: theme }; if ("trackHeight" in params) { eventPainterParams.trackHeight = params.trackHeight; } if ("trackGap" in params) { eventPainterParams.trackGap = params.trackGap; } var eventPainter = ("overview" in params && params.overview) ? new Timeline.OverviewEventPainter(eventPainterParams) : new Timeline.DetailedEventPainter(eventPainterParams); return { width: params.width, eventSource: eventSource, timeZone: ("timeZone" in params) ? params.timeZone : 0, ether: ether, etherPainter: etherPainter, eventPainter: eventPainter }; }; Thanks, Gu Quoting David Huynh <[EMAIL PROTECTED]>: > Gu, > > It'd be best if you can put your (broken) timeline up on some public URL > where I can look at and see what's gone wrong. > > David > > [EMAIL PROTECTED] wrote: > > Hi, > > I try to get a Timeline extension working. It's similar to the existing > > 'planning' extension and I basically have copied and modified those files > in a > > new folder /ext/myextension. > > Right now I only try to get the bands and units displayed without any > events. > > > > While the bands appear I get stuck with the error: > > Error: date.getTime is not a function > > Source File: /SimileTimeline/scripts/util/date-time.js > > Line: 191 > > > > which is triggered by the line > > var date2 = new Date(date.getTime() + timeShift); > > in the function Timeline.DateTime.roundDownToInterval > > > > As far as I can see this function is called in the file > > /SimileTimeline/scripts/ether-painters.js > > > > The error actually occurs also when I try to use the unchanged 'planning' > files > > instead of 'myextension' files. > > > > I'm rather unsure if the problem might be > > a) that this general ether-painters.js file is used as I somehow would > have > > expected that the special ether-painters.js file in > > /SimileTimeline/ext/myextension/scripts/ether-painters.js > > would be used instead > > > > b) that the units I use (and also 'planning' if I'm right) are self defined > and > > not DateTime.(YEAR etc.) (and maybe therfore the 'date' variable isn't of > type > > Date and so has no getTime function?) > > > > c) something else > > > > I have the following in my <header>: > > <script type="text/javascript" > src="/SimileTimeline/timeline-api.js"></script> > > <script type="text/javascript" > > src="/SimileTimeline/ext/myextension/myextension-api.js"></script> > > > > and the timeline is created with > > Timeline.create(div, bandInfos, Timeline.HORIZONTAL, myextensionUnit); > > > > Thanks for any hints, > > Gu > > > > > > _______________________________________________ > > General mailing list > > [email protected] > > http://simile.mit.edu/mailman/listinfo/general > > > > _______________________________________________ > General mailing list > [email protected] > http://simile.mit.edu/mailman/listinfo/general > _______________________________________________ General mailing list [email protected] http://simile.mit.edu/mailman/listinfo/general
