Our powerful JS Calendar component


Post by SemFA »

Hello,

We seem to be having this issue where events for one person seem to move around horizontally. It would be much more preferable if events tried to align themselves with their respective resource, it would give a much better overview of what is happening.

You can see an example here:

image001.png
image001.png (279.25 KiB) Viewed 153 times

As you can see, the 3 events for "NK" are swapping places with "KP" events.

Thank you in advance,

Sem.


Post by alex.l »

Hi Sem,

Event layout is a complex algorithm, main goal of that is to use the space as effective as possible.
If you will split events by resource, when 1st resource will have 300 events and 2nd will have only 1, and 3rd about 10, etc, you will see a lot of free space, but events for resource 1 will be unreadable. So, we cannot accept this idea as a feature request.

There is a class Calendar.layout.FluidDayLayout that you might look into and try to change algorithm as you want.

All the best,
Alex


Post by SemFA »

Hi Alex,

I see your point about trying to use space as efficiently as possible and I think it's fine to reposition certain events for the sake of using space.

But the only thing I don't understand is why the last 2 NK and KP events are swapped around, even though they use the exact same space. does this have to do something with when they were added, or is this something we can manipulate in some kind? I will look into the FluidDayLayout, but maybe you can find the answer faster than I can :).


Post by Animal »

There is no repositioning. There is no swapping.

Take a look inside that class. We have a linear array (could be over 100 long) of events with startDate, endDate. We have to somehow arrange them so that they show as much of themselves as possible.


Post Reply