cal-layout-0.1.0.2: Calendar Layout Algorithm

Safe HaskellSafe
LanguageHaskell2010

CalLayout

Synopsis

Documentation

class Eq a => CalEvent a where Source #

Main interface for events.

Methods

start :: a -> TimeUnit Source #

end :: a -> TimeUnit Source #

data Dimension Source #

Dimension data type.

Constructors

Dimension 

Fields

Instances
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.