How to Run Timeplot Off-line

From SIMILE Widgets
Jump to: navigation, search

Timeplot depends on two other javascript programs: the Timeline widget and the SIMILE Ajax library. Under normal on-line operation, Timeplot knows exactly where to find those programs and fetches them directly from the web.

Unfortunately, this happens also when you copy the Timeplot source code and serve it off your own web site. It also means that it prevents you from running Timeplot off-line, since even if you copied all the necessary libraries as well, Timeplot will still look for them on the web.

Local Mode

But don't despair: here is how you tell Timeplot to act "local" and avoid looking for stuff on the web. Just append the "?local" string to the "timeplot-api.js" URL that you use to load Timeplot into your page, like this

 <script src="/path/to/your/own/timeplot/timeplot-api.js?local"></script>

Timeplot, upon loading, will react to the presence of that "?local" appendix and look for stuff locally.

Download the sources

Here is how you make a local copy of Timeplot that will work in off-line mode

 > cd /web/server/root/
 > svn co timeplot/api/1.0
 > svn co timeline/api-2.0
 > svn co     ajax/api-2.0

then add

  <script src="/timeplot/api/1.0/timeplot-api.js?local"></script>

to your HTML pages and you're done.

WARNING: the Timeplot sources can reside anywhere on your URL space, but Timeplot expects the Timeline and Ajax sources to be mounted in exactly those absolute locations in the URL space of your site.

(Note: this works for the latest trunk of timeplot, but not for the 1.0 branch. The instructions above will fetch the trunk)

Download the sources from GoogleCode does not seem to respond anymore, use this instead :

 > svn checkout ajax/api
 > svn checkout timeline/api
 > svn checkout timeplot/api

then add

   <script src="ajax/api/simile-ajax-api.js" type="text/javascript"></script>
   <script src="timeline/api/timeline-api.js" type="text/javascript"></script>
   <script src="timeplot/api/timeplot-api.js" type="text/javascript"></script>

to your HTML code, you do not need the ?local as it looks if you already loaded API and Timeline on your own (what we do here).

Personal tools