Hi Brice, There is a way, starting with Timeline 2.2 or 2.3 to have timeline automatically grow to display more tracks of events, as needed. One of timeline examples demonstrates this.
To use the feature with Exhibit, I think you'll need to manuially connect a timeline instance to exhibit. There ia a wiki page in exhibirt on how to do this. Or google this group. Regards, Larry Sent via BlackBerry from T-Mobile -----Original Message----- From: David Huynh <[email protected]> Date: Wed, 13 May 2009 21:14:42 To: <[email protected]> Subject: Re: Fwd: [Exhibit] Display Timeline according to the number of data Brice Sommacal wrote: > Hello everyone, > > I've recently started to use Exhibit with the timeline-view. And, I'm > a bit confused about how to set the right display; > > Is it possible to choose the timeline height according to the numbers > of data displayed? Unfortunately, no. But in future versions of Timeline, we'll support vertical scrolling. You can see the development version of that feature here http://simile-widgets.googlecode.com/svn/timeline/trunk/src/webapp/examples/compact-painter/compact-painter.html > For example, When I click on the timeline view, all my items are > displayed ( 40 at the mo) by default. So I set the height to 1200 with > /ex:timelineHeight="1200"/. > > But after I clicked on severals facets, I only need to see a few data > ( about 3 or 4) with a timeline height set to 400 . > > So, my question is if is it possible to modify the timeline height > dynamically according to the number of data? > > A snippet of code would be great to help me. Assuming that you're using the latest version of Exhibit, take a look at the timeline view's implementation http://api.simile-widgets.org/exhibit/2.2.0/extensions/time/scripts/timeline-view.js Look for Exhibit.TimelineView.prototype._reconstruct This function is called whenever the timeline needs to be updated. You could make a copy of it after including all exhibit's code (so that your copy overrides the default implementation) and modify the copy to do what you want. More specifically, after this chunk of code if (plottableSize > this._largestSize) { this._largestSize = plottableSize; this._reconstructTimeline(events); } else { this._eventSource.addMany(events); } the timeline should have laid out itself. Then you can get the number of track and resize the timeline: var trackCount = this._timeline.getBand(0)._tracks.length; this._dom.plotContainer.style.height = ... some expression here, ending with px ... this._timeline.layout(); David --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "SIMILE Widgets" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/simile-widgets?hl=en -~----------~----~----~----~------~----~------~--~---
