Hi Ryan,

We have another web API called Exhibit that provides filtering, and 
sorting, on Timeline as well as Google Maps and other views:

    http://simile.mit.edu/exhibit/

Does that address your need?

-----

However, if you want to stick to Timeline, Timeline does provide a more 
primitive mechanism for filtering and highlighting. For instance, in 
this example

    http://simile.mit.edu/timeline/examples/jfk/jfk.html

you can filter and highlight events containing whichever text you type 
into those text boxes at the bottom. Take a look at the HTML code and 
find that it includes another Javascript file:

    http://simile.mit.edu/timeline/examples/examples.js

In that file, filterMatcher and highlightMatcher are what you want to 
modify to suit your need. Right now they work on the "text" and 
"description" properties of each event, but you can have them work on 
any other property you want. evt.getProperty(propertyName) will retrieve 
the corresponding attribute from the XML element. For example, if you 
encode your event in the XML file as follows

    <event title="Christmas" start="December 25 2006" 
category="holiday">Christmas Day</event>

then evt.getProperty("category") will return "holiday".


Cheers,

David

Ryan Grenz wrote:
> Hi all,
>
> Timeline is a great product - really impressed with it! Thanks for your 
> efforts developing it :)
>
> Right now, I'm trying to work on filtering events using Prototype's 
> getElementsByClassName to hide or show events of a certain class.
> However, I notice that there is no way of setting a classname on each 
> event via the loaded JSON data.
> (I want to be able to filter events of a certain type, the text of which 
> may not exist in the title or description fields)
>
> The other option of course is to reload the JSON off the server with the 
> filter criteria in place and redraw - but that could cost a bit more 
> overhead in time in downloading/processing.
>
> As I'm using the Web API version of Timeline (and would like to continue 
> to do so, instead of grabbing a SVN version and modifying) I would like 
> to request the feature of being able to set an id or class on the div of 
> each event (and its label - eg. id of event div itself could be "test", 
> and label could be "test_label" dynamically).
>
> Also, an unrelated request; with the name="events" div .. can that be 
> given an id="<something>" instead/as well as? Its just using 
> getElementsByName in IE to select the timeline div only selects divs 
> with elements that are allowed to have name tags (eg. a, input etc). FF 
> doesn't care who has a name tag and will find it ok, but id is more 
> reliable crossbrowser.
>
> If other people think this is a good idea too, maybe I'll grab the SVN 
> and do it myself and submit the code back in for inclusion? shouldn't be 
> too difficult to achieve really?
>
> Thanks & have a good christmas!
>
> Ryan
>  
> _______________________________________________
> General mailing list
> [email protected]
> http://simile.mit.edu/mailman/listinfo/general
>   

_______________________________________________
General mailing list
[email protected]
http://simile.mit.edu/mailman/listinfo/general

Reply via email to