Module

DataViz.Layout.Pattern.Adapters

Package
purescript-hylograph-layout
Repository
afcondon/purescript-hylograph-layout

Typeclass adapters for layout functions

Provides typeclasses that convert real-world data types into the raw numbers that core layout functions expect. Convenience functions extract, layout, then zip results back with original data.

No new dependencies — typeclasses use raw Int/Number. Callers provide instances using their own date/time library.

#Temporal Source

class Temporal a  where

Types that can be mapped to calendar day positions. dayOfWeek returns 0=Sunday..6=Saturday. dayIndex returns a sequential day number (0-based within the range).

Members

#TimeInterval Source

class TimeInterval a  where

Types that represent time intervals in a lane. intervalStart and intervalEnd return normalized values 0.0-1.0.

Members

#Sized Source

class Sized a  where

Types that have width and height dimensions.

Members

#HasAspectRatio Source

class HasAspectRatio a  where

Types that have an intrinsic aspect ratio (width/height).

Members

#calendarFrom Source

calendarFrom :: forall a. Temporal a => Number -> Viewport -> Array a -> Array { datum :: a, rect :: Rect }

Layout temporal data on a calendar grid.

#swimlaneFrom Source

swimlaneFrom :: forall a. TimeInterval a => Int -> Number -> Viewport -> Array a -> Array { datum :: a, rect :: Rect }

Layout time intervals in swimlanes.

#shelfFrom Source

shelfFrom :: forall a. Sized a => Number -> Viewport -> Array a -> Array { datum :: a, rect :: Rect }

Layout sized items on a shelf.

#justifiedFrom Source

justifiedFrom :: forall a. HasAspectRatio a => Number -> Number -> Viewport -> Array a -> Array { datum :: a, rect :: Rect }

Layout items with aspect ratios in a justified gallery.

#binPackFrom Source

binPackFrom :: forall a. Sized a => Viewport -> Array a -> Array { datum :: a, rect :: Rect }

Bin-pack sized items into a viewport.