scope-0.6.1.0: An interactive renderer for plotting time-series data

Portabilityunknown
Stabilityunstable
MaintainerConrad Parker <conrad@metadecks.org>

Scope.Types

Contents

Description

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

Synopsis

Coordinates

class Coordinate a whereSource

Methods

fromDouble :: Double -> aSource

toDouble :: a -> DoubleSource

distance :: a -> a -> aSource

Distance from to

translate :: a -> a -> aSource

Translate x by

transform :: Transform a -> a -> aSource

newtype ScreenY Source

Constructors

ScreenY Double 

newtype CanvasY Source

Constructors

CanvasY Double 

newtype DataX Source

Constructors

DataX Double 

newtype DataY Source

Constructors

DataY Double 

Instances

data Transform a Source

Constructors

Transform 

Fields

m :: Double
 
b :: a
 

mkTransform :: Coordinate a => (a, a) -> (a, a) -> Transform aSource

unionBounds :: Ord a => Maybe (a, a) -> Maybe (a, a) -> Maybe (a, a)Source

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

Scope

data ScopeFile Source

Constructors

ScopeFile 

Fields

filename :: FilePath
 
fd :: Fd
 
scopeCF :: CacheFile
 

data Scope ui Source

Constructors

Scope 

scopeNew :: ui -> Scope uiSource

scopeModifyView :: (View ui -> View ui) -> Scope ui -> Scope uiSource

Views

data View ui Source

Constructors

View 

Layers

data LayerPlot a Source

Constructors

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

Constructors

forall a . Timestampable a => ScopeLayer (Layer a)