cal-layout- Calendar Layout Algorithm

Safe HaskellSafe




class Eq a => CalEvent a where Source #

Main interface for events.


start :: a -> TimeUnit Source #

end :: a -> TimeUnit Source #

data Dimension Source #

Dimension data type.




Show Dimension Source # 
Instance details

Defined in CalLayout

insertEventTree :: CalEvent a => a -> Tree a -> Tree a Source #

Insert an event into a tree by calculating intersections.

intersects :: CalEvent a => a -> a -> Bool Source #

Given two events, check if they intersect.

treeContains :: CalEvent a => a -> Tree a -> Bool Source #

Given an event and a tree, check if the tree contains it.

insertEventForest :: CalEvent a => a -> Forest a -> Forest a Source #

Insert an event in a forest.

mkIntersectionsForest :: CalEvent a => [a] -> Forest a Source #

Make intersections forest by recursively using insertEvent. we need to provide an initial member since a Tree cannot be empty.

populateDepths :: Forest a -> [(a, Int, Int)] Source #

For a given forest, populate max depth and depth we need those for calculating width/left respectively.

calculateDimensions :: CalEvent a => Forest a -> [(a, Dimension)] Source #

Calculate dimensions for a forest.

getDimensions :: CalEvent a => [a] -> [(a, Dimension)] Source #

Helper wrapper for getting dimensions.