Portability | unknown |
---|---|
Stability | unstable |
Maintainer | Conrad Parker <conrad@metadecks.org> |
Scope types and interfaces
The coordinate system:
CanvasX 0.0 CanvasX 1.0 DataX 1.0 | | | DataX 0.0 V V V | V --------------------------------- <- CanvasY -1.0 | | +---------+---------------------------------+--------------+ | | | | | | | | +---------+---------------------------------+--------------+ | | --------------------------------- <- CanvasY -1.0
- class Coordinate a where
- newtype ScreenX = ScreenX Double
- newtype ScreenY = ScreenY Double
- newtype CanvasX = CanvasX Double
- newtype CanvasY = CanvasY Double
- newtype DataX = DataX Double
- newtype DataY = DataY Double
- data Transform a = Transform {}
- mkTransform :: Coordinate a => (a, a) -> (a, a) -> Transform a
- mkTSDataTransform :: (TimeStamp, TimeStamp) -> (TimeStamp, TimeStamp) -> Transform DataX
- unionBounds :: Ord a => Maybe (a, a) -> Maybe (a, a) -> Maybe (a, a)
- translateRange :: Coordinate a => a -> (a, a) -> (a, a)
- unionRange :: Ord a => (a, a) -> (a, a) -> (a, a)
- restrictRange :: (Ord a, Coordinate a) => (a, a) -> (a, a) -> (a, a)
- restrictRange01 :: (Ord a, Coordinate a) => (a, a) -> (a, a)
- zoomRange :: Coordinate a => CanvasX -> Double -> (a, a) -> (a, a)
- type RGB = (Double, Double, Double)
- data DrawCmd
- type DrawLayer = [DrawCmd]
- class (Functor m, MonadCatchIO m) => ScopeRender m where
- renderCmds :: [DrawCmd] -> m ()
- class ScopePlot a where
- rawLayerPlot :: a -> RGB -> LayerPlot (TimeStamp, [a])
- summaryLayerPlot :: a -> RGB -> LayerPlot [Summary a]
- data ScopeFile = ScopeFile {}
- data Scope ui = Scope {}
- scopeNew :: ui -> Scope ui
- scopeClose :: Scope ui -> IO (Scope ui)
- scopeUpdate :: Maybe (TimeStamp, TimeStamp) -> Maybe (UTCTime, UTCTime) -> Scope ui -> Scope ui
- scopeModifyView :: (View ui -> View ui) -> Scope ui -> Scope ui
- data View ui = View {}
- data Layer a = Layer {}
- data LayerPlot a
- = LayerMap (LayerMapFunc a) [DrawLayer]
- | forall b . LayerFold (LayerFoldFunc a b) [DrawLayer] b
- type LayerMapFunc a = Double -> Double -> a -> [DrawLayer]
- type LayerFoldFunc a b = Double -> Double -> b -> a -> ([DrawLayer], b)
- data ScopeLayer = forall a . Timestampable a => ScopeLayer (Layer a)
Coordinates
class Coordinate a whereSource
mkTransform :: Coordinate a => (a, a) -> (a, a) -> Transform aSource
translateRange :: Coordinate a => a -> (a, a) -> (a, a)Source
unionRange :: Ord a => (a, a) -> (a, a) -> (a, a)Source
restrictRange :: (Ord a, Coordinate a) => (a, a) -> (a, a) -> (a, a)Source
Restrict a window to within a given range
restrictRange01 :: (Ord a, Coordinate a) => (a, a) -> (a, a)Source
zoomRange :: Coordinate a => CanvasX -> Double -> (a, a) -> (a, a)Source
Drawing commands
class (Functor m, MonadCatchIO m) => ScopeRender m whereSource
renderCmds :: [DrawCmd] -> m ()Source
rawLayerPlot :: a -> RGB -> LayerPlot (TimeStamp, [a])Source
summaryLayerPlot :: a -> RGB -> LayerPlot [Summary a]Source
Scope
scopeClose :: Scope ui -> IO (Scope ui)Source
scopeUpdate :: Maybe (TimeStamp, TimeStamp) -> Maybe (UTCTime, UTCTime) -> Scope ui -> Scope uiSource
Views
Layers
LayerMap (LayerMapFunc a) [DrawLayer] | |
forall b . LayerFold (LayerFoldFunc a b) [DrawLayer] b |
type LayerMapFunc a = Double -> Double -> a -> [DrawLayer]Source
A layer plotting function which is just given the x position and x width
to render the data value of type a
into.
type LayerFoldFunc a b = Double -> Double -> b -> a -> ([DrawLayer], b)Source
A layer plotting function which is given the x position and x width,
and a previously returned value of type b
data ScopeLayer Source
forall a . Timestampable a => ScopeLayer (Layer a) |