Table of Contents

Class TwCalendarEventLayout

Namespace
TwBlazor.Components
Assembly
TwBlazor.dll

Computes a side-by-side column layout for a set of same-day Schedule<T> events, the way Google Calendar/MS Teams lay out overlapping meetings, so TwCalendarDayColumn<T> can position each event with a left/width percentage instead of stacking overlapping events directly on top of each other.

public static class TwCalendarEventLayout
Inheritance
TwCalendarEventLayout
Inherited Members

Methods

LayoutEvents<T>(IEnumerable<Schedule<T>>)

Lays out events (expected to all fall within the same day) into side-by-side columns.

public static IReadOnlyList<TwCalendarEventLayout.Slot<T>> LayoutEvents<T>(IEnumerable<Schedule<T>> events)

Parameters

events IEnumerable<Schedule<T>>

Returns

IReadOnlyList<TwCalendarEventLayout.Slot<T>>

Type Parameters

T

Remarks

Events are grouped into maximal clusters of transitively-overlapping events (an event that doesn't directly overlap another can still share a cluster via a third event that overlaps both), then columns are assigned within each cluster greedily: each event goes in the first column whose last-placed event already ended by the time this one starts, or a new column if none is free. Every event in a cluster shares that cluster's total column count, so a cluster's events always divide the width evenly - this is the simple "even columns" layout rather than the more elaborate variant that reclaims width from columns that end up empty for part of the cluster's span.