No announcement yet.
  • Filter
  • Time
Clear All
new posts

    Events on timeline overlap


    We are upgrading from version 5 to version 12 of smartgwt. We use the timeline to show events (activities), which connect exactly in time with a resolution of 1 second. In version 5, the events on the timeline stack neatly horizontally, in v12 with the same code, the events snap differently. This results in overlapping activities, with each only taking half of the bar. Please see the attached picture + code. The events do not overlap but due to snapping they are rendered as if they do. Can someone give a hint how to get them stacked horizontally as in v5?

    Click image for larger version

Name:	Timeline.png
Views:	38
Size:	23.5 KB
ID:	259208

    If you can you show your timeline config, dataSource and a sample of data, we'll take a look.


      I included the file in the original post, did you miss that, or do you need more than that?


        Ah, yes, we see it now - we'll take a look and get back to you shortly


          We've made a change to better deal with this - now, when the start of one event is the same datetime as the end of another, you'll see the behavior you expect. If the datetiems are different, even by a second, they will overlap, because that's how overlapping works. You should find that as of builds dated September 1.

          On your code-comment about eventSnapGap:

          1) call setEventSnapGap() in createTimeline(), before the call to setTimelineRange(), which calls setResolution() and creates the internals of the timeline
          2) since you're calling setResolution() yourself in downstream code, instead of setTimelineRange(), call setStartDate() and setEndDate(), and rely on your subsequent call to setResolution() for creation

          [Edit - note that we've also made a change to have eventSnapGap be writable after creation - so you can call setEventSnapGap() at any time, as long as you rebuild the timeline afterward, with a call to setResolution() or similar.]
          Last edited by Isomorphic; 2nd Sep 2019, 00:58.


            Hi, this build is not available yet, right? last build is August 28th?


              We had a problem with our internal build mechanism which is now fixed - you should see builds arrive tomorrow.


                I do not see a new build yet, correct?


                  The builds are working again now.



                    works a lot better now, but not in all cases. Please see attached and the screenshot. Is there maybe a setting that ignores checking overlap and just renders what it gets?


                    Click image for larger version

Name:	smartGWTTimeline.png
Views:	27
Size:	15.1 KB
ID:	259580
                    Attached Files


                      The problem here is that one of your events is only 50 seconds long, and there's no space in any of your timelines to represent that, since each pixel is, at the absolute minimum (in your first timeline), representing at least 1 minute, So that event is rendered at the minimum 1px snap. You can test that, by just making your event longer than the minimum representable snapGap.

                      You also, for some reason, are applying a snapGap of 3 minutes, which 1) seems a little bizarre and 2), once again, can not be represented in a 60px column that spans 3 hours. Consider making your columns wider - headerLevel.setHeaderWidth() will do that - but, essentially, you are never going to get this to work as you expect with an event with a length shorter than the minimum snapGap.
                      Last edited by Isomorphic; 7th Oct 2019, 04:11.