timeglider / jquery_widget

Timeglider's JS Widget component. See README for details.
193 stars 41 forks source link

Zooming to the Minute Level #52

Closed WatchfulEyeOfZod closed 11 years ago

WatchfulEyeOfZod commented 12 years ago

Fantastic Plugin. Simple. Clean. Thank you for writing it.

Is it possible to zoom in tighter than level 1? (or something equivalent?)

Basically, I am trying to represent a timeline that is based on a series of events in a log that happen seconds apart. Even at zoom level of 1, the timeline is too wide (showing 15 minute or so increments). In this implementation, the time line would have a relatively small "max" - a few hours or days, but would allow be to drill down to the minute or second level.

Thanks!

timeglider commented 12 years ago

Unfortunately we don't have a way to do this currently — but you're not the first to ask about this level of detail, so it's something we're considering for the long term. Basically, we'll need to go down to "0" as a zoom level, then "-1", and so forth, and define those zoom levels in the "zoomTree" object (and accomodate sub-1 levels in a few other ways). A rule for drawing ticks and labels would also need to be created. If you're interested in helping with this, and want to create a branch to see if it's possible, I'd welcome that, and would do my best to provide guidance. Let me know what you think.

hardslinger commented 11 years ago

Hi,

is there any progress on this issue yet? If not, I may give it a try. :smile: Could you please provide some more information on how to approach this issue?

Thanks.

timeglider commented 11 years ago

The key to this would be to look at the end of the TG_TimelineView.js file — at zoomTree object. Every zoom level has a unit (day, month, etc), and a width for each "tick" which is the block of time in the horizontal rule. Right now, the smallest unit is "day", which can expand out to 35,000 pixels. A day is 86,400 seconds long, to you're currently getting about 2.5 seconds per pixel of "resolution". The entire system is pretty hardwired around these units, so creating a smaller unit (say, an "hour" unit) would require building out quite a bit of functionality across about a dozen rendering and labeling functions. In the "addTick" function, there is a "getDateLabelForTick" function that takes the tick information and then gets back some HTML to render inside that tick; that's where one would work up different labels/markers for any given zoom level.

We're not planning to embark on this unless we see demand for such granularity from some market or other (scientific, etc). I totally welcome this effort — but I'm not sure we have time to do much.

FYI, we're moving the widget code off of Github. It's getting to complicated to maintain this and another larger git repo which is the basis of our site (on PHPFog). We'll still have the code, etc. available on Timeglider.com/jquery starting next week.