Arjunsos / simile-widgets

Automatically exported from code.google.com/p/simile-widgets
0 stars 0 forks source link

TIMELINE: Control over vertical position of events #26

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
It would be great if there were some way to control the vertical position of an 
event. This would 
enable "piano roll"-type displays, where discreet event "types" are shown at a 
consistent vertical 
position. It would also enable vertical sorting of events.  

Original issue reported on code.google.com by mpelzshe...@gmail.com on 29 Sep 2008 at 4:00

GoogleCodeExporter commented 8 years ago

Original comment by larryklu...@gmail.com on 7 Oct 2008 at 3:56

GoogleCodeExporter commented 8 years ago
See new event attribute trackNum
Note that using this attribute turns off automatic placement of the events on 
the 
Timeline. Warning: Using this attribute enables you to easily be able to 
overlap 
event tapes and labels. (Not usually considered a good thing.)

Original comment by larryklu...@gmail.com on 2 Nov 2008 at 3:40

GoogleCodeExporter commented 8 years ago
Committed in rev 1654. 
Not tested: will leave that to the folks who asked for the change.

Original comment by larryklu...@gmail.com on 2 Nov 2008 at 5:41

GoogleCodeExporter commented 8 years ago
This is looking good, thanks!

Is there some way to find out or control the number of tracks per band?

Original comment by mpelzshe...@gmail.com on 3 Nov 2008 at 11:21

GoogleCodeExporter commented 8 years ago
The number of tracks depends on the "width" of the band, in pixels. The 
"width", for 
horizontal Timelines is the div's height. Since you set the "width" of the band 
(width attribute fed to Timeline.createBandInfo or 
Timeline.createHotZoneBandInfo), 
it is up to you.

You can calculate the number of tracks that will fit in a given number of 
pixels:
(band "width") / (theme.event.track.height +   theme.event.track.gap)

The divisor is from the theme file, unless overwritten by your client sw.

Original comment by larryklu...@gmail.com on 4 Nov 2008 at 4:46

GoogleCodeExporter commented 8 years ago
In my project I'm finding that I can only fit a bit over half of this number.

The formula that's working for me is as follows:

(band width * .55) / (theme.event.track.height +   theme.event.track.gap)

Original comment by mpelzshe...@gmail.com on 4 Nov 2008 at 7:31

GoogleCodeExporter commented 8 years ago
Hmmm. Interesting. Have you varied the tape height from the default? Is your 
label 
font extra large? Using the original-painter?
The original-painter expects that the total height of a track, including the 
label, 
will be theme.event.track.height. So rather than using a scaling factor, I'd 
suggest 
figuring out what is really happening--perhaps you need to increase the track 
height.

You could test by increasing track height and seeing if your timeline increases 
its 
"width." If it does NOT, then you'll know that the old track height was smaller 
than 
the reality. Or use a developer's helper with FF to see exactly how high your 
tracks 
are.

I also know that in most circumstances the right track count calculation does 
not 
require any scaling factors since I use the same calculation for automatically 
setting the Timeline's width. And that works well with no overlaps, big gaps, 
etc. 
See example2 which includes autoWidth calculation.

Regards,
Larry

Original comment by larryklu...@gmail.com on 4 Nov 2008 at 9:08

GoogleCodeExporter commented 8 years ago
Thanks for the help!

I'm not doing any of those things you mentioned; just using the ClassicTheme. 
The images I'm using for markers 
are custom but they are 10x10px.

According to Firefox, my tracks are 14px high with an offset of 6px. If I use a 
track height of 20 instead of (theme.event.track.height +   
theme.event.track.gap) (which is 12 for me), I don't have to use the scaling 
factor.

Original comment by mpelzshe...@gmail.com on 4 Nov 2008 at 10:43

GoogleCodeExporter commented 8 years ago
I can't seem to get the "trackNum" parameter to work.  could someone provide an 
example code snippet in JSON format to demonstrate its use to me?
thanks,

bill

Original comment by proff...@gmail.com on 25 Nov 2008 at 7:33