-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | An interactive renderer for plotting time-series data -- -- scope is a framework for plotting time-series data, using zoom-cache -- files. -- -- This version includes a Gtk/Cairo application. It's a desktop -- application with a File menu; remember those? wow! This will -- probably be split out into a separate package later, and there'll be a -- webby javascripty version too, but for now there's this desktop app. -- -- To run it, simply: -- --
-- $ cabal install gtk2hs-buildtools scope -- $ scope ---- -- Then, select File->Open from the menubar, with your mouse: -- there's no swiping gestures back here, baby! Four (yes, 4) demo files -- are included in this version of the package. Choose one, and it will -- be drawn in the window. Amazing! It should look something like what -- you saw in the post you read about this in, but more personal because -- now it's happening to you. -- -- Zoom in with the scroll wheel on your mouse. If you don't have a -- scroll wheel, use the Up and Down arrow keys on your keyboard. If you -- don't have up and down arrows you are elite! -- -- Pan around by dragging it. There's a scrollbar too if you're into -- that. -- -- Load up another file! It will also be drawn. Zoom in and out and pan -- around, yay! Life is gooood! @package scope @version 0.7.0.0 -- | 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 --module Scope.Types class Coordinate a fromDouble :: Coordinate a => Double -> a toDouble :: Coordinate a => a -> Double distance :: Coordinate a => a -> a -> a translate :: Coordinate a => a -> a -> a transform :: Coordinate a => Transform a -> a -> a newtype ScreenX ScreenX :: Double -> ScreenX newtype ScreenY ScreenY :: Double -> ScreenY newtype CanvasX CanvasX :: Double -> CanvasX newtype CanvasY CanvasY :: Double -> CanvasY newtype DataX DataX :: Double -> DataX newtype DataY DataY :: Double -> DataY data Transform a Transform :: Double -> a -> Transform a m :: Transform a -> Double b :: Transform a -> a 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) -- | Restrict a window to within a given range 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 SetRGB :: Double -> Double -> Double -> DrawCmd SetRGBA :: Double -> Double -> Double -> Double -> DrawCmd MoveTo :: (Double, Double) -> DrawCmd LineTo :: (Double, Double) -> DrawCmd FillPoly :: [(Double, Double)] -> DrawCmd type DrawLayer = [DrawCmd] class (Functor m, MonadCatchIO m) => ScopeRender m renderCmds :: ScopeRender m => [DrawCmd] -> m () class ScopePlot a rawLayerPlot :: ScopePlot a => a -> RGB -> LayerPlot (TimeStamp, [a]) summaryLayerPlot :: ScopePlot a => a -> RGB -> LayerPlot [Summary a] data ScopeFile ScopeFile :: FilePath -> Fd -> CacheFile -> ScopeFile filename :: ScopeFile -> FilePath fd :: ScopeFile -> Fd scopeCF :: ScopeFile -> CacheFile data Scope ui Scope :: View ui -> Maybe (TimeStamp, TimeStamp) -> Maybe (UTCTime, UTCTime) -> [ScopeLayer] -> Scope ui view :: Scope ui -> View ui bounds :: Scope ui -> Maybe (TimeStamp, TimeStamp) utcBounds :: Scope ui -> Maybe (UTCTime, UTCTime) layers :: Scope ui -> [ScopeLayer] 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 :: DataX -> Double -> DataX -> Double -> Maybe CanvasX -> Maybe DataX -> ui -> View ui viewX1 :: View ui -> DataX viewY1 :: View ui -> Double viewX2 :: View ui -> DataX viewY2 :: View ui -> Double pointerX :: View ui -> Maybe CanvasX dragDX :: View ui -> Maybe DataX viewUI :: View ui -> ui data Layer a Layer :: ScopeFile -> TrackNo -> Maybe UTCTime -> TimeStamp -> TimeStamp -> (forall m. (Functor m, Monad m) => Enumeratee [Offset Block] [a] m ()) -> LayerPlot a -> Layer a layerFile :: Layer a -> ScopeFile layerTrackNo :: Layer a -> TrackNo layerBaseUTC :: Layer a -> Maybe UTCTime startTime :: Layer a -> TimeStamp endTime :: Layer a -> TimeStamp convEnee :: Layer a -> forall m. (Functor m, Monad m) => Enumeratee [Offset Block] [a] m () plotter :: Layer a -> LayerPlot a data LayerPlot a LayerMap :: (LayerMapFunc a) -> [DrawLayer] -> LayerPlot a LayerFold :: (LayerFoldFunc a b) -> [DrawLayer] -> b -> LayerPlot a -- | A layer plotting function which is just given the x position and x -- width to render the data value of type a into. type LayerMapFunc a = Double -> Double -> a -> [DrawLayer] -- | A layer plotting function which is given the x position and x width, -- and a previously returned value of type b type LayerFoldFunc a b = Double -> Double -> b -> a -> ([DrawLayer], b) data ScopeLayer ScopeLayer :: (Layer a) -> ScopeLayer instance Eq ScreenX instance Ord ScreenX instance Show ScreenX instance Eq ScreenY instance Ord ScreenY instance Show ScreenY instance Eq CanvasX instance Ord CanvasX instance Show CanvasX instance Eq CanvasY instance Ord CanvasY instance Show CanvasY instance Eq DataX instance Ord DataX instance Show DataX instance Eq DataY instance Ord DataY instance Show DataY instance ScopeRender IO instance Coordinate UTCTime instance Coordinate TimeStamp instance Coordinate DataX instance Coordinate CanvasX instance Coordinate ScreenX instance Coordinate Double -- | Scope plotting functions module Scope.Numeric.IEEE754 instance ScopePlot Double -- | Functions for dealing with Views module Scope.View timeStampToData :: Scope ui -> TimeStamp -> Maybe DataX dataToTimeStamp :: Scope ui -> DataX -> Maybe TimeStamp timeStampToCanvas :: Scope ui -> TimeStamp -> CanvasX dataToUTC :: Scope ui -> DataX -> Maybe UTCTime utcToCanvas :: Scope ui -> UTCTime -> CanvasX viewStartUTC :: Scope ui -> View ui -> Maybe UTCTime viewEndUTC :: Scope ui -> View ui -> Maybe UTCTime viewStartTime :: Scope ui -> View ui -> Maybe TimeStamp viewEndTime :: Scope ui -> View ui -> Maybe TimeStamp viewDuration :: Scope ui -> View ui -> Maybe TimeStampDiff -- | Align a view so the given DataX appears at CanvasX, preserving the -- current view width. viewAlign :: CanvasX -> DataX -> View ui -> View ui viewMoveStart :: View ui -> View ui viewMoveEnd :: View ui -> View ui viewMoveLeft :: View ui -> View ui viewMoveRight :: View ui -> View ui viewMoveTo :: Double -> View ui -> View ui viewZoomIn :: Double -> View ui -> View ui viewZoomOut :: Double -> View ui -> View ui viewZoomInOn :: CanvasX -> Double -> View ui -> View ui viewZoomOutOn :: CanvasX -> Double -> View ui -> View ui viewButtonDown :: CanvasX -> View ui -> View ui viewButtonMotion :: CanvasX -> View ui -> View ui viewButtonRelease :: View ui -> View ui -- | Layers module Scope.Layer addLayersFromFile :: FilePath -> Scope ui -> IO (Scope ui) plotLayers :: ScopeRender m => Scope ui -> m (Scope ui) module Scope.Cairo data ViewCairo ViewCairo :: DrawingArea -> Adjustment -> ViewCairo canvas :: ViewCairo -> DrawingArea adj :: ViewCairo -> Adjustment scopeCairoNew :: DrawingArea -> Adjustment -> Scope ViewCairo viewCairoInit :: DrawingArea -> Adjustment -> ViewCairo keepState :: Render t -> Render () instance ScopeRender Render instance MonadCatchIO Render