Text.Blaze.Svg: exported symbols usage examples

Symbols

  • aa No usage example found for this symbol :( Collapse [-]
    ar No usage example found for this symbol :( Collapse [-]
    c See 8 Occurences [+] Collapse [-]
    Found in Graphics.Rendering.Plot.Light.PlotTypes.Heatmap from the package plot-light
    prepData ::
      (Ord t, Fractional a, Enum a) =>
         [[t]]  -- ^ Data
      -> (a, a, t, t, [LabeledPoint t a])  -- ^ (# of pixel rows, # of pixel columns, data minimum, data maximum, data points)
    prepData ll = (nh, nw, valMin, valMax, d')
      where
        nh = fromIntegral $ length ll
        nw = fromIntegral $ length (head ll) 
        d' = toUnitFramedLP nw nh <$> toCoord ll
        valMin = minimum $ _lplabel <$> d'
        valMax = maximum $ _lplabel <$> d'
        
       
    
    toCoord :: (Num i, Enum i) => [[c]] -> [(i, i, c)]
    toCoord ll = concat $ reverse $ go 0 ll [] where
      go i (x:xs) acc = go (i + 1) xs $ zip3 [0 ..] (repeat i) x : acc
      go _ [] acc = acc
    
    toUnitFramedLP :: (Fractional t) =>
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Heatmap from the package plot-light
    prepData ::
      (Ord t, Fractional a, Enum a) =>
         [[t]]  -- ^ Data
      -> (a, a, t, t, [LabeledPoint t a])  -- ^ (# of pixel rows, # of pixel columns, data minimum, data maximum, data points)
    prepData ll = (nh, nw, valMin, valMax, d')
      where
        nh = fromIntegral $ length ll
        nw = fromIntegral $ length (head ll) 
        d' = toUnitFramedLP nw nh <$> toCoord ll
        valMin = minimum $ _lplabel <$> d'
        valMax = maximum $ _lplabel <$> d'
        
       
    
    toCoord :: (Num i, Enum i) => [[c]] -> [(i, i, c)]
    toCoord ll = concat $ reverse $ go 0 ll [] where
      go i (x:xs) acc = go (i + 1) xs $ zip3 [0 ..] (repeat i) x : acc
      go _ [] acc = acc
    
    toUnitFramedLP :: (Fractional t) =>
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Scatter from the package plot-light
      , spSize :: a                   -- ^ Glyph size
      , spStrokeWidth :: a            -- ^ Glyph stroke width
      , spColour :: C.Colour Double   -- ^ Glyph colour
      , spAlpha :: a                  -- ^ Glyph opacity
      } deriving (Eq, Show)
    
    
    modifyScatterPoint ::
            (l -> b -> c)                             -- ^ Modifies glyph size
         -> (l -> b -> c)                             -- ^ Modifies glyph stroke width
         -> (l -> C.Colour Double -> C.Colour Double) -- ^ Modifies glyph colour
         -> (l -> b -> c)                             -- ^ Modifies glyph opacity
         -> ScatterPointData b
         -> LabeledPoint l d
         -> ScatterPointData c
    modifyScatterPoint f g h i (ScatterPointData glsh sz w col alpha) lp =
      ScatterPointData glsh (f lab sz) (g lab w) (h lab col) (i lab alpha)
      where
        lab = _lplabel lp
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Scatter from the package plot-light
    data ScatterPointData a = ScatterPointData
      {
        spGlyphShape :: GlyphShape_   -- ^ Glyph shape
      , spSize :: a                   -- ^ Glyph size
      , spStrokeWidth :: a            -- ^ Glyph stroke width
      , spColour :: C.Colour Double   -- ^ Glyph colour
      , spAlpha :: a                  -- ^ Glyph opacity
      } deriving (Eq, Show)
    
    
    modifyScatterPoint ::
            (l -> b -> c)                             -- ^ Modifies glyph size
         -> (l -> b -> c)                             -- ^ Modifies glyph stroke width
         -> (l -> C.Colour Double -> C.Colour Double) -- ^ Modifies glyph colour
         -> (l -> b -> c)                             -- ^ Modifies glyph opacity
         -> ScatterPointData b
         -> LabeledPoint l d
         -> ScatterPointData c
    modifyScatterPoint f g h i (ScatterPointData glsh sz w col alpha) lp =
      ScatterPointData glsh (f lab sz) (g lab w) (h lab col) (i lab alpha)
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Scatter from the package plot-light
          
    -- | Parameters for a scatterplot glyph
    data ScatterPointData a = ScatterPointData
      {
        spGlyphShape :: GlyphShape_   -- ^ Glyph shape
      , spSize :: a                   -- ^ Glyph size
      , spStrokeWidth :: a            -- ^ Glyph stroke width
      , spColour :: C.Colour Double   -- ^ Glyph colour
      , spAlpha :: a                  -- ^ Glyph opacity
      } deriving (Eq, Show)
    
    
    modifyScatterPoint ::
            (l -> b -> c)                             -- ^ Modifies glyph size
         -> (l -> b -> c)                             -- ^ Modifies glyph stroke width
         -> (l -> C.Colour Double -> C.Colour Double) -- ^ Modifies glyph colour
         -> (l -> b -> c)                             -- ^ Modifies glyph opacity
         -> ScatterPointData b
         -> LabeledPoint l d
         -> ScatterPointData c
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Scatter from the package plot-light
      
          
    -- | Parameters for a scatterplot glyph
    data ScatterPointData a = ScatterPointData
      {
        spGlyphShape :: GlyphShape_   -- ^ Glyph shape
      , spSize :: a                   -- ^ Glyph size
      , spStrokeWidth :: a            -- ^ Glyph stroke width
      , spColour :: C.Colour Double   -- ^ Glyph colour
      , spAlpha :: a                  -- ^ Glyph opacity
      } deriving (Eq, Show)
    
    
    modifyScatterPoint ::
            (l -> b -> c)                             -- ^ Modifies glyph size
         -> (l -> b -> c)                             -- ^ Modifies glyph stroke width
         -> (l -> C.Colour Double -> C.Colour Double) -- ^ Modifies glyph colour
         -> (l -> b -> c)                             -- ^ Modifies glyph opacity
         -> ScatterPointData b
         -> LabeledPoint l d
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.TimeSeries from the package plot-light
    frameToFrameFxRow from to fxr = f <$> fxr
      where
        f = frameToFrameValue from to
    
    
    data FxRow a  = FxRow {
        rateOpen :: a
      , rateHigh :: a
      , rateLow :: a
      , rateClose :: a
                   } deriving (Eq, Show)
    
    instance Functor FxRow where
      fmap f (FxRow o h l c) = FxRow (f o) (f h) (f l) (f c)
    
    c1 = FxRow 1.0876 1.0880 1.0872 1.0874
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.TimeSeries from the package plot-light
    frameToFrameFxRow from to fxr = f <$> fxr
      where
        f = frameToFrameValue from to
    
    
    data FxRow a  = FxRow {
        rateOpen :: a
      , rateHigh :: a
      , rateLow :: a
      , rateClose :: a
                   } deriving (Eq, Show)
    
    instance Functor FxRow where
      fmap f (FxRow o h l c) = FxRow (f o) (f h) (f l) (f c)
    
    c1 = FxRow 1.0876 1.0880 1.0872 1.0874
    

    cr No usage example found for this symbol :( Collapse [-]
    h See 33 Occurences [+] Collapse [-]
    Found in Graphics.Rendering.Plot.Light.Internal from the package plot-light
    colBarPx
      :: (Show a, RealFrac a, RealFrac t) =>
         [C.Colour Double]       
         -> FigureData a1
         -> a
         -> a
         -> t
         -> t
         -> LabeledPoint t a
         -> Svg
    colBarPx pal fdat w h vmin vmax (LabeledPoint p val) = do
      text 0 (figLabelFontSize fdat) C.black TAStart (T.pack $ show (rr val :: Fixed E3)) (V2 (1.1*w) (0.5*h)) p
      rectCentered w h (pickColour pal vmin vmax val) p
      
    

    Found in Graphics.Rendering.Plot.Light.Internal from the package plot-light
        dv = (vmax - vmin)/fromIntegral n
    
    
    colBarPx
      :: (Show a, RealFrac a, RealFrac t) =>
         [C.Colour Double]       
         -> FigureData a1
         -> a
         -> a
         -> t
         -> t
         -> LabeledPoint t a
         -> Svg
    colBarPx pal fdat w h vmin vmax (LabeledPoint p val) = do
      text 0 (figLabelFontSize fdat) C.black TAStart (T.pack $ show (rr val :: Fixed E3)) (V2 (1.1*w) (0.5*h)) p
      rectCentered w h (pickColour pal vmin vmax val) p
      
    

    Found in Graphics.Rendering.Plot.Light.Internal from the package plot-light
        v_ = take (n+1) [vmin, vmin + dv ..]
        dv = (vmax - vmin)/fromIntegral n
    
    
    colBarPx
      :: (Show a, RealFrac a, RealFrac t) =>
         [C.Colour Double]       
         -> FigureData a1
         -> a
         -> a
         -> t
         -> t
         -> LabeledPoint t a
         -> Svg
    colBarPx pal fdat w h vmin vmax (LabeledPoint p val) = do
      text 0 (figLabelFontSize fdat) C.black TAStart (T.pack $ show (rr val :: Fixed E3)) (V2 (1.1*w) (0.5*h)) p
      rectCentered w h (pickColour pal vmin vmax val) p
      
    

    Found in Graphics.Rendering.Plot.Light.Internal from the package plot-light
              -> (FigureData a -> a -> a -> t -> t -> LabeledPoint t a -> m b)
              -> m ()
    legendBar fdat w vmin vmax n legpos legh fun = do
      -- rect wrect hrect 1 (Just C.black) (Just C.white) prect
      forM_ lps (fun fdat w h vmin vmax) where
        wrect = 0.95 * (1 - figRightMFrac fdat) * figWidth fdat
        hrect = 1.5 * legh
        prect = movePoint (V2 (-0.5 * w) (-0.5 * w)) p2
        (legx, legy) = posCoeff legpos
        legendX = figWidth fdat * legx 
        legendY = figHeight fdat * legy
        p1 = Point legendX (legendY + legh)
        p2 = Point legendX legendY
        lps = zipWith LabeledPoint (pointRange n p1 p2) v_
        h = legh / fromIntegral n
        v_ = take (n+1) [vmin, vmin + dv ..]
        dv = (vmax - vmin)/fromIntegral n
    
    
    colBarPx
    

    Found in Graphics.Rendering.Plot.Light.Internal from the package plot-light
    legendBar :: (Monad m, Enum t, Fractional t, Fractional a) =>
                 FigureData a
              -> a
              -> t
              -> t
              -> Int
              -> LegendPosition_
              -> a
              -> (FigureData a -> a -> a -> t -> t -> LabeledPoint t a -> m b)
              -> m ()
    legendBar fdat w vmin vmax n legpos legh fun = do
      -- rect wrect hrect 1 (Just C.black) (Just C.white) prect
      forM_ lps (fun fdat w h vmin vmax) where
        wrect = 0.95 * (1 - figRightMFrac fdat) * figWidth fdat
        hrect = 1.5 * legh
        prect = movePoint (V2 (-0.5 * w) (-0.5 * w)) p2
        (legx, legy) = posCoeff legpos
        legendX = figWidth fdat * legx 
    

    Found in Graphics.Rendering.Plot.Light.Internal from the package plot-light
          -> Svg
    pixel pal w h vmin vmax (LabeledPoint p l) = rect w h col p where
      col = pickColour pal (toFloat vmin) (toFloat vmax) (toFloat l)
    
    -- | A 'pixel'' is a filled square shape used for populating 'heatmap' plots , coloured from a palette
    pixel'
      :: (Show a, RealFrac a, RealFrac t) =>
         [C.Colour Double]  -- ^ Palette
      -> a                  -- ^ Width 
      -> a -- ^ Height
      -> t -- ^ Function minimum 
      -> t -- ^ Function maximum
      -> LabeledPoint t a
      -> Svg
    pixel' pal w h vmin vmax (LabeledPoint p l) = rect w h col p where
      col = pickColour pal vmin vmax l
      
    
    -- | Pick a colour from a list, assumed to be a palette mapped onto a compact numerical interval.
    pickColour :: (RealFrac t, Num a) =>
    

    Found in Graphics.Rendering.Plot.Light.Internal from the package plot-light
          -> Svg
    pixel pal w h vmin vmax (LabeledPoint p l) = rect w h col p where
      col = pickColour pal (toFloat vmin) (toFloat vmax) (toFloat l)
    
    -- | A 'pixel'' is a filled square shape used for populating 'heatmap' plots , coloured from a palette
    pixel'
      :: (Show a, RealFrac a, RealFrac t) =>
         [C.Colour Double]  -- ^ Palette
      -> a                  -- ^ Width 
      -> a -- ^ Height
      -> t -- ^ Function minimum 
      -> t -- ^ Function maximum
      -> LabeledPoint t a
      -> Svg
    pixel' pal w h vmin vmax (LabeledPoint p l) = rect w h col p where
      col = pickColour pal vmin vmax l
      
    
    -- | Pick a colour from a list, assumed to be a palette mapped onto a compact numerical interval.
    pickColour :: (RealFrac t, Num a) =>
    

    Found in Graphics.Rendering.Plot.Light.Internal from the package plot-light
    -- | A 'pixel' is a filled square shape used for populating 'heatmap' plots , coloured from a palette
    pixel :: (Show a, RealFrac a) =>
             [C.Colour Double]         -- ^ Palette
          -> a                         -- ^ Width
          -> a                         -- ^ Height
          -> Scientific                -- ^ Function minimum
          -> Scientific               -- ^ Function maximum
          -> LabeledPoint Scientific a
          -> Svg
    pixel pal w h vmin vmax (LabeledPoint p l) = rect w h col p where
      col = pickColour pal (toFloat vmin) (toFloat vmax) (toFloat l)
    
    -- | A 'pixel'' is a filled square shape used for populating 'heatmap' plots , coloured from a palette
    pixel'
      :: (Show a, RealFrac a, RealFrac t) =>
    

    Found in Graphics.Rendering.Plot.Light.Internal from the package plot-light
    -- | A 'pixel' is a filled square shape used for populating 'heatmap' plots , coloured from a palette
    pixel :: (Show a, RealFrac a) =>
             [C.Colour Double]         -- ^ Palette
          -> a                         -- ^ Width
          -> a                         -- ^ Height
          -> Scientific                -- ^ Function minimum
          -> Scientific               -- ^ Function maximum
          -> LabeledPoint Scientific a
          -> Svg
    pixel pal w h vmin vmax (LabeledPoint p l) = rect w h col p where
      col = pickColour pal (toFloat vmin) (toFloat vmax) (toFloat l)
    
    -- | A 'pixel'' is a filled square shape used for populating 'heatmap' plots , coloured from a palette
    pixel'
      :: (Show a, RealFrac a, RealFrac t) =>
    

    Found in Graphics.Rendering.Plot.Light.Internal from the package plot-light
    -- | Construct a 'ShapeCol' for shapes that have no fill colour (i.e. have only the stroke colour)
    shapeColNoFill :: C.Colour Double -> a -> a -> ShapeCol a
    shapeColNoFill c a = NoFillCol $ col c a 
    
    -- | Construct a 'ShapeCol' for shapes that have both fill and stroke colour
    shapeColBoth ::
         C.Colour Double  -- ^ Fill colour
      -> C.Colour Double  -- ^ Stroke colour
      -> a                -- ^ Opacity 
      -> a                -- ^ Stroke width
      -> ShapeCol a
    shapeColBoth cs cf a = BothCol (col cs a) (col cf a)
    
    -- | Set the fill and stroke colour and opacity attributes all at once (e.g. if the fill is set to invisible, the stroke must be visible somehow.
    (!#) :: (Attributable h, Real a) => h -> ShapeCol a -> h
    m !# col = case col of
      NoBorderCol (Col c a) ->
        m ! SA.fillOpacity (vd a) ! SA.fill (colourAttr c) ! SA.stroke none
      NoFillCol (Col c a) sw  ->
        m ! SA.strokeOpacity (vd a) ! SA.stroke (colourAttr c) ! SA.strokeWidth (vd sw) ! SA.fill none
    

    Found in Graphics.Rendering.Plot.Light.Internal from the package plot-light
    -- | Construct a 'ShapeCol' for shapes that have no fill colour (i.e. have only the stroke colour)
    shapeColNoFill :: C.Colour Double -> a -> a -> ShapeCol a
    shapeColNoFill c a = NoFillCol $ col c a 
    
    -- | Construct a 'ShapeCol' for shapes that have both fill and stroke colour
    shapeColBoth ::
         C.Colour Double  -- ^ Fill colour
      -> C.Colour Double  -- ^ Stroke colour
      -> a                -- ^ Opacity 
      -> a                -- ^ Stroke width
      -> ShapeCol a
    shapeColBoth cs cf a = BothCol (col cs a) (col cf a)
    
    -- | Set the fill and stroke colour and opacity attributes all at once (e.g. if the fill is set to invisible, the stroke must be visible somehow.
    (!#) :: (Attributable h, Real a) => h -> ShapeCol a -> h
    m !# col = case col of
      NoBorderCol (Col c a) ->
        m ! SA.fillOpacity (vd a) ! SA.fill (colourAttr c) ! SA.stroke none
      NoFillCol (Col c a) sw  ->
        m ! SA.strokeOpacity (vd a) ! SA.stroke (colourAttr c) ! SA.strokeWidth (vd sw) ! SA.fill none
    

    Found in Graphics.Rendering.Plot.Light.Internal from the package plot-light
    -- | Construct a 'ShapeCol' for shapes that have no fill colour (i.e. have only the stroke colour)
    shapeColNoFill :: C.Colour Double -> a -> a -> ShapeCol a
    shapeColNoFill c a = NoFillCol $ col c a 
    
    -- | Construct a 'ShapeCol' for shapes that have both fill and stroke colour
    shapeColBoth ::
         C.Colour Double  -- ^ Fill colour
      -> C.Colour Double  -- ^ Stroke colour
      -> a                -- ^ Opacity 
      -> a                -- ^ Stroke width
      -> ShapeCol a
    shapeColBoth cs cf a = BothCol (col cs a) (col cf a)
    
    -- | Set the fill and stroke colour and opacity attributes all at once (e.g. if the fill is set to invisible, the stroke must be visible somehow.
    (!#) :: (Attributable h, Real a) => h -> ShapeCol a -> h
    m !# col = case col of
      NoBorderCol (Col c a) ->
        m ! SA.fillOpacity (vd a) ! SA.fill (colourAttr c) ! SA.stroke none
      NoFillCol (Col c a) sw  ->
        m ! SA.strokeOpacity (vd a) ! SA.stroke (colourAttr c) ! SA.strokeWidth (vd sw) ! SA.fill none
    

    Found in Graphics.Rendering.Plot.Light.Internal from the package plot-light
    -- | Create the SVG header
    svgHeader :: Real a =>
         a   -- ^ Image width (X axis)
      -> a   -- ^ Image height (Y axis)
      -> Svg -- ^ Image content
      -> Svg
    svgHeader w h  =
      S.docTypeSvg
      ! SA.version "1.1"
      ! SA.width (vd w)
      ! SA.height (vd h)
      ! SA.viewbox (vds [xmin fd, ymin fd, xmax fd, ymax fd]) where
         fd = mkFrameOrigin w h
    
    
    
    -- | A Col is both a 'Colour' and an alpha (opacity) coefficient
    data Col a = Col {
    

    Found in Graphics.Rendering.Plot.Light.Internal from the package plot-light
    -- | Create the SVG header
    svgHeader :: Real a =>
         a   -- ^ Image width (X axis)
      -> a   -- ^ Image height (Y axis)
      -> Svg -- ^ Image content
      -> Svg
    svgHeader w h  =
      S.docTypeSvg
      ! SA.version "1.1"
      ! SA.width (vd w)
      ! SA.height (vd h)
      ! SA.viewbox (vds [xmin fd, ymin fd, xmax fd, ymax fd]) where
         fd = mkFrameOrigin w h
    

    Found in Graphics.Rendering.Plot.Light.Internal from the package plot-light
                           } deriving (Eq, Show, Functor, Generic)
    
    figureDataDefault :: Floating a => FigureData a
    figureDataDefault = FigureData 400 300 0.1 0.9 0.1 0.9 10
    
    
    
    
    -- | Create the SVG header
    svgHeader :: Real a =>
         a   -- ^ Image width (X axis)
      -> a   -- ^ Image height (Y axis)
      -> Svg -- ^ Image content
      -> Svg
    svgHeader w h  =
      S.docTypeSvg
      ! SA.version "1.1"
      ! SA.width (vd w)
      ! SA.height (vd h)
      ! SA.viewbox (vds [xmin fd, ymin fd, xmax fd, ymax fd]) where
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Heatmap from the package plot-light
        d' = toUnitFramedLP nw nh <$> toCoord ll
        valMin = minimum $ _lplabel <$> d'
        valMax = maximum $ _lplabel <$> d'
        
       
    
    toCoord :: (Num i, Enum i) => [[c]] -> [(i, i, c)]
    toCoord ll = concat $ reverse $ go 0 ll [] where
      go i (x:xs) acc = go (i + 1) xs $ zip3 [0 ..] (repeat i) x : acc
      go _ [] acc = acc
    
    toUnitFramedLP :: (Fractional t) =>
          t -> t -> (t, t, l) -> LabeledPoint l t
    toUnitFramedLP w h (i, j, x) = LabeledPoint p x
      where p = Point (i/h) (j/w)
    
    
    
    -- | Plot a scalar function `f` of points in the plane (i.e. \(f : \mathbf{R}^2 \rightarrow \mathbf{R}\))
    plotFun2
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Heatmap from the package plot-light
        nw = fromIntegral $ length (head ll) 
        d' = toUnitFramedLP nw nh <$> toCoord ll
        valMin = minimum $ _lplabel <$> d'
        valMax = maximum $ _lplabel <$> d'
        
       
    
    toCoord :: (Num i, Enum i) => [[c]] -> [(i, i, c)]
    toCoord ll = concat $ reverse $ go 0 ll [] where
      go i (x:xs) acc = go (i + 1) xs $ zip3 [0 ..] (repeat i) x : acc
      go _ [] acc = acc
    
    toUnitFramedLP :: (Fractional t) =>
          t -> t -> (t, t, l) -> LabeledPoint l t
    toUnitFramedLP w h (i, j, x) = LabeledPoint p x
      where p = Point (i/h) (j/w)
    
    
    
    -- | Plot a scalar function `f` of points in the plane (i.e. \(f : \mathbf{R}^2 \rightarrow \mathbf{R}\))
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Heatmap from the package plot-light
      :: (Foldable f, Functor f, Show a, RealFrac a, RealFrac t) =>
         FigureData a         -- ^ Figure data
         -> [C.Colour Double] -- ^ Colour palette
         -> Frame a           -- ^ Frame containing the data
         -> a                 -- ^ Number of points along x axis
         -> a                 -- ^ " y axis
         -> f (LabeledPoint t a) -- ^ Data
         -> Svg
    heatmap' fdat palette from nw nh lp = do
      let
        w = figFWidth fdat / nw
        h = figFHeight fdat / nh
        to = frameFromFigData fdat
        (vmin, vmax) = (minimum &&& maximum) (_lplabel <$> lp)
      forM_ lp (pixel' palette w h vmin vmax . moveLabeledPointBwFrames from to False False)
    
      
    
    
    toFigFrame
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Heatmap from the package plot-light
    -- | `heatmap'` renders one SVG pixel for every `LabeledPoint` supplied as input. The `LabeledPoint`s must be bounded by the `Frame`.
    heatmap'
      :: (Foldable f, Functor f, Show a, RealFrac a, RealFrac t) =>
         FigureData a         -- ^ Figure data
         -> [C.Colour Double] -- ^ Colour palette
         -> Frame a           -- ^ Frame containing the data
         -> a                 -- ^ Number of points along x axis
         -> a                 -- ^ " y axis
         -> f (LabeledPoint t a) -- ^ Data
         -> Svg
    heatmap' fdat palette from nw nh lp = do
      let
        w = figFWidth fdat / nw
        h = figFHeight fdat / nh
        to = frameFromFigData fdat
        (vmin, vmax) = (minimum &&& maximum) (_lplabel <$> lp)
      forM_ lp (pixel' palette w h vmin vmax . moveLabeledPointBwFrames from to False False)
    
      
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Heatmap from the package plot-light
    -- | `heatmap` assumes the input data corresponds to evenly sampled values of a scalar-valued field, and it maps the data values onto the provided `palette` (which can be created e.g. with `brewerSet`).
    heatmap
      :: FigureData Rational   -- ^ Figure data
         -> [C.Colour Double]  -- ^ Colour palette
         -> [[Scientific]]     -- ^ Data
         -> Svg
    heatmap fdat palette d = do
      let (nh, nw, vmin, vmax, d') = prepData d
          w = figFWidth fdat / nw
          h = figFHeight fdat / nh
          from = Frame (Point 0 0) (Point 1 1)
          to = frameFromFigData fdat
      forM_ d' (pixel palette w h vmin vmax . toFigFrame from to) 
    
    -- | `heatmap'` renders one SVG pixel for every `LabeledPoint` supplied as input. The `LabeledPoint`s must be bounded by the `Frame`.
    heatmap'
      :: (Foldable f, Functor f, Show a, RealFrac a, RealFrac t) =>
         FigureData a         -- ^ Figure data
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Heatmap from the package plot-light
      
    
    
    
    
    -- | `heatmap` assumes the input data corresponds to evenly sampled values of a scalar-valued field, and it maps the data values onto the provided `palette` (which can be created e.g. with `brewerSet`).
    heatmap
      :: FigureData Rational   -- ^ Figure data
         -> [C.Colour Double]  -- ^ Colour palette
         -> [[Scientific]]     -- ^ Data
         -> Svg
    heatmap fdat palette d = do
      let (nh, nw, vmin, vmax, d') = prepData d
          w = figFWidth fdat / nw
          h = figFHeight fdat / nh
          from = Frame (Point 0 0) (Point 1 1)
          to = frameFromFigData fdat
      forM_ d' (pixel palette w h vmin vmax . toFigFrame from to) 
    
    -- | `heatmap'` renders one SVG pixel for every `LabeledPoint` supplied as input. The `LabeledPoint`s must be bounded by the `Frame`.
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Scatter from the package plot-light
      , spColour :: C.Colour Double   -- ^ Glyph colour
      , spAlpha :: a                  -- ^ Glyph opacity
      } deriving (Eq, Show)
    
    
    modifyScatterPoint ::
            (l -> b -> c)                             -- ^ Modifies glyph size
         -> (l -> b -> c)                             -- ^ Modifies glyph stroke width
         -> (l -> C.Colour Double -> C.Colour Double) -- ^ Modifies glyph colour
         -> (l -> b -> c)                             -- ^ Modifies glyph opacity
         -> ScatterPointData b
         -> LabeledPoint l d
         -> ScatterPointData c
    modifyScatterPoint f g h i (ScatterPointData glsh sz w col alpha) lp =
      ScatterPointData glsh (f lab sz) (g lab w) (h lab col) (i lab alpha)
      where
        lab = _lplabel lp
    
    
    -- | Glyph shape
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Scatter from the package plot-light
      , spStrokeWidth :: a            -- ^ Glyph stroke width
      , spColour :: C.Colour Double   -- ^ Glyph colour
      , spAlpha :: a                  -- ^ Glyph opacity
      } deriving (Eq, Show)
    
    
    modifyScatterPoint ::
            (l -> b -> c)                             -- ^ Modifies glyph size
         -> (l -> b -> c)                             -- ^ Modifies glyph stroke width
         -> (l -> C.Colour Double -> C.Colour Double) -- ^ Modifies glyph colour
         -> (l -> b -> c)                             -- ^ Modifies glyph opacity
         -> ScatterPointData b
         -> LabeledPoint l d
         -> ScatterPointData c
    modifyScatterPoint f g h i (ScatterPointData glsh sz w col alpha) lp =
      ScatterPointData glsh (f lab sz) (g lab w) (h lab col) (i lab alpha)
      where
        lab = _lplabel lp
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Scatter from the package plot-light
                 -> t                 -- ^ Data value lower bound
                 -> t                 -- ^ Data value upper bound
                 -> Int               -- ^ Number of legend entries
                 -> LegendPosition_   -- ^ Legend position in the figure
                 -> b                 -- ^ Legend length
                 -> (t -> b -> b)     -- ^ Modifies the glyph size
                 -> (t -> b -> b)     -- ^ Modifies the glyph stroke width
                 -> (t -> C.Colour Double -> C.Colour Double) -- ^ Modifies the glyph colour
                 -> (t -> b -> b)     -- ^ Modifies the glyph opacity
                 -> ScatterPointData b    -- ^ Glyph style defaults
                 -> Svg
    scatterLPBar fdat w vmin vmax n legpos legh f g h i spdat = legendBar fdat w vmin vmax n legpos legh fun where
      wglyph = spSize spdat
      fun _ _ _ _ _ lp@(LabeledPoint p val) = do
        scatterLP1 f g h i spdat lp
        text 0 (figLabelFontSize fdat) C.black TAStart (T.pack $ show (rr val :: Fixed E3))   (V2 (2 * wglyph) (0.5 * wglyph)) p
    
    
      
          
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Scatter from the package plot-light
    scatterLPBar :: (RealFrac t, Enum t, RealFrac b, Show b) =>
                    FigureData b
                 -> b                 -- ^ Legend width
                 -> t                 -- ^ Data value lower bound
                 -> t                 -- ^ Data value upper bound
                 -> Int               -- ^ Number of legend entries
                 -> LegendPosition_   -- ^ Legend position in the figure
                 -> b                 -- ^ Legend length
                 -> (t -> b -> b)     -- ^ Modifies the glyph size
                 -> (t -> b -> b)     -- ^ Modifies the glyph stroke width
                 -> (t -> C.Colour Double -> C.Colour Double) -- ^ Modifies the glyph colour
                 -> (t -> b -> b)     -- ^ Modifies the glyph opacity
                 -> ScatterPointData b    -- ^ Glyph style defaults
                 -> Svg
    scatterLPBar fdat w vmin vmax n legpos legh f g h i spdat = legendBar fdat w vmin vmax n legpos legh fun where
      wglyph = spSize spdat
      fun _ _ _ _ _ lp@(LabeledPoint p val) = do
        scatterLP1 f g h i spdat lp
        text 0 (figLabelFontSize fdat) C.black TAStart (T.pack $ show (rr val :: Fixed E3))   (V2 (2 * wglyph) (0.5 * wglyph)) p
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Scatter from the package plot-light
              -> Svg
    scatterLP f g h i spdat lps = forM_ lps (scatterLP1 f g h i spdat)
    
    
    scatterLP1 :: (Show a, RealFrac a) =>
                  (l -> b -> a)            -- ^ Modifies the glyph size
               -> (l -> b -> a)         -- ^ Modifies the glyph stroke width
               -> (l -> C.Colour Double -> C.Colour Double)  -- ^ Modifies the glyph colour
               -> (l -> b -> a)        -- ^ Modifies the glyph opacity
               -> ScatterPointData b   
               -> LabeledPoint l a
               -> Svg
    scatterLP1 f g h i spdat lp = glyph w' sw' sh col' a' (_lp lp)
     where
        ScatterPointData sh w' sw' col' a' = modifyScatterPoint f g h i spdat lp
    
    
    
    scatterLPBar :: (RealFrac t, Enum t, RealFrac b, Show b) =>
                    FigureData b
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Scatter from the package plot-light
              -> ScatterPointData b    -- ^ Glyph style defaults
              -> t (LabeledPoint l a) -- ^ Data
              -> Svg
    scatterLP f g h i spdat lps = forM_ lps (scatterLP1 f g h i spdat)
    
    
    scatterLP1 :: (Show a, RealFrac a) =>
                  (l -> b -> a)            -- ^ Modifies the glyph size
               -> (l -> b -> a)         -- ^ Modifies the glyph stroke width
               -> (l -> C.Colour Double -> C.Colour Double)  -- ^ Modifies the glyph colour
               -> (l -> b -> a)        -- ^ Modifies the glyph opacity
               -> ScatterPointData b   
               -> LabeledPoint l a
               -> Svg
    scatterLP1 f g h i spdat lp = glyph w' sw' sh col' a' (_lp lp)
     where
        ScatterPointData sh w' sw' col' a' = modifyScatterPoint f g h i spdat lp
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Scatter from the package plot-light
    -- | Parametric scatter plot
    --
    -- The parameters of every point in the scatter plot are modulated according to the label, using the three functions.
    --
    -- This can be used to produce rich infographics, in which e.g. the colour and size of the glyphs carry additional information.
    scatterLP :: (Foldable t, RealFrac a, Show a) =>
                 (l -> b -> a)            -- ^ Modifies the glyph size
              -> (l -> b -> a)         -- ^ Modifies the glyph stroke width
              -> (l -> C.Colour Double -> C.Colour Double)  -- ^ Modifies the glyph colour
              -> (l -> b -> a)        -- ^ Modifies the glyph opacity
              -> ScatterPointData b    -- ^ Glyph style defaults
              -> t (LabeledPoint l a) -- ^ Data
              -> Svg
    scatterLP f g h i spdat lps = forM_ lps (scatterLP1 f g h i spdat)
    
    
    scatterLP1 :: (Show a, RealFrac a) =>
                  (l -> b -> a)            -- ^ Modifies the glyph size
               -> (l -> b -> a)         -- ^ Modifies the glyph stroke width
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Scatter from the package plot-light
    -- | Parametric scatter plot
    --
    -- The parameters of every point in the scatter plot are modulated according to the label, using the three functions.
    --
    -- This can be used to produce rich infographics, in which e.g. the colour and size of the glyphs carry additional information.
    scatterLP :: (Foldable t, RealFrac a, Show a) =>
                 (l -> b -> a)            -- ^ Modifies the glyph size
              -> (l -> b -> a)         -- ^ Modifies the glyph stroke width
              -> (l -> C.Colour Double -> C.Colour Double)  -- ^ Modifies the glyph colour
              -> (l -> b -> a)        -- ^ Modifies the glyph opacity
              -> ScatterPointData b    -- ^ Glyph style defaults
              -> t (LabeledPoint l a) -- ^ Data
              -> Svg
    scatterLP f g h i spdat lps = forM_ lps (scatterLP1 f g h i spdat)
    
    
    scatterLP1 :: (Show a, RealFrac a) =>
                  (l -> b -> a)            -- ^ Modifies the glyph size
               -> (l -> b -> a)         -- ^ Modifies the glyph stroke width
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Histogram from the package plot-light
    main = do
      let
        kol = shapeColNoBorder C.red 1
        svg_t = svgHeader xPlot yPlot $ histogram kol 5 dats
      T.writeFile fnameOut $ T.pack $ renderSvg svg_t
    
    
    
    
    histogram :: Foldable v =>
                 ShapeCol Double -- ^ Colour information (fill, stroke, opacity)
              -> Int             -- ^ Number of histogram bins
              -> v Double        -- ^ Data
              -> Svg
    histogram col nBins dats = forM_ pshs $ \(p, h) -> rectCenteredMidpointBase binW (hMult * h) col p where
      his = histo nBins dats
      p1 = Point (head binCenters) 0
      p2 = Point (last binCenters) 0
      ps = pointRange nBins p1 p2
      pshs = zip ps binCounts 
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Histogram from the package plot-light
    main = do
      let
        kol = shapeColNoBorder C.red 1
        svg_t = svgHeader xPlot yPlot $ histogram kol 5 dats
      T.writeFile fnameOut $ T.pack $ renderSvg svg_t
    
    
    
    
    histogram :: Foldable v =>
                 ShapeCol Double -- ^ Colour information (fill, stroke, opacity)
              -> Int             -- ^ Number of histogram bins
              -> v Double        -- ^ Data
              -> Svg
    histogram col nBins dats = forM_ pshs $ \(p, h) -> rectCenteredMidpointBase binW (hMult * h) col p where
      his = histo nBins dats
      p1 = Point (head binCenters) 0
      p2 = Point (last binCenters) 0
      ps = pointRange nBins p1 p2
      pshs = zip ps binCounts 
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.TimeSeries from the package plot-light
    frameToFrameFxRow from to fxr = f <$> fxr
      where
        f = frameToFrameValue from to
    
    
    data FxRow a  = FxRow {
        rateOpen :: a
      , rateHigh :: a
      , rateLow :: a
      , rateClose :: a
                   } deriving (Eq, Show)
    
    instance Functor FxRow where
      fmap f (FxRow o h l c) = FxRow (f o) (f h) (f l) (f c)
    
    c1 = FxRow 1.0876 1.0880 1.0872 1.0874
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.TimeSeries from the package plot-light
    frameToFrameFxRow from to fxr = f <$> fxr
      where
        f = frameToFrameValue from to
    
    
    data FxRow a  = FxRow {
        rateOpen :: a
      , rateHigh :: a
      , rateLow :: a
      , rateClose :: a
                   } deriving (Eq, Show)
    
    instance Functor FxRow where
      fmap f (FxRow o h l c) = FxRow (f o) (f h) (f l) (f c)
    
    c1 = FxRow 1.0876 1.0880 1.0872 1.0874
    

    hr See 2 Occurences [+] Collapse [-]
    Found in Graphics.Rendering.Plot.Light.PlotTypes.TimeSeries from the package plot-light
      fmax' = fdat . fmax
      fmin' = fdat . fmin
    
    
    
    
    
    -- | An instant, defined by date (Day) and TimeOfDay
    data Tick = Tick Day TimeOfDay
      deriving (Eq, Show, Ord)
    
    -- | Create a Tick from valid (year, month, day, hour, minute, second)
    mkTick :: Integer -> Int -> Int -> Int -> Int -> Pico -> Maybe Tick
    mkTick yy mm dd hr mi se = do
       tim <- makeTimeOfDayValid hr mi se
       let d = fromGregorian yy mm dd
       return $ Tick d tim
    
    -- | A point in a time series
    data TsPoint a =
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.TimeSeries from the package plot-light
      fplot = filledBand col 0.4 fmax' fmin'
      fmax' = fdat . fmax
      fmin' = fdat . fmin
    
    
    
    
    
    -- | An instant, defined by date (Day) and TimeOfDay
    data Tick = Tick Day TimeOfDay
      deriving (Eq, Show, Ord)
    
    -- | Create a Tick from valid (year, month, day, hour, minute, second)
    mkTick :: Integer -> Int -> Int -> Int -> Int -> Pico -> Maybe Tick
    mkTick yy mm dd hr mi se = do
       tim <- makeTimeOfDayValid hr mi se
       let d = fromGregorian yy mm dd
       return $ Tick d tim
    
    -- | A point in a time series
    

    l See 58 Occurences [+] Collapse [-]
    Found in Graphics.Rendering.Plot.Light.Internal from the package plot-light
    pixel pal w h vmin vmax (LabeledPoint p l) = rect w h col p where
      col = pickColour pal (toFloat vmin) (toFloat vmax) (toFloat l)
    
    -- | A 'pixel'' is a filled square shape used for populating 'heatmap' plots , coloured from a palette
    pixel'
      :: (Show a, RealFrac a, RealFrac t) =>
         [C.Colour Double]  -- ^ Palette
      -> a                  -- ^ Width 
      -> a -- ^ Height
      -> t -- ^ Function minimum 
      -> t -- ^ Function maximum
      -> LabeledPoint t a
      -> Svg
    pixel' pal w h vmin vmax (LabeledPoint p l) = rect w h col p where
      col = pickColour pal vmin vmax l
      
    
    -- | Pick a colour from a list, assumed to be a palette mapped onto a compact numerical interval.
    pickColour :: (RealFrac t, Num a) =>
            [C.Colour Double] -> t -> t -> t -> ShapeCol a
    

    Found in Graphics.Rendering.Plot.Light.Internal from the package plot-light
          -> Svg
    pixel pal w h vmin vmax (LabeledPoint p l) = rect w h col p where
      col = pickColour pal (toFloat vmin) (toFloat vmax) (toFloat l)
    
    -- | A 'pixel'' is a filled square shape used for populating 'heatmap' plots , coloured from a palette
    pixel'
      :: (Show a, RealFrac a, RealFrac t) =>
         [C.Colour Double]  -- ^ Palette
      -> a                  -- ^ Width 
      -> a -- ^ Height
      -> t -- ^ Function minimum 
      -> t -- ^ Function maximum
      -> LabeledPoint t a
      -> Svg
    pixel' pal w h vmin vmax (LabeledPoint p l) = rect w h col p where
      col = pickColour pal vmin vmax l
      
    
    -- | Pick a colour from a list, assumed to be a palette mapped onto a compact numerical interval.
    pickColour :: (RealFrac t, Num a) =>
    

    Found in Graphics.Rendering.Plot.Light.Internal from the package plot-light
    -- | A 'pixel' is a filled square shape used for populating 'heatmap' plots , coloured from a palette
    pixel :: (Show a, RealFrac a) =>
             [C.Colour Double]         -- ^ Palette
          -> a                         -- ^ Width
          -> a                         -- ^ Height
          -> Scientific                -- ^ Function minimum
          -> Scientific               -- ^ Function maximum
          -> LabeledPoint Scientific a
          -> Svg
    pixel pal w h vmin vmax (LabeledPoint p l) = rect w h col p where
      col = pickColour pal (toFloat vmin) (toFloat vmax) (toFloat l)
    
    -- | A 'pixel'' is a filled square shape used for populating 'heatmap' plots , coloured from a palette
    pixel'
      :: (Show a, RealFrac a, RealFrac t) =>
         [C.Colour Double]  -- ^ Palette
    

    Found in Graphics.Rendering.Plot.Light.Internal from the package plot-light
    -- | A 'pixel' is a filled square shape used for populating 'heatmap' plots , coloured from a palette
    pixel :: (Show a, RealFrac a) =>
             [C.Colour Double]         -- ^ Palette
          -> a                         -- ^ Width
          -> a                         -- ^ Height
          -> Scientific                -- ^ Function minimum
          -> Scientific               -- ^ Function maximum
          -> LabeledPoint Scientific a
          -> Svg
    pixel pal w h vmin vmax (LabeledPoint p l) = rect w h col p where
      col = pickColour pal (toFloat vmin) (toFloat vmax) (toFloat l)
    
    -- | A 'pixel'' is a filled square shape used for populating 'heatmap' plots , coloured from a palette
    pixel'
      :: (Show a, RealFrac a, RealFrac t) =>
    

    Found in Graphics.Rendering.Plot.Light.Internal from the package plot-light
    -- | Move point to the SVG frame of reference (for which the origing is a the top-left corner of the screen)
    toSvgFrame ::
      Fractional a =>
         Frame a  -- ^ Initial frame
      -> Frame a  -- ^ Final frame
      -> Bool     -- ^ Flip L-R in [0,1] x [0,1]
      -> Point a  -- ^ Point in the initial frame
      -> Point a
    toSvgFrame from to fliplr p = pointFromV2 v' where
      v' = frameToFrame from to fliplr True (v2fromPoint p)
    
    
    -- | Move LabeledPoint to the SVG frame of reference (uses `toSvgFrame` ) 
    toSvgFrameLP ::
      Fractional a => Frame a -> Frame a -> Bool -> LabeledPoint l a -> LabeledPoint l a
    toSvgFrameLP from to fliplr (LabeledPoint p lab) = LabeledPoint (toSvgFrame from to fliplr p) lab
    
    
    -- withToSvgFrame figdata dat = datf
    --   where
    

    Found in Graphics.Rendering.Plot.Light.Internal from the package plot-light
    -- | Move point to the SVG frame of reference (for which the origing is a the top-left corner of the screen)
    toSvgFrame ::
      Fractional a =>
         Frame a  -- ^ Initial frame
      -> Frame a  -- ^ Final frame
      -> Bool     -- ^ Flip L-R in [0,1] x [0,1]
      -> Point a  -- ^ Point in the initial frame
      -> Point a
    toSvgFrame from to fliplr p = pointFromV2 v' where
      v' = frameToFrame from to fliplr True (v2fromPoint p)
    
    
    -- | Move LabeledPoint to the SVG frame of reference (uses `toSvgFrame` ) 
    toSvgFrameLP ::
      Fractional a => Frame a -> Frame a -> Bool -> LabeledPoint l a -> LabeledPoint l a
    toSvgFrameLP from to fliplr (LabeledPoint p lab) = LabeledPoint (toSvgFrame from to fliplr p) lab
    
    
    -- withToSvgFrame figdata dat = datf
    --   where
    

    Found in Graphics.Rendering.Plot.Light.Internal from the package plot-light
    --
    -- By convention, the `candlestick` colour depends on the derivative sign of one such quantity (e.g. it is green if the market closes higher than it opened, and red otherwise).
    candlestick
      :: (Show a, RealFrac a) =>
         (a -> a -> Bool)       -- ^ If True, fill the box with the first colour, otherwise with the second
         -> (l -> a) -- ^ Box maximum value
         -> (l -> a) -- ^ Box minimum value
         -> (l -> a) -- ^ Line maximum value 
         -> (l -> a) -- ^ Line minimum value
         -> a                       -- ^ Box width
         -> a                       -- ^ Stroke width
         -> ShapeCol a              -- ^ First box colour
         -> ShapeCol a              -- ^ Second box colour
         -> C.Colour Double         -- ^ Line stroke colour
         -> LabeledPoint l a        -- ^ Data point
         -> Svg
    candlestick fdec fboxmin fboxmax fmin fmax wid sw col1 col2 colstroke lp = do
      line pmin pmax sw Continuous colstroke
      rectCentered wid hei col p
        where
    

    Found in Graphics.Rendering.Plot.Light.Internal from the package plot-light
      lis2 = f2  <$> reverse lis
    
    
    -- | A `candlestick` glyph for time series plots. This is a type of box glyph, commonly used in plotting financial time series.
    --
    -- Some financial market quantities such as currency exchange rates are aggregated over some time period (e.g. a day) and summarized by various quantities, for example opening and closing rates, as well as maximum and minimum over the period.
    --
    -- By convention, the `candlestick` colour depends on the derivative sign of one such quantity (e.g. it is green if the market closes higher than it opened, and red otherwise).
    candlestick
      :: (Show a, RealFrac a) =>
         (a -> a -> Bool)       -- ^ If True, fill the box with the first colour, otherwise with the second
         -> (l -> a) -- ^ Box maximum value
         -> (l -> a) -- ^ Box minimum value
         -> (l -> a) -- ^ Line maximum value 
         -> (l -> a) -- ^ Line minimum value
         -> a                       -- ^ Box width
         -> a                       -- ^ Stroke width
         -> ShapeCol a              -- ^ First box colour
         -> ShapeCol a              -- ^ Second box colour
         -> C.Colour Double         -- ^ Line stroke colour
    

    Found in Graphics.Rendering.Plot.Light.Internal from the package plot-light
      lis1 = f1  <$> lis
      lis2 = f2  <$> reverse lis
    
    
    -- | A `candlestick` glyph for time series plots. This is a type of box glyph, commonly used in plotting financial time series.
    --
    -- Some financial market quantities such as currency exchange rates are aggregated over some time period (e.g. a day) and summarized by various quantities, for example opening and closing rates, as well as maximum and minimum over the period.
    --
    -- By convention, the `candlestick` colour depends on the derivative sign of one such quantity (e.g. it is green if the market closes higher than it opened, and red otherwise).
    candlestick
      :: (Show a, RealFrac a) =>
         (a -> a -> Bool)       -- ^ If True, fill the box with the first colour, otherwise with the second
         -> (l -> a) -- ^ Box maximum value
         -> (l -> a) -- ^ Box minimum value
         -> (l -> a) -- ^ Line maximum value 
         -> (l -> a) -- ^ Line minimum value
         -> a                       -- ^ Box width
         -> a                       -- ^ Stroke width
         -> ShapeCol a              -- ^ First box colour
         -> ShapeCol a              -- ^ Second box colour
    

    Found in Graphics.Rendering.Plot.Light.Internal from the package plot-light
      f2 lp = setPointY (fbot $ _lplabel lp) $ _lp lp
      lis1 = f1  <$> lis
      lis2 = f2  <$> reverse lis
    
    
    -- | A `candlestick` glyph for time series plots. This is a type of box glyph, commonly used in plotting financial time series.
    --
    -- Some financial market quantities such as currency exchange rates are aggregated over some time period (e.g. a day) and summarized by various quantities, for example opening and closing rates, as well as maximum and minimum over the period.
    --
    -- By convention, the `candlestick` colour depends on the derivative sign of one such quantity (e.g. it is green if the market closes higher than it opened, and red otherwise).
    candlestick
      :: (Show a, RealFrac a) =>
         (a -> a -> Bool)       -- ^ If True, fill the box with the first colour, otherwise with the second
         -> (l -> a) -- ^ Box maximum value
         -> (l -> a) -- ^ Box minimum value
         -> (l -> a) -- ^ Line maximum value 
         -> (l -> a) -- ^ Line minimum value
         -> a                       -- ^ Box width
         -> a                       -- ^ Stroke width
         -> ShapeCol a              -- ^ First box colour
    

    Found in Graphics.Rendering.Plot.Light.Internal from the package plot-light
      f1 lp = setPointY (ftop $ _lplabel lp) $ _lp lp
      f2 lp = setPointY (fbot $ _lplabel lp) $ _lp lp
      lis1 = f1  <$> lis
      lis2 = f2  <$> reverse lis
    
    
    -- | A `candlestick` glyph for time series plots. This is a type of box glyph, commonly used in plotting financial time series.
    --
    -- Some financial market quantities such as currency exchange rates are aggregated over some time period (e.g. a day) and summarized by various quantities, for example opening and closing rates, as well as maximum and minimum over the period.
    --
    -- By convention, the `candlestick` colour depends on the derivative sign of one such quantity (e.g. it is green if the market closes higher than it opened, and red otherwise).
    candlestick
      :: (Show a, RealFrac a) =>
         (a -> a -> Bool)       -- ^ If True, fill the box with the first colour, otherwise with the second
         -> (l -> a) -- ^ Box maximum value
         -> (l -> a) -- ^ Box minimum value
         -> (l -> a) -- ^ Line maximum value 
         -> (l -> a) -- ^ Line minimum value
         -> a                       -- ^ Box width
         -> a                       -- ^ Stroke width
    

    Found in Graphics.Rendering.Plot.Light.Internal from the package plot-light
                   -> o                 -- ^ Fill opacity
                   -> t (Point a)       -- ^ Contour point coordinates
                   -> Svg
    filledPolyline col opac lis = S.polyline ! SA.points (S.toValue $ unwords $ map show $ F.toList lis) ! SA.fill (colourAttr col) ! SA.fillOpacity (vd opac)
    
    
    -- | A filled band of colour, given the coordinates of its center line
    --
    -- This element can be used to overlay uncertainty ranges (e.g. the first standard deviation) associated with a given data series.
    filledBand :: (Foldable t, Real o, Show a) =>
        C.Colour Double          -- ^ Fill colour
               -> o              -- ^ Fill opacity
               -> (l -> a) -- ^ Band maximum value
               -> (l -> a) -- ^ Band minimum value
               -> t (LabeledPoint l a)    -- ^ Centerline points
               -> Svg
    filledBand col opac ftop fbot lis0 = filledPolyline col opac (lis1 <> lis2) where
      lis = F.toList lis0
      f1 lp = setPointY (ftop $ _lplabel lp) $ _lp lp
      f2 lp = setPointY (fbot $ _lplabel lp) $ _lp lp
    

    Found in Graphics.Rendering.Plot.Light.Internal from the package plot-light
                      C.Colour Double   -- ^ Fill colour
                   -> o                 -- ^ Fill opacity
                   -> t (Point a)       -- ^ Contour point coordinates
                   -> Svg
    filledPolyline col opac lis = S.polyline ! SA.points (S.toValue $ unwords $ map show $ F.toList lis) ! SA.fill (colourAttr col) ! SA.fillOpacity (vd opac)
    
    
    -- | A filled band of colour, given the coordinates of its center line
    --
    -- This element can be used to overlay uncertainty ranges (e.g. the first standard deviation) associated with a given data series.
    filledBand :: (Foldable t, Real o, Show a) =>
        C.Colour Double          -- ^ Fill colour
               -> o              -- ^ Fill opacity
               -> (l -> a) -- ^ Band maximum value
               -> (l -> a) -- ^ Band minimum value
               -> t (LabeledPoint l a)    -- ^ Centerline points
               -> Svg
    filledBand col opac ftop fbot lis0 = filledPolyline col opac (lis1 <> lis2) where
      lis = F.toList lis0
      f1 lp = setPointY (ftop $ _lplabel lp) $ _lp lp
    

    Found in Graphics.Rendering.Plot.Light.Internal from the package plot-light
    filledPolyline :: (Foldable t, Show a, Real o) =>
                      C.Colour Double   -- ^ Fill colour
                   -> o                 -- ^ Fill opacity
                   -> t (Point a)       -- ^ Contour point coordinates
                   -> Svg
    filledPolyline col opac lis = S.polyline ! SA.points (S.toValue $ unwords $ map show $ F.toList lis) ! SA.fill (colourAttr col) ! SA.fillOpacity (vd opac)
    
    
    -- | A filled band of colour, given the coordinates of its center line
    --
    -- This element can be used to overlay uncertainty ranges (e.g. the first standard deviation) associated with a given data series.
    filledBand :: (Foldable t, Real o, Show a) =>
        C.Colour Double          -- ^ Fill colour
               -> o              -- ^ Fill opacity
               -> (l -> a) -- ^ Band maximum value
               -> (l -> a) -- ^ Band minimum value
               -> t (LabeledPoint l a)    -- ^ Centerline points
               -> Svg
    filledBand col opac ftop fbot lis0 = filledPolyline col opac (lis1 <> lis2) where
      lis = F.toList lis0
    

    Found in Graphics.Rendering.Plot.Light.Internal from the package plot-light
    -- * Renders the X, Y axes
    --
    -- * Renders the transformed dataset onto the newly created plot canvas
    toPlot :: (Functor t, Foldable t, Show a, RealFrac a) =>
              FigureData a     
           -> (l -> T.Text)  -- ^ X tick label
           -> (l -> T.Text)  -- ^ Y tick label
           -> a   -- ^ X label rotation angle
           -> a -- ^ Y label rotation angle
           -> a -- ^ Stroke width
           -> C.Colour Double -- ^ Stroke colour
           -> Maybe (t (LabeledPoint l a))  -- ^ X axis labels
           -> Maybe (t (LabeledPoint l a))  -- ^ Y axis labels
           -> (t (LabeledPoint l a) -> Svg)  -- ^ Data rendering function
           -> t (LabeledPoint l a) -- ^ Data
           -> Svg 
    toPlot fd flabelx flabely rotx roty sw col1 tickxe tickye plotf dat = do
      axis oSvg X (width to) sw col1 0.05 Continuous fontsize rotx TAEnd flabelx (V2 (-10) 0) tickx
      axis oSvg Y (negate $ height to) sw col1 0.05 Continuous fontsize roty TAEnd flabely (V2 (-10) 0) ticky
      plotf dat'
    

    Found in Graphics.Rendering.Plot.Light.Internal from the package plot-light
    -- 
    -- * Renders the X, Y axes
    --
    -- * Renders the transformed dataset onto the newly created plot canvas
    toPlot :: (Functor t, Foldable t, Show a, RealFrac a) =>
              FigureData a     
           -> (l -> T.Text)  -- ^ X tick label
           -> (l -> T.Text)  -- ^ Y tick label
           -> a   -- ^ X label rotation angle
           -> a -- ^ Y label rotation angle
           -> a -- ^ Stroke width
           -> C.Colour Double -- ^ Stroke colour
           -> Maybe (t (LabeledPoint l a))  -- ^ X axis labels
           -> Maybe (t (LabeledPoint l a))  -- ^ Y axis labels
           -> (t (LabeledPoint l a) -> Svg)  -- ^ Data rendering function
           -> t (LabeledPoint l a) -- ^ Data
           -> Svg 
    toPlot fd flabelx flabely rotx roty sw col1 tickxe tickye plotf dat = do
      axis oSvg X (width to) sw col1 0.05 Continuous fontsize rotx TAEnd flabelx (V2 (-10) 0) tickx
      axis oSvg Y (negate $ height to) sw col1 0.05 Continuous fontsize roty TAEnd flabely (V2 (-10) 0) ticky
    

    Found in Graphics.Rendering.Plot.Light.Internal from the package plot-light
    -- * Maps the dataset to the figure frame
    -- 
    -- * Renders the X, Y axes
    --
    -- * Renders the transformed dataset onto the newly created plot canvas
    toPlot :: (Functor t, Foldable t, Show a, RealFrac a) =>
              FigureData a     
           -> (l -> T.Text)  -- ^ X tick label
           -> (l -> T.Text)  -- ^ Y tick label
           -> a   -- ^ X label rotation angle
           -> a -- ^ Y label rotation angle
           -> a -- ^ Stroke width
           -> C.Colour Double -- ^ Stroke colour
           -> Maybe (t (LabeledPoint l a))  -- ^ X axis labels
           -> Maybe (t (LabeledPoint l a))  -- ^ Y axis labels
           -> (t (LabeledPoint l a) -> Svg)  -- ^ Data rendering function
           -> t (LabeledPoint l a) -- ^ Data
           -> Svg 
    toPlot fd flabelx flabely rotx roty sw col1 tickxe tickye plotf dat = do
      axis oSvg X (width to) sw col1 0.05 Continuous fontsize rotx TAEnd flabelx (V2 (-10) 0) tickx
    

    Found in Graphics.Rendering.Plot.Light.Internal from the package plot-light
    --
    -- * Maps the dataset to the figure frame
    -- 
    -- * Renders the X, Y axes
    --
    -- * Renders the transformed dataset onto the newly created plot canvas
    toPlot :: (Functor t, Foldable t, Show a, RealFrac a) =>
              FigureData a     
           -> (l -> T.Text)  -- ^ X tick label
           -> (l -> T.Text)  -- ^ Y tick label
           -> a   -- ^ X label rotation angle
           -> a -- ^ Y label rotation angle
           -> a -- ^ Stroke width
           -> C.Colour Double -- ^ Stroke colour
           -> Maybe (t (LabeledPoint l a))  -- ^ X axis labels
           -> Maybe (t (LabeledPoint l a))  -- ^ Y axis labels
           -> (t (LabeledPoint l a) -> Svg)  -- ^ Data rendering function
           -> t (LabeledPoint l a) -- ^ Data
           -> Svg 
    toPlot fd flabelx flabely rotx roty sw col1 tickxe tickye plotf dat = do
    

    Found in Graphics.Rendering.Plot.Light.Internal from the package plot-light
        
    
    
    
    -- | `toPlot` performs a number of related operations:
    --
    -- * Maps the dataset to the figure frame
    -- 
    -- * Renders the X, Y axes
    --
    -- * Renders the transformed dataset onto the newly created plot canvas
    toPlot :: (Functor t, Foldable t, Show a, RealFrac a) =>
              FigureData a     
           -> (l -> T.Text)  -- ^ X tick label
           -> (l -> T.Text)  -- ^ Y tick label
           -> a   -- ^ X label rotation angle
           -> a -- ^ Y label rotation angle
           -> a -- ^ Stroke width
           -> C.Colour Double -- ^ Stroke colour
           -> Maybe (t (LabeledPoint l a))  -- ^ X axis labels
    

    Found in Graphics.Rendering.Plot.Light.Internal from the package plot-light
        showlabf x = T.pack $ show (fromRational x :: Fixed E2)
        
    
    
    
    -- | `toPlot` performs a number of related operations:
    --
    -- * Maps the dataset to the figure frame
    -- 
    -- * Renders the X, Y axes
    --
    -- * Renders the transformed dataset onto the newly created plot canvas
    toPlot :: (Functor t, Foldable t, Show a, RealFrac a) =>
              FigureData a     
           -> (l -> T.Text)  -- ^ X tick label
           -> (l -> T.Text)  -- ^ Y tick label
           -> a   -- ^ X label rotation angle
           -> a -- ^ Y label rotation angle
           -> a -- ^ Stroke width
           -> C.Colour Double -- ^ Stroke colour
    

    Found in Graphics.Rendering.Plot.Light.Internal from the package plot-light
    -- > <line x1="0.0" y1="50.0" x2="200.0" y2="50.0" stroke="#ff0000" stroke-width="2.0" /><line x1="50.0" y1="45.0" x2="50.0" y2="55.0" stroke="#ff0000" stroke-width="2.0" /><text x="-10.0" y="0.0" transform="translate(50.0 50.0)rotate(-45.0)" font-size="15" fill="#ff0000" text-anchor="end">bla</text><line x1="60.0" y1="45.0" x2="60.0" y2="55.0" stroke="#ff0000" stroke-width="2.0" /><text x="-10.0" y="0.0" transform="translate(60.0 50.0)rotate(-45.0)" font-size="15" fill="#ff0000" text-anchor="end">asdf</text>
    axis :: (Functor t, Foldable t, Show a, RealFrac a) =>
                  Point a            -- ^ Origin coordinates
                  -> Axis            -- ^ Axis (i.e. either `X` or `Y`)
                  -> a               -- ^ Length of the axis
                  -> a               -- ^ Stroke width
                  -> C.Colour Double -- ^ Stroke colour
                  -> a               -- ^ The tick length is a fraction of the axis length
                  -> LineStroke_ a   -- ^ Stroke type
                  -> Int               -- ^ Label font size
                  -> a               -- ^ Label rotation angle
                  -> TextAnchor_     -- ^ How to anchor a text label to the axis
                  -> (l -> T.Text)   -- ^ How to render the tick label
                  -> V2 a            -- ^ Offset the label
                  -> t (LabeledPoint l a)     -- ^ Tick center coordinates
                  -> Svg
    axis o@(Point ox oy) ax len sw col tickLenFrac ls fontsize lrot tanchor flab vlab ps = do
          line o pend sw ls col
          labeledTicks (otherAxis ax) (tickLenFrac * len) sw col fontsize lrot tanchor flab vlab (moveLabeledPoint f <$> ps)
            where
    

    Found in Graphics.Rendering.Plot.Light.Internal from the package plot-light
    --
    -- > > putStrLn $ renderSvg $ axis (Point 0 50) X 200 2 C.red 0.05 Continuous 15 (-45) TAEnd T.pack (V2 (-10) 0) [LabeledPoint (Point 50 1) "bla", LabeledPoint (Point 60 1) "asdf"]
    -- > <line x1="0.0" y1="50.0" x2="200.0" y2="50.0" stroke="#ff0000" stroke-width="2.0" /><line x1="50.0" y1="45.0" x2="50.0" y2="55.0" stroke="#ff0000" stroke-width="2.0" /><text x="-10.0" y="0.0" transform="translate(50.0 50.0)rotate(-45.0)" font-size="15" fill="#ff0000" text-anchor="end">bla</text><line x1="60.0" y1="45.0" x2="60.0" y2="55.0" stroke="#ff0000" stroke-width="2.0" /><text x="-10.0" y="0.0" transform="translate(60.0 50.0)rotate(-45.0)" font-size="15" fill="#ff0000" text-anchor="end">asdf</text>
    axis :: (Functor t, Foldable t, Show a, RealFrac a) =>
                  Point a            -- ^ Origin coordinates
                  -> Axis            -- ^ Axis (i.e. either `X` or `Y`)
                  -> a               -- ^ Length of the axis
                  -> a               -- ^ Stroke width
                  -> C.Colour Double -- ^ Stroke colour
                  -> a               -- ^ The tick length is a fraction of the axis length
                  -> LineStroke_ a   -- ^ Stroke type
                  -> Int               -- ^ Label font size
                  -> a               -- ^ Label rotation angle
                  -> TextAnchor_     -- ^ How to anchor a text label to the axis
                  -> (l -> T.Text)   -- ^ How to render the tick label
                  -> V2 a            -- ^ Offset the label
                  -> t (LabeledPoint l a)     -- ^ Tick center coordinates
                  -> Svg
    axis o@(Point ox oy) ax len sw col tickLenFrac ls fontsize lrot tanchor flab vlab ps = do
          line o pend sw ls col
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Heatmap from the package plot-light
    toCoord ll = concat $ reverse $ go 0 ll [] where
      go i (x:xs) acc = go (i + 1) xs $ zip3 [0 ..] (repeat i) x : acc
      go _ [] acc = acc
    
    toUnitFramedLP :: (Fractional t) =>
          t -> t -> (t, t, l) -> LabeledPoint l t
    toUnitFramedLP w h (i, j, x) = LabeledPoint p x
      where p = Point (i/h) (j/w)
    
    
    
    -- | Plot a scalar function `f` of points in the plane (i.e. \(f : \mathbf{R}^2 \rightarrow \mathbf{R}\))
    plotFun2
      :: Functor f =>
         (t -> t -> l) -> f (Point t) -> f (LabeledPoint l t)
    plotFun2 f = fmap f' where
      f' p@(Point x y) = LabeledPoint p (f x y)
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Heatmap from the package plot-light
    toCoord ll = concat $ reverse $ go 0 ll [] where
      go i (x:xs) acc = go (i + 1) xs $ zip3 [0 ..] (repeat i) x : acc
      go _ [] acc = acc
    
    toUnitFramedLP :: (Fractional t) =>
          t -> t -> (t, t, l) -> LabeledPoint l t
    toUnitFramedLP w h (i, j, x) = LabeledPoint p x
      where p = Point (i/h) (j/w)
    
    
    
    -- | Plot a scalar function `f` of points in the plane (i.e. \(f : \mathbf{R}^2 \rightarrow \mathbf{R}\))
    plotFun2
      :: Functor f =>
         (t -> t -> l) -> f (Point t) -> f (LabeledPoint l t)
    plotFun2 f = fmap f' where
      f' p@(Point x y) = LabeledPoint p (f x y)
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Heatmap from the package plot-light
        nh = fromIntegral $ length ll
        nw = fromIntegral $ length (head ll) 
        d' = toUnitFramedLP nw nh <$> toCoord ll
        valMin = minimum $ _lplabel <$> d'
        valMax = maximum $ _lplabel <$> d'
        
       
    
    toCoord :: (Num i, Enum i) => [[c]] -> [(i, i, c)]
    toCoord ll = concat $ reverse $ go 0 ll [] where
      go i (x:xs) acc = go (i + 1) xs $ zip3 [0 ..] (repeat i) x : acc
      go _ [] acc = acc
    
    toUnitFramedLP :: (Fractional t) =>
          t -> t -> (t, t, l) -> LabeledPoint l t
    toUnitFramedLP w h (i, j, x) = LabeledPoint p x
      where p = Point (i/h) (j/w)
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Heatmap from the package plot-light
        nh = fromIntegral $ length ll
        nw = fromIntegral $ length (head ll) 
        d' = toUnitFramedLP nw nh <$> toCoord ll
        valMin = minimum $ _lplabel <$> d'
        valMax = maximum $ _lplabel <$> d'
        
       
    
    toCoord :: (Num i, Enum i) => [[c]] -> [(i, i, c)]
    toCoord ll = concat $ reverse $ go 0 ll [] where
      go i (x:xs) acc = go (i + 1) xs $ zip3 [0 ..] (repeat i) x : acc
      go _ [] acc = acc
    
    toUnitFramedLP :: (Fractional t) =>
          t -> t -> (t, t, l) -> LabeledPoint l t
    toUnitFramedLP w h (i, j, x) = LabeledPoint p x
      where p = Point (i/h) (j/w)
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Heatmap from the package plot-light
        h = figFHeight fdat / nh
        to = frameFromFigData fdat
        (vmin, vmax) = (minimum &&& maximum) (_lplabel <$> lp)
      forM_ lp (pixel' palette w h vmin vmax . moveLabeledPointBwFrames from to False False)
    
      
    
    
    toFigFrame
      :: Fractional a =>
         Frame a -> Frame a -> LabeledPoint l Rational -> LabeledPoint l a
    toFigFrame from to = moveLabeledPointBwFrames from to False False . fromRationalLP
    
    fromRationalLP :: Fractional a => LabeledPoint l Rational -> LabeledPoint l a
    fromRationalLP (LabeledPoint (Point x y) l) = LabeledPoint (Point (fromRational x) (fromRational y)) l
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Heatmap from the package plot-light
        h = figFHeight fdat / nh
        to = frameFromFigData fdat
        (vmin, vmax) = (minimum &&& maximum) (_lplabel <$> lp)
      forM_ lp (pixel' palette w h vmin vmax . moveLabeledPointBwFrames from to False False)
    
      
    
    
    toFigFrame
      :: Fractional a =>
         Frame a -> Frame a -> LabeledPoint l Rational -> LabeledPoint l a
    toFigFrame from to = moveLabeledPointBwFrames from to False False . fromRationalLP
    
    fromRationalLP :: Fractional a => LabeledPoint l Rational -> LabeledPoint l a
    fromRationalLP (LabeledPoint (Point x y) l) = LabeledPoint (Point (fromRational x) (fromRational y)) l
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Heatmap from the package plot-light
        w = figFWidth fdat / nw
        h = figFHeight fdat / nh
        to = frameFromFigData fdat
        (vmin, vmax) = (minimum &&& maximum) (_lplabel <$> lp)
      forM_ lp (pixel' palette w h vmin vmax . moveLabeledPointBwFrames from to False False)
    
      
    
    
    toFigFrame
      :: Fractional a =>
         Frame a -> Frame a -> LabeledPoint l Rational -> LabeledPoint l a
    toFigFrame from to = moveLabeledPointBwFrames from to False False . fromRationalLP
    
    fromRationalLP :: Fractional a => LabeledPoint l Rational -> LabeledPoint l a
    fromRationalLP (LabeledPoint (Point x y) l) = LabeledPoint (Point (fromRational x) (fromRational y)) l
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Heatmap from the package plot-light
        w = figFWidth fdat / nw
        h = figFHeight fdat / nh
        to = frameFromFigData fdat
        (vmin, vmax) = (minimum &&& maximum) (_lplabel <$> lp)
      forM_ lp (pixel' palette w h vmin vmax . moveLabeledPointBwFrames from to False False)
    
      
    
    
    toFigFrame
      :: Fractional a =>
         Frame a -> Frame a -> LabeledPoint l Rational -> LabeledPoint l a
    toFigFrame from to = moveLabeledPointBwFrames from to False False . fromRationalLP
    
    fromRationalLP :: Fractional a => LabeledPoint l Rational -> LabeledPoint l a
    fromRationalLP (LabeledPoint (Point x y) l) = LabeledPoint (Point (fromRational x) (fromRational y)) l
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Heatmap from the package plot-light
         -> Svg
    heatmap' fdat palette from nw nh lp = do
      let
        w = figFWidth fdat / nw
        h = figFHeight fdat / nh
        to = frameFromFigData fdat
        (vmin, vmax) = (minimum &&& maximum) (_lplabel <$> lp)
      forM_ lp (pixel' palette w h vmin vmax . moveLabeledPointBwFrames from to False False)
    
      
    
    
    toFigFrame
      :: Fractional a =>
         Frame a -> Frame a -> LabeledPoint l Rational -> LabeledPoint l a
    toFigFrame from to = moveLabeledPointBwFrames from to False False . fromRationalLP
    
    fromRationalLP :: Fractional a => LabeledPoint l Rational -> LabeledPoint l a
    fromRationalLP (LabeledPoint (Point x y) l) = LabeledPoint (Point (fromRational x) (fromRational y)) l
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Heatmap from the package plot-light
         -> Svg
    heatmap' fdat palette from nw nh lp = do
      let
        w = figFWidth fdat / nw
        h = figFHeight fdat / nh
        to = frameFromFigData fdat
        (vmin, vmax) = (minimum &&& maximum) (_lplabel <$> lp)
      forM_ lp (pixel' palette w h vmin vmax . moveLabeledPointBwFrames from to False False)
    
      
    
    
    toFigFrame
      :: Fractional a =>
         Frame a -> Frame a -> LabeledPoint l Rational -> LabeledPoint l a
    toFigFrame from to = moveLabeledPointBwFrames from to False False . fromRationalLP
    
    fromRationalLP :: Fractional a => LabeledPoint l Rational -> LabeledPoint l a
    fromRationalLP (LabeledPoint (Point x y) l) = LabeledPoint (Point (fromRational x) (fromRational y)) l
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Scatter from the package plot-light
        spGlyphShape :: GlyphShape_   -- ^ Glyph shape
      , spSize :: a                   -- ^ Glyph size
      , spStrokeWidth :: a            -- ^ Glyph stroke width
      , spColour :: C.Colour Double   -- ^ Glyph colour
      , spAlpha :: a                  -- ^ Glyph opacity
      } deriving (Eq, Show)
    
    
    modifyScatterPoint ::
            (l -> b -> c)                             -- ^ Modifies glyph size
         -> (l -> b -> c)                             -- ^ Modifies glyph stroke width
         -> (l -> C.Colour Double -> C.Colour Double) -- ^ Modifies glyph colour
         -> (l -> b -> c)                             -- ^ Modifies glyph opacity
         -> ScatterPointData b
         -> LabeledPoint l d
         -> ScatterPointData c
    modifyScatterPoint f g h i (ScatterPointData glsh sz w col alpha) lp =
      ScatterPointData glsh (f lab sz) (g lab w) (h lab col) (i lab alpha)
      where
        lab = _lplabel lp
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Scatter from the package plot-light
    data ScatterPointData a = ScatterPointData
      {
        spGlyphShape :: GlyphShape_   -- ^ Glyph shape
      , spSize :: a                   -- ^ Glyph size
      , spStrokeWidth :: a            -- ^ Glyph stroke width
      , spColour :: C.Colour Double   -- ^ Glyph colour
      , spAlpha :: a                  -- ^ Glyph opacity
      } deriving (Eq, Show)
    
    
    modifyScatterPoint ::
            (l -> b -> c)                             -- ^ Modifies glyph size
         -> (l -> b -> c)                             -- ^ Modifies glyph stroke width
         -> (l -> C.Colour Double -> C.Colour Double) -- ^ Modifies glyph colour
         -> (l -> b -> c)                             -- ^ Modifies glyph opacity
         -> ScatterPointData b
         -> LabeledPoint l d
         -> ScatterPointData c
    modifyScatterPoint f g h i (ScatterPointData glsh sz w col alpha) lp =
      ScatterPointData glsh (f lab sz) (g lab w) (h lab col) (i lab alpha)
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Scatter from the package plot-light
    -- | Parameters for a scatterplot glyph
    data ScatterPointData a = ScatterPointData
      {
        spGlyphShape :: GlyphShape_   -- ^ Glyph shape
      , spSize :: a                   -- ^ Glyph size
      , spStrokeWidth :: a            -- ^ Glyph stroke width
      , spColour :: C.Colour Double   -- ^ Glyph colour
      , spAlpha :: a                  -- ^ Glyph opacity
      } deriving (Eq, Show)
    
    
    modifyScatterPoint ::
            (l -> b -> c)                             -- ^ Modifies glyph size
         -> (l -> b -> c)                             -- ^ Modifies glyph stroke width
         -> (l -> C.Colour Double -> C.Colour Double) -- ^ Modifies glyph colour
         -> (l -> b -> c)                             -- ^ Modifies glyph opacity
         -> ScatterPointData b
         -> LabeledPoint l d
         -> ScatterPointData c
    modifyScatterPoint f g h i (ScatterPointData glsh sz w col alpha) lp =
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Scatter from the package plot-light
          
    -- | Parameters for a scatterplot glyph
    data ScatterPointData a = ScatterPointData
      {
        spGlyphShape :: GlyphShape_   -- ^ Glyph shape
      , spSize :: a                   -- ^ Glyph size
      , spStrokeWidth :: a            -- ^ Glyph stroke width
      , spColour :: C.Colour Double   -- ^ Glyph colour
      , spAlpha :: a                  -- ^ Glyph opacity
      } deriving (Eq, Show)
    
    
    modifyScatterPoint ::
            (l -> b -> c)                             -- ^ Modifies glyph size
         -> (l -> b -> c)                             -- ^ Modifies glyph stroke width
         -> (l -> C.Colour Double -> C.Colour Double) -- ^ Modifies glyph colour
         -> (l -> b -> c)                             -- ^ Modifies glyph opacity
         -> ScatterPointData b
         -> LabeledPoint l d
         -> ScatterPointData c
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Scatter from the package plot-light
      
          
    -- | Parameters for a scatterplot glyph
    data ScatterPointData a = ScatterPointData
      {
        spGlyphShape :: GlyphShape_   -- ^ Glyph shape
      , spSize :: a                   -- ^ Glyph size
      , spStrokeWidth :: a            -- ^ Glyph stroke width
      , spColour :: C.Colour Double   -- ^ Glyph colour
      , spAlpha :: a                  -- ^ Glyph opacity
      } deriving (Eq, Show)
    
    
    modifyScatterPoint ::
            (l -> b -> c)                             -- ^ Modifies glyph size
         -> (l -> b -> c)                             -- ^ Modifies glyph stroke width
         -> (l -> C.Colour Double -> C.Colour Double) -- ^ Modifies glyph colour
         -> (l -> b -> c)                             -- ^ Modifies glyph opacity
         -> ScatterPointData b
         -> LabeledPoint l d
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Scatter from the package plot-light
              -> (l -> C.Colour Double -> C.Colour Double)  -- ^ Modifies the glyph colour
              -> (l -> b -> a)        -- ^ Modifies the glyph opacity
              -> ScatterPointData b    -- ^ Glyph style defaults
              -> t (LabeledPoint l a) -- ^ Data
              -> Svg
    scatterLP f g h i spdat lps = forM_ lps (scatterLP1 f g h i spdat)
    
    
    scatterLP1 :: (Show a, RealFrac a) =>
                  (l -> b -> a)            -- ^ Modifies the glyph size
               -> (l -> b -> a)         -- ^ Modifies the glyph stroke width
               -> (l -> C.Colour Double -> C.Colour Double)  -- ^ Modifies the glyph colour
               -> (l -> b -> a)        -- ^ Modifies the glyph opacity
               -> ScatterPointData b   
               -> LabeledPoint l a
               -> Svg
    scatterLP1 f g h i spdat lp = glyph w' sw' sh col' a' (_lp lp)
     where
        ScatterPointData sh w' sw' col' a' = modifyScatterPoint f g h i spdat lp
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Scatter from the package plot-light
                 (l -> b -> a)            -- ^ Modifies the glyph size
              -> (l -> b -> a)         -- ^ Modifies the glyph stroke width
              -> (l -> C.Colour Double -> C.Colour Double)  -- ^ Modifies the glyph colour
              -> (l -> b -> a)        -- ^ Modifies the glyph opacity
              -> ScatterPointData b    -- ^ Glyph style defaults
              -> t (LabeledPoint l a) -- ^ Data
              -> Svg
    scatterLP f g h i spdat lps = forM_ lps (scatterLP1 f g h i spdat)
    
    
    scatterLP1 :: (Show a, RealFrac a) =>
                  (l -> b -> a)            -- ^ Modifies the glyph size
               -> (l -> b -> a)         -- ^ Modifies the glyph stroke width
               -> (l -> C.Colour Double -> C.Colour Double)  -- ^ Modifies the glyph colour
               -> (l -> b -> a)        -- ^ Modifies the glyph opacity
               -> ScatterPointData b   
               -> LabeledPoint l a
               -> Svg
    scatterLP1 f g h i spdat lp = glyph w' sw' sh col' a' (_lp lp)
     where
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Scatter from the package plot-light
    scatterLP :: (Foldable t, RealFrac a, Show a) =>
                 (l -> b -> a)            -- ^ Modifies the glyph size
              -> (l -> b -> a)         -- ^ Modifies the glyph stroke width
              -> (l -> C.Colour Double -> C.Colour Double)  -- ^ Modifies the glyph colour
              -> (l -> b -> a)        -- ^ Modifies the glyph opacity
              -> ScatterPointData b    -- ^ Glyph style defaults
              -> t (LabeledPoint l a) -- ^ Data
              -> Svg
    scatterLP f g h i spdat lps = forM_ lps (scatterLP1 f g h i spdat)
    
    
    scatterLP1 :: (Show a, RealFrac a) =>
                  (l -> b -> a)            -- ^ Modifies the glyph size
               -> (l -> b -> a)         -- ^ Modifies the glyph stroke width
               -> (l -> C.Colour Double -> C.Colour Double)  -- ^ Modifies the glyph colour
               -> (l -> b -> a)        -- ^ Modifies the glyph opacity
               -> ScatterPointData b   
               -> LabeledPoint l a
               -> Svg
    scatterLP1 f g h i spdat lp = glyph w' sw' sh col' a' (_lp lp)
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Scatter from the package plot-light
    -- This can be used to produce rich infographics, in which e.g. the colour and size of the glyphs carry additional information.
    scatterLP :: (Foldable t, RealFrac a, Show a) =>
                 (l -> b -> a)            -- ^ Modifies the glyph size
              -> (l -> b -> a)         -- ^ Modifies the glyph stroke width
              -> (l -> C.Colour Double -> C.Colour Double)  -- ^ Modifies the glyph colour
              -> (l -> b -> a)        -- ^ Modifies the glyph opacity
              -> ScatterPointData b    -- ^ Glyph style defaults
              -> t (LabeledPoint l a) -- ^ Data
              -> Svg
    scatterLP f g h i spdat lps = forM_ lps (scatterLP1 f g h i spdat)
    
    
    scatterLP1 :: (Show a, RealFrac a) =>
                  (l -> b -> a)            -- ^ Modifies the glyph size
               -> (l -> b -> a)         -- ^ Modifies the glyph stroke width
               -> (l -> C.Colour Double -> C.Colour Double)  -- ^ Modifies the glyph colour
               -> (l -> b -> a)        -- ^ Modifies the glyph opacity
               -> ScatterPointData b   
               -> LabeledPoint l a
               -> Svg
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Scatter from the package plot-light
    --
    -- This can be used to produce rich infographics, in which e.g. the colour and size of the glyphs carry additional information.
    scatterLP :: (Foldable t, RealFrac a, Show a) =>
                 (l -> b -> a)            -- ^ Modifies the glyph size
              -> (l -> b -> a)         -- ^ Modifies the glyph stroke width
              -> (l -> C.Colour Double -> C.Colour Double)  -- ^ Modifies the glyph colour
              -> (l -> b -> a)        -- ^ Modifies the glyph opacity
              -> ScatterPointData b    -- ^ Glyph style defaults
              -> t (LabeledPoint l a) -- ^ Data
              -> Svg
    scatterLP f g h i spdat lps = forM_ lps (scatterLP1 f g h i spdat)
    
    
    scatterLP1 :: (Show a, RealFrac a) =>
                  (l -> b -> a)            -- ^ Modifies the glyph size
               -> (l -> b -> a)         -- ^ Modifies the glyph stroke width
               -> (l -> C.Colour Double -> C.Colour Double)  -- ^ Modifies the glyph colour
               -> (l -> b -> a)        -- ^ Modifies the glyph opacity
               -> ScatterPointData b   
               -> LabeledPoint l a
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Scatter from the package plot-light
      forM_ ps $ glyph w sw glshape fcol alpha
    
    
    -- | Parametric scatter plot
    --
    -- The parameters of every point in the scatter plot are modulated according to the label, using the three functions.
    --
    -- This can be used to produce rich infographics, in which e.g. the colour and size of the glyphs carry additional information.
    scatterLP :: (Foldable t, RealFrac a, Show a) =>
                 (l -> b -> a)            -- ^ Modifies the glyph size
              -> (l -> b -> a)         -- ^ Modifies the glyph stroke width
              -> (l -> C.Colour Double -> C.Colour Double)  -- ^ Modifies the glyph colour
              -> (l -> b -> a)        -- ^ Modifies the glyph opacity
              -> ScatterPointData b    -- ^ Glyph style defaults
              -> t (LabeledPoint l a) -- ^ Data
              -> Svg
    scatterLP f g h i spdat lps = forM_ lps (scatterLP1 f g h i spdat)
    
    
    scatterLP1 :: (Show a, RealFrac a) =>
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Scatter from the package plot-light
            -> Svg
    scatter (ScatterPointData glshape w sw fcol alpha) ps = 
      forM_ ps $ glyph w sw glshape fcol alpha
    
    
    -- | Parametric scatter plot
    --
    -- The parameters of every point in the scatter plot are modulated according to the label, using the three functions.
    --
    -- This can be used to produce rich infographics, in which e.g. the colour and size of the glyphs carry additional information.
    scatterLP :: (Foldable t, RealFrac a, Show a) =>
                 (l -> b -> a)            -- ^ Modifies the glyph size
              -> (l -> b -> a)         -- ^ Modifies the glyph stroke width
              -> (l -> C.Colour Double -> C.Colour Double)  -- ^ Modifies the glyph colour
              -> (l -> b -> a)        -- ^ Modifies the glyph opacity
              -> ScatterPointData b    -- ^ Glyph style defaults
              -> t (LabeledPoint l a) -- ^ Data
              -> Svg
    scatterLP f g h i spdat lps = forM_ lps (scatterLP1 f g h i spdat)
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Scatter from the package plot-light
            -> t (Point a)
            -> Svg
    scatter (ScatterPointData glshape w sw fcol alpha) ps = 
      forM_ ps $ glyph w sw glshape fcol alpha
    
    
    -- | Parametric scatter plot
    --
    -- The parameters of every point in the scatter plot are modulated according to the label, using the three functions.
    --
    -- This can be used to produce rich infographics, in which e.g. the colour and size of the glyphs carry additional information.
    scatterLP :: (Foldable t, RealFrac a, Show a) =>
                 (l -> b -> a)            -- ^ Modifies the glyph size
              -> (l -> b -> a)         -- ^ Modifies the glyph stroke width
              -> (l -> C.Colour Double -> C.Colour Double)  -- ^ Modifies the glyph colour
              -> (l -> b -> a)        -- ^ Modifies the glyph opacity
              -> ScatterPointData b    -- ^ Glyph style defaults
              -> t (LabeledPoint l a) -- ^ Data
              -> Svg
    scatterLP f g h i spdat lps = forM_ lps (scatterLP1 f g h i spdat)
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Scatter from the package plot-light
               ScatterPointData a
            -> t (Point a)
            -> Svg
    scatter (ScatterPointData glshape w sw fcol alpha) ps = 
      forM_ ps $ glyph w sw glshape fcol alpha
    
    
    -- | Parametric scatter plot
    --
    -- The parameters of every point in the scatter plot are modulated according to the label, using the three functions.
    --
    -- This can be used to produce rich infographics, in which e.g. the colour and size of the glyphs carry additional information.
    scatterLP :: (Foldable t, RealFrac a, Show a) =>
                 (l -> b -> a)            -- ^ Modifies the glyph size
              -> (l -> b -> a)         -- ^ Modifies the glyph stroke width
              -> (l -> C.Colour Double -> C.Colour Double)  -- ^ Modifies the glyph colour
              -> (l -> b -> a)        -- ^ Modifies the glyph opacity
              -> ScatterPointData b    -- ^ Glyph style defaults
              -> t (LabeledPoint l a) -- ^ Data
              -> Svg
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Scatter from the package plot-light
    scatter :: (Foldable t, Show a, RealFrac a) =>
               ScatterPointData a
            -> t (Point a)
            -> Svg
    scatter (ScatterPointData glshape w sw fcol alpha) ps = 
      forM_ ps $ glyph w sw glshape fcol alpha
    
    
    -- | Parametric scatter plot
    --
    -- The parameters of every point in the scatter plot are modulated according to the label, using the three functions.
    --
    -- This can be used to produce rich infographics, in which e.g. the colour and size of the glyphs carry additional information.
    scatterLP :: (Foldable t, RealFrac a, Show a) =>
                 (l -> b -> a)            -- ^ Modifies the glyph size
              -> (l -> b -> a)         -- ^ Modifies the glyph stroke width
              -> (l -> C.Colour Double -> C.Colour Double)  -- ^ Modifies the glyph colour
              -> (l -> b -> a)        -- ^ Modifies the glyph opacity
              -> ScatterPointData b    -- ^ Glyph style defaults
              -> t (LabeledPoint l a) -- ^ Data
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.TimeSeries from the package plot-light
    frameToFrameFxRow from to fxr = f <$> fxr
      where
        f = frameToFrameValue from to
    
    
    data FxRow a  = FxRow {
        rateOpen :: a
      , rateHigh :: a
      , rateLow :: a
      , rateClose :: a
                   } deriving (Eq, Show)
    
    instance Functor FxRow where
      fmap f (FxRow o h l c) = FxRow (f o) (f h) (f l) (f c)
    
    c1 = FxRow 1.0876 1.0880 1.0872 1.0874
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.TimeSeries from the package plot-light
    frameToFrameFxRow from to fxr = f <$> fxr
      where
        f = frameToFrameValue from to
    
    
    data FxRow a  = FxRow {
        rateOpen :: a
      , rateHigh :: a
      , rateLow :: a
      , rateClose :: a
                   } deriving (Eq, Show)
    
    instance Functor FxRow where
      fmap f (FxRow o h l c) = FxRow (f o) (f h) (f l) (f c)
    
    c1 = FxRow 1.0876 1.0880 1.0872 1.0874
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.TimeSeries from the package plot-light
    --   td2 = fromTick t2
    
    
    
    
    -- * Helpers
    
    -- | Create a `LabeledPoint` from a time series point (`TsPoint`). The `_tick` (time axis) field will be used for the x coordinate, whereas both fields of TsPoint may be used to create the label field.
    --
    -- NB : The coordinates of the resulting LabelPoint still live in the original data space; they must be rescaled to fit in the figure viewport
    tspToLP :: Fractional a => 
         (t -> a)
      -> (Tick -> t -> l)
      -> TsPoint t
      -> LabeledPoint l a
    tspToLP fy g = LabeledPoint <$> pf <*> lf where
      pf = Point <$> tickToFractional <*> fy . _val
      lf = g <$> _tick <*> _val
      
      
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.TimeSeries from the package plot-light
    -- tickRange t1 t2 dt = toTick <$> [td1, td1 + dt .. td2] where
    --   td1 = fromTick t1
    --   td2 = fromTick t2
    
    
    
    
    -- * Helpers
    
    -- | Create a `LabeledPoint` from a time series point (`TsPoint`). The `_tick` (time axis) field will be used for the x coordinate, whereas both fields of TsPoint may be used to create the label field.
    --
    -- NB : The coordinates of the resulting LabelPoint still live in the original data space; they must be rescaled to fit in the figure viewport
    tspToLP :: Fractional a => 
         (t -> a)
      -> (Tick -> t -> l)
      -> TsPoint t
      -> LabeledPoint l a
    tspToLP fy g = LabeledPoint <$> pf <*> lf where
      pf = Point <$> tickToFractional <*> fy . _val
      lf = g <$> _tick <*> _val
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.TimeSeries from the package plot-light
    --     fplot lps = polyline  sw Continuous Round colData (_lp <$> lps)
      
    tsAxis
      :: (Functor t, Foldable t, Show a, RealFrac a) =>
         FigureData a
         -> (l -> a)
         -> (l -> a)
         -> (l -> a)
         -> (l -> a)
         -> a
         -> C.Colour Double
         -> a
         -> Maybe (t (LabeledPoint l a))
         -> Maybe (t (LabeledPoint l a))
         -> t (LabeledPoint l a)
         -> Svg
    tsAxis fd fboxmin fboxmax fmin fmax sw colAxis rot plabx plaby ps =
      toPlot fd baz baz rot 0 sw colAxis plabx plaby fplot ps where
        from = frameFromPoints $ _lp <$> ps
        to = frameFromFigData fd
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.TimeSeries from the package plot-light
    --   toPlot fd T.pack T.pack rot 0 sw colAxis plabx plaby fplot ps where
    --     fplot lps = polyline  sw Continuous Round colData (_lp <$> lps)
      
    tsAxis
      :: (Functor t, Foldable t, Show a, RealFrac a) =>
         FigureData a
         -> (l -> a)
         -> (l -> a)
         -> (l -> a)
         -> (l -> a)
         -> a
         -> C.Colour Double
         -> a
         -> Maybe (t (LabeledPoint l a))
         -> Maybe (t (LabeledPoint l a))
         -> t (LabeledPoint l a)
         -> Svg
    tsAxis fd fboxmin fboxmax fmin fmax sw colAxis rot plabx plaby ps =
      toPlot fd baz baz rot 0 sw colAxis plabx plaby fplot ps where
        from = frameFromPoints $ _lp <$> ps
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.TimeSeries from the package plot-light
    -- tsAxis fd sw colAxis colData rot plabx plaby ps =
    --   toPlot fd T.pack T.pack rot 0 sw colAxis plabx plaby fplot ps where
    --     fplot lps = polyline  sw Continuous Round colData (_lp <$> lps)
      
    tsAxis
      :: (Functor t, Foldable t, Show a, RealFrac a) =>
         FigureData a
         -> (l -> a)
         -> (l -> a)
         -> (l -> a)
         -> (l -> a)
         -> a
         -> C.Colour Double
         -> a
         -> Maybe (t (LabeledPoint l a))
         -> Maybe (t (LabeledPoint l a))
         -> t (LabeledPoint l a)
         -> Svg
    tsAxis fd fboxmin fboxmax fmin fmax sw colAxis rot plabx plaby ps =
      toPlot fd baz baz rot 0 sw colAxis plabx plaby fplot ps where
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.TimeSeries from the package plot-light
    --      -> Maybe (t (LabeledPoint String a))
    --      -> Maybe (t (LabeledPoint String a))
    --      -> t (LabeledPoint String a)
    --      -> Svg
    -- tsAxis fd sw colAxis colData rot plabx plaby ps =
    --   toPlot fd T.pack T.pack rot 0 sw colAxis plabx plaby fplot ps where
    --     fplot lps = polyline  sw Continuous Round colData (_lp <$> lps)
      
    tsAxis
      :: (Functor t, Foldable t, Show a, RealFrac a) =>
         FigureData a
         -> (l -> a)
         -> (l -> a)
         -> (l -> a)
         -> (l -> a)
         -> a
         -> C.Colour Double
         -> a
         -> Maybe (t (LabeledPoint l a))
         -> Maybe (t (LabeledPoint l a))
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.TimeSeries from the package plot-light
    --      -> a
    --      -> Maybe (t (LabeledPoint String a))
    --      -> Maybe (t (LabeledPoint String a))
    --      -> t (LabeledPoint String a)
    --      -> Svg
    -- tsAxis fd sw colAxis colData rot plabx plaby ps =
    --   toPlot fd T.pack T.pack rot 0 sw colAxis plabx plaby fplot ps where
    --     fplot lps = polyline  sw Continuous Round colData (_lp <$> lps)
      
    tsAxis
      :: (Functor t, Foldable t, Show a, RealFrac a) =>
         FigureData a
         -> (l -> a)
         -> (l -> a)
         -> (l -> a)
         -> (l -> a)
         -> a
         -> C.Colour Double
         -> a
         -> Maybe (t (LabeledPoint l a))
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.TimeSeries from the package plot-light
    --      -> C.Colour Double
    --      -> a
    --      -> Maybe (t (LabeledPoint String a))
    --      -> Maybe (t (LabeledPoint String a))
    --      -> t (LabeledPoint String a)
    --      -> Svg
    -- tsAxis fd sw colAxis colData rot plabx plaby ps =
    --   toPlot fd T.pack T.pack rot 0 sw colAxis plabx plaby fplot ps where
    --     fplot lps = polyline  sw Continuous Round colData (_lp <$> lps)
      
    tsAxis
      :: (Functor t, Foldable t, Show a, RealFrac a) =>
         FigureData a
         -> (l -> a)
         -> (l -> a)
         -> (l -> a)
         -> (l -> a)
         -> a
         -> C.Colour Double
         -> a
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.TimeSeries from the package plot-light
    --      -> C.Colour Double
    --      -> C.Colour Double
    --      -> a
    --      -> Maybe (t (LabeledPoint String a))
    --      -> Maybe (t (LabeledPoint String a))
    --      -> t (LabeledPoint String a)
    --      -> Svg
    -- tsAxis fd sw colAxis colData rot plabx plaby ps =
    --   toPlot fd T.pack T.pack rot 0 sw colAxis plabx plaby fplot ps where
    --     fplot lps = polyline  sw Continuous Round colData (_lp <$> lps)
      
    tsAxis
      :: (Functor t, Foldable t, Show a, RealFrac a) =>
         FigureData a
         -> (l -> a)
         -> (l -> a)
         -> (l -> a)
         -> (l -> a)
         -> a
         -> C.Colour Double
    

    lr No usage example found for this symbol :( Collapse [-]
    m See 7 Occurences [+] Collapse [-]
    Found in Graphics.Rendering.Plot.Light.Internal from the package plot-light
         -> Svg
    colourBar fdat pal w vmin vmax n legpos legh =
      legendBar (fromRational <$> fdat) w vmin vmax n legpos legh (colBarPx pal)
    
    
    legendBar :: (Monad m, Enum t, Fractional t, Fractional a) =>
                 FigureData a
              -> a
              -> t
              -> t
              -> Int
              -> LegendPosition_
              -> a
              -> (FigureData a -> a -> a -> t -> t -> LabeledPoint t a -> m b)
              -> m ()
    legendBar fdat w vmin vmax n legpos legh fun = do
      -- rect wrect hrect 1 (Just C.black) (Just C.white) prect
      forM_ lps (fun fdat w h vmin vmax) where
        wrect = 0.95 * (1 - figRightMFrac fdat) * figWidth fdat
        hrect = 1.5 * legh
    

    Found in Graphics.Rendering.Plot.Light.Internal from the package plot-light
         -> a                        -- ^ Colour bar length
         -> Svg
    colourBar fdat pal w vmin vmax n legpos legh =
      legendBar (fromRational <$> fdat) w vmin vmax n legpos legh (colBarPx pal)
    
    
    legendBar :: (Monad m, Enum t, Fractional t, Fractional a) =>
                 FigureData a
              -> a
              -> t
              -> t
              -> Int
              -> LegendPosition_
              -> a
              -> (FigureData a -> a -> a -> t -> t -> LabeledPoint t a -> m b)
              -> m ()
    legendBar fdat w vmin vmax n legpos legh fun = do
      -- rect wrect hrect 1 (Just C.black) (Just C.white) prect
      forM_ lps (fun fdat w h vmin vmax) where
        wrect = 0.95 * (1 - figRightMFrac fdat) * figWidth fdat
    

    Found in Graphics.Rendering.Plot.Light.Internal from the package plot-light
      :: (RealFrac t, RealFrac a, Show a, Enum t, Floating a) =>
         FigureData (Ratio Integer)  -- ^ Figure data
         -> [C.Colour Double]        -- ^ Palette
         -> a                        -- ^ Width
         -> t                        -- ^ Value range minimum
         -> t                        -- ^ Value range maximum
         -> Int                      -- ^ Number of distinct values
         -> LegendPosition_          -- ^ Legend position in the figure
         -> a                        -- ^ Colour bar length
         -> Svg
    colourBar fdat pal w vmin vmax n legpos legh =
      legendBar (fromRational <$> fdat) w vmin vmax n legpos legh (colBarPx pal)
    
    
    legendBar :: (Monad m, Enum t, Fractional t, Fractional a) =>
                 FigureData a
              -> a
              -> t
              -> t
              -> Int
    

    Found in Graphics.Rendering.Plot.Light.Internal from the package plot-light
      -> C.Colour Double  -- ^ Stroke colour
      -> a                -- ^ Opacity 
      -> a                -- ^ Stroke width
      -> ShapeCol a
    shapeColBoth cs cf a = BothCol (col cs a) (col cf a)
    
    -- | Set the fill and stroke colour and opacity attributes all at once (e.g. if the fill is set to invisible, the stroke must be visible somehow.
    (!#) :: (Attributable h, Real a) => h -> ShapeCol a -> h
    m !# col = case col of
      NoBorderCol (Col c a) ->
        m ! SA.fillOpacity (vd a) ! SA.fill (colourAttr c) ! SA.stroke none
      NoFillCol (Col c a) sw  ->
        m ! SA.strokeOpacity (vd a) ! SA.stroke (colourAttr c) ! SA.strokeWidth (vd sw) ! SA.fill none
      BothCol (Col cf af) (Col cb ab) sw ->
        m ! SA.fillOpacity (vd af) ! SA.fill (colourAttr cf) ! SA.strokeOpacity (vd ab) ! SA.stroke (colourAttr cb) ! SA.strokeWidth (vd sw)
    
    
    
    none :: S.AttributeValue
    none = S.toValue ("none" :: String)
    

    Found in Graphics.Rendering.Plot.Light.Internal from the package plot-light
    shapeColBoth ::
         C.Colour Double  -- ^ Fill colour
      -> C.Colour Double  -- ^ Stroke colour
      -> a                -- ^ Opacity 
      -> a                -- ^ Stroke width
      -> ShapeCol a
    shapeColBoth cs cf a = BothCol (col cs a) (col cf a)
    
    -- | Set the fill and stroke colour and opacity attributes all at once (e.g. if the fill is set to invisible, the stroke must be visible somehow.
    (!#) :: (Attributable h, Real a) => h -> ShapeCol a -> h
    m !# col = case col of
      NoBorderCol (Col c a) ->
        m ! SA.fillOpacity (vd a) ! SA.fill (colourAttr c) ! SA.stroke none
      NoFillCol (Col c a) sw  ->
        m ! SA.strokeOpacity (vd a) ! SA.stroke (colourAttr c) ! SA.strokeWidth (vd sw) ! SA.fill none
      BothCol (Col cf af) (Col cb ab) sw ->
        m ! SA.fillOpacity (vd af) ! SA.fill (colourAttr cf) ! SA.strokeOpacity (vd ab) ! SA.stroke (colourAttr cb) ! SA.strokeWidth (vd sw)
    

    Found in Graphics.Rendering.Plot.Light.Internal from the package plot-light
    -- | Construct a 'ShapeCol' for shapes that have both fill and stroke colour
    shapeColBoth ::
         C.Colour Double  -- ^ Fill colour
      -> C.Colour Double  -- ^ Stroke colour
      -> a                -- ^ Opacity 
      -> a                -- ^ Stroke width
      -> ShapeCol a
    shapeColBoth cs cf a = BothCol (col cs a) (col cf a)
    
    -- | Set the fill and stroke colour and opacity attributes all at once (e.g. if the fill is set to invisible, the stroke must be visible somehow.
    (!#) :: (Attributable h, Real a) => h -> ShapeCol a -> h
    m !# col = case col of
      NoBorderCol (Col c a) ->
        m ! SA.fillOpacity (vd a) ! SA.fill (colourAttr c) ! SA.stroke none
      NoFillCol (Col c a) sw  ->
        m ! SA.strokeOpacity (vd a) ! SA.stroke (colourAttr c) ! SA.strokeWidth (vd sw) ! SA.fill none
      BothCol (Col cf af) (Col cb ab) sw ->
        m ! SA.fillOpacity (vd af) ! SA.fill (colourAttr cf) ! SA.strokeOpacity (vd ab) ! SA.stroke (colourAttr cb) ! SA.strokeWidth (vd sw)
    

    Found in Graphics.Rendering.Plot.Light.Internal from the package plot-light
    shapeColNoFill :: C.Colour Double -> a -> a -> ShapeCol a
    shapeColNoFill c a = NoFillCol $ col c a 
    
    -- | Construct a 'ShapeCol' for shapes that have both fill and stroke colour
    shapeColBoth ::
         C.Colour Double  -- ^ Fill colour
      -> C.Colour Double  -- ^ Stroke colour
      -> a                -- ^ Opacity 
      -> a                -- ^ Stroke width
      -> ShapeCol a
    shapeColBoth cs cf a = BothCol (col cs a) (col cf a)
    
    -- | Set the fill and stroke colour and opacity attributes all at once (e.g. if the fill is set to invisible, the stroke must be visible somehow.
    (!#) :: (Attributable h, Real a) => h -> ShapeCol a -> h
    m !# col = case col of
      NoBorderCol (Col c a) ->
        m ! SA.fillOpacity (vd a) ! SA.fill (colourAttr c) ! SA.stroke none
      NoFillCol (Col c a) sw  ->
        m ! SA.strokeOpacity (vd a) ! SA.stroke (colourAttr c) ! SA.strokeWidth (vd sw) ! SA.fill none
      BothCol (Col cf af) (Col cb ab) sw ->
    

    matrix No usage example found for this symbol :( Collapse [-]
    mkPath No usage example found for this symbol :( Collapse [-]
    mr No usage example found for this symbol :( Collapse [-]
    q See 2 Occurences [+] Collapse [-]
    Found in Graphics.Rendering.Plot.Light.PlotTypes.TimeSeries from the package plot-light
      -> (Tick -> t -> l)
      -> TsPoint t
      -> LabeledPoint l a
    tspToLP fy g = LabeledPoint <$> pf <*> lf where
      pf = Point <$> tickToFractional <*> fy . _val
      lf = g <$> _tick <*> _val
      
      
    
    
    
    labeledTsPointRange n p t1 q dt = zipWith LabeledPoint p_ t_
      where
        t_ = toTick <$> [td1, td1 + dt .. ]
        p_ = pointRange n p q
        td1 = fromTick t1
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.TimeSeries from the package plot-light
    -- NB : The coordinates of the resulting LabelPoint still live in the original data space; they must be rescaled to fit in the figure viewport
    tspToLP :: Fractional a => 
         (t -> a)
      -> (Tick -> t -> l)
      -> TsPoint t
      -> LabeledPoint l a
    tspToLP fy g = LabeledPoint <$> pf <*> lf where
      pf = Point <$> tickToFractional <*> fy . _val
      lf = g <$> _tick <*> _val
      
      
    
    
    
    labeledTsPointRange n p t1 q dt = zipWith LabeledPoint p_ t_
      where
        t_ = toTick <$> [td1, td1 + dt .. ]
        p_ = pointRange n p q
        td1 = fromTick t1
    

    qr No usage example found for this symbol :( Collapse [-]
    rotate See 2 Occurences [+] Collapse [-]
    Found in Graphics.Rendering.Plot.Light.Internal from the package plot-light
    --
    -- The user can supply an additional `V2` displacement which will be applied /after/ rotation and anchoring and refers to the rotated text box frame.
    --
    -- > > putStrLn $ renderSvg $ text (-45) C.green TAEnd "blah" (V2 (- 10) 0) (Point 250 0)
    -- > <text x="-10.0" y="0.0" transform="translate(250.0 0.0)rotate(-45.0)" fill="#008000" text-anchor="end">blah</text>
    text :: (Show a, Real a) =>
            a               -- ^ Rotation angle of the textbox
         -> Int             -- ^ Font size
         -> C.Colour Double -- ^ Font colour
         -> TextAnchor_     -- ^ How to anchor the text to the point
         -> T.Text          -- ^ Text 
         -> V2 a            -- ^ Displacement w.r.t. rotated textbox
         -> Point a         -- ^ Initial position of the text box (i.e. before rotation and displacement)
         -> Svg
    text rot fontsize col ta te (V2 vx vy) (Point x y) = S.text_ (S.toMarkup te) ! SA.x (vd vx) ! SA.y (vd vy) ! SA.transform (S.translate (real x) (real y) <> S.rotate (real rot)) ! SA.fontSize (vi fontsize) ! SA.fill (colourAttr col) ! textAnchor ta
    
    -- | Specify at which end should the text be anchored to its current point
    data TextAnchor_ = TAStart | TAMiddle | TAEnd deriving (Eq, Show)
    
    textAnchor :: TextAnchor_ -> S.Attribute
    

    Found in Graphics.Rendering.Plot.Light.Internal from the package plot-light
    -- import Control.Arrow ((&&&), (***))
    import Control.Monad (forM, forM_)
    import Control.Monad.State
    -- import Data.Semigroup (Min(..), Max(..))
    import Data.Scientific (Scientific, toRealFloat)
    
    -- import Data.Foldable
    import qualified Data.Text as T
    -- import qualified Data.Vector as V
    
    import Text.Blaze.Internal (Attributable(..))
    import Text.Blaze.Svg
    import Text.Blaze.Svg11  ((!))
    import qualified Text.Blaze.Svg11 as S hiding (style)
    import qualified Text.Blaze.Svg11.Attributes as SA hiding (rotate)
    import Text.Blaze.Svg.Renderer.String (renderSvg)
    
    import qualified Data.Colour as C
    import qualified Data.Colour.Names as C
    import qualified Data.Colour.SRGB as C
    

    rotateAround No usage example found for this symbol :( Collapse [-]
    s No usage example found for this symbol :( Collapse [-]
    scale No usage example found for this symbol :( Collapse [-]
    skewX No usage example found for this symbol :( Collapse [-]
    skewY No usage example found for this symbol :( Collapse [-]
    sr No usage example found for this symbol :( Collapse [-]
    t See 49 Occurences [+] Collapse [-]
    Found in Graphics.Rendering.Plot.Light.PlotTypes.Plot1D from the package plot-light
    -- | Plot the graph of a 1D function
    plotf :: (Show a, RealFrac a) => (a -> a) -> Svg
    plotf = plotf' plot1dDomainDefaults
    
    plotf' :: (Show a, RealFrac a) => Plot1DDomain a -> (a -> a) -> Svg
    plotf' (Plot1DDomain n x1 x2) f = plot $ plotFun f ps where
      ps = pointRange n (Point x1 0) (Point x2 0)
    
    plot :: (Foldable t, Show a, RealFrac a) => t (Point a) -> Svg
    plot = plot' plot1DDefaults
    
    plot' :: (Foldable t, Show a, RealFrac a) =>
             Plot1DOptions a
          -> t (Point a)
          -> Svg
    plot' (Plot1DOptions sw ty sjt sc) = polyline sw ty sjt sc 
    
    data Plot1DOptions a = Plot1DOptions {
        p1oWidth :: a             -- ^ Stroke width
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Plot1D from the package plot-light
    plotFun f = fmap f' where
      f' (Point x _) = Point x (f x)
    
    -- | Plot the graph of a 1D function
    plotf :: (Show a, RealFrac a) => (a -> a) -> Svg
    plotf = plotf' plot1dDomainDefaults
    
    plotf' :: (Show a, RealFrac a) => Plot1DDomain a -> (a -> a) -> Svg
    plotf' (Plot1DDomain n x1 x2) f = plot $ plotFun f ps where
      ps = pointRange n (Point x1 0) (Point x2 0)
    
    plot :: (Foldable t, Show a, RealFrac a) => t (Point a) -> Svg
    plot = plot' plot1DDefaults
    
    plot' :: (Foldable t, Show a, RealFrac a) =>
             Plot1DOptions a
          -> t (Point a)
          -> Svg
    plot' (Plot1DOptions sw ty sjt sc) = polyline sw ty sjt sc 
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Plot1D from the package plot-light
    -- | Graph a 1D function
    plotFun :: Functor f => (t -> t) -> f (Point t) -> f (Point t)
    plotFun f = fmap f' where
      f' (Point x _) = Point x (f x)
    
    -- | Plot the graph of a 1D function
    plotf :: (Show a, RealFrac a) => (a -> a) -> Svg
    plotf = plotf' plot1dDomainDefaults
    
    plotf' :: (Show a, RealFrac a) => Plot1DDomain a -> (a -> a) -> Svg
    plotf' (Plot1DDomain n x1 x2) f = plot $ plotFun f ps where
      ps = pointRange n (Point x1 0) (Point x2 0)
    
    plot :: (Foldable t, Show a, RealFrac a) => t (Point a) -> Svg
    plot = plot' plot1DDefaults
    
    plot' :: (Foldable t, Show a, RealFrac a) =>
             Plot1DOptions a
          -> t (Point a)
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Plot1D from the package plot-light
    -- | Graph a 1D function
    plotFun :: Functor f => (t -> t) -> f (Point t) -> f (Point t)
    plotFun f = fmap f' where
      f' (Point x _) = Point x (f x)
    
    -- | Plot the graph of a 1D function
    plotf :: (Show a, RealFrac a) => (a -> a) -> Svg
    plotf = plotf' plot1dDomainDefaults
    
    plotf' :: (Show a, RealFrac a) => Plot1DDomain a -> (a -> a) -> Svg
    plotf' (Plot1DDomain n x1 x2) f = plot $ plotFun f ps where
      ps = pointRange n (Point x1 0) (Point x2 0)
    
    plot :: (Foldable t, Show a, RealFrac a) => t (Point a) -> Svg
    plot = plot' plot1DDefaults
    
    plot' :: (Foldable t, Show a, RealFrac a) =>
             Plot1DOptions a
          -> t (Point a)
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Plot1D from the package plot-light
    module Graphics.Rendering.Plot.Light.PlotTypes.Plot1D (
        plotFun, Plot1DOptions(..)
      , plotf, plotf'
      , Plot1DDomain(..)
      , plot, plot'
      ) where
    
    import Graphics.Rendering.Plot.Light.Internal
    import qualified Data.Colour as C
    import qualified Data.Colour.Names as C
    import Text.Blaze.Svg
    
    -- | Graph a 1D function
    plotFun :: Functor f => (t -> t) -> f (Point t) -> f (Point t)
    plotFun f = fmap f' where
      f' (Point x _) = Point x (f x)
    
    -- | Plot the graph of a 1D function
    plotf :: (Show a, RealFrac a) => (a -> a) -> Svg
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Plot1D from the package plot-light
    module Graphics.Rendering.Plot.Light.PlotTypes.Plot1D (
        plotFun, Plot1DOptions(..)
      , plotf, plotf'
      , Plot1DDomain(..)
      , plot, plot'
      ) where
    
    import Graphics.Rendering.Plot.Light.Internal
    import qualified Data.Colour as C
    import qualified Data.Colour.Names as C
    import Text.Blaze.Svg
    
    -- | Graph a 1D function
    plotFun :: Functor f => (t -> t) -> f (Point t) -> f (Point t)
    plotFun f = fmap f' where
      f' (Point x _) = Point x (f x)
    
    -- | Plot the graph of a 1D function
    plotf :: (Show a, RealFrac a) => (a -> a) -> Svg
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Plot1D from the package plot-light
    module Graphics.Rendering.Plot.Light.PlotTypes.Plot1D (
        plotFun, Plot1DOptions(..)
      , plotf, plotf'
      , Plot1DDomain(..)
      , plot, plot'
      ) where
    
    import Graphics.Rendering.Plot.Light.Internal
    import qualified Data.Colour as C
    import qualified Data.Colour.Names as C
    import Text.Blaze.Svg
    
    -- | Graph a 1D function
    plotFun :: Functor f => (t -> t) -> f (Point t) -> f (Point t)
    plotFun f = fmap f' where
      f' (Point x _) = Point x (f x)
    
    -- | Plot the graph of a 1D function
    plotf :: (Show a, RealFrac a) => (a -> a) -> Svg
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Plot1D from the package plot-light
    module Graphics.Rendering.Plot.Light.PlotTypes.Plot1D (
        plotFun, Plot1DOptions(..)
      , plotf, plotf'
      , Plot1DDomain(..)
      , plot, plot'
      ) where
    
    import Graphics.Rendering.Plot.Light.Internal
    import qualified Data.Colour as C
    import qualified Data.Colour.Names as C
    import Text.Blaze.Svg
    
    -- | Graph a 1D function
    plotFun :: Functor f => (t -> t) -> f (Point t) -> f (Point t)
    plotFun f = fmap f' where
      f' (Point x _) = Point x (f x)
    
    -- | Plot the graph of a 1D function
    plotf :: (Show a, RealFrac a) => (a -> a) -> Svg
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Heatmap from the package plot-light
    toCoord ll = concat $ reverse $ go 0 ll [] where
      go i (x:xs) acc = go (i + 1) xs $ zip3 [0 ..] (repeat i) x : acc
      go _ [] acc = acc
    
    toUnitFramedLP :: (Fractional t) =>
          t -> t -> (t, t, l) -> LabeledPoint l t
    toUnitFramedLP w h (i, j, x) = LabeledPoint p x
      where p = Point (i/h) (j/w)
    
    
    
    -- | Plot a scalar function `f` of points in the plane (i.e. \(f : \mathbf{R}^2 \rightarrow \mathbf{R}\))
    plotFun2
      :: Functor f =>
         (t -> t -> l) -> f (Point t) -> f (LabeledPoint l t)
    plotFun2 f = fmap f' where
      f' p@(Point x y) = LabeledPoint p (f x y)
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Heatmap from the package plot-light
    toCoord ll = concat $ reverse $ go 0 ll [] where
      go i (x:xs) acc = go (i + 1) xs $ zip3 [0 ..] (repeat i) x : acc
      go _ [] acc = acc
    
    toUnitFramedLP :: (Fractional t) =>
          t -> t -> (t, t, l) -> LabeledPoint l t
    toUnitFramedLP w h (i, j, x) = LabeledPoint p x
      where p = Point (i/h) (j/w)
    
    
    
    -- | Plot a scalar function `f` of points in the plane (i.e. \(f : \mathbf{R}^2 \rightarrow \mathbf{R}\))
    plotFun2
      :: Functor f =>
         (t -> t -> l) -> f (Point t) -> f (LabeledPoint l t)
    plotFun2 f = fmap f' where
      f' p@(Point x y) = LabeledPoint p (f x y)
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Heatmap from the package plot-light
    toCoord ll = concat $ reverse $ go 0 ll [] where
      go i (x:xs) acc = go (i + 1) xs $ zip3 [0 ..] (repeat i) x : acc
      go _ [] acc = acc
    
    toUnitFramedLP :: (Fractional t) =>
          t -> t -> (t, t, l) -> LabeledPoint l t
    toUnitFramedLP w h (i, j, x) = LabeledPoint p x
      where p = Point (i/h) (j/w)
    
    
    
    -- | Plot a scalar function `f` of points in the plane (i.e. \(f : \mathbf{R}^2 \rightarrow \mathbf{R}\))
    plotFun2
      :: Functor f =>
         (t -> t -> l) -> f (Point t) -> f (LabeledPoint l t)
    plotFun2 f = fmap f' where
      f' p@(Point x y) = LabeledPoint p (f x y)
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Heatmap from the package plot-light
    toCoord ll = concat $ reverse $ go 0 ll [] where
      go i (x:xs) acc = go (i + 1) xs $ zip3 [0 ..] (repeat i) x : acc
      go _ [] acc = acc
    
    toUnitFramedLP :: (Fractional t) =>
          t -> t -> (t, t, l) -> LabeledPoint l t
    toUnitFramedLP w h (i, j, x) = LabeledPoint p x
      where p = Point (i/h) (j/w)
    
    
    
    -- | Plot a scalar function `f` of points in the plane (i.e. \(f : \mathbf{R}^2 \rightarrow \mathbf{R}\))
    plotFun2
      :: Functor f =>
         (t -> t -> l) -> f (Point t) -> f (LabeledPoint l t)
    plotFun2 f = fmap f' where
      f' p@(Point x y) = LabeledPoint p (f x y)
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Heatmap from the package plot-light
        nh = fromIntegral $ length ll
        nw = fromIntegral $ length (head ll) 
        d' = toUnitFramedLP nw nh <$> toCoord ll
        valMin = minimum $ _lplabel <$> d'
        valMax = maximum $ _lplabel <$> d'
        
       
    
    toCoord :: (Num i, Enum i) => [[c]] -> [(i, i, c)]
    toCoord ll = concat $ reverse $ go 0 ll [] where
      go i (x:xs) acc = go (i + 1) xs $ zip3 [0 ..] (repeat i) x : acc
      go _ [] acc = acc
    
    toUnitFramedLP :: (Fractional t) =>
          t -> t -> (t, t, l) -> LabeledPoint l t
    toUnitFramedLP w h (i, j, x) = LabeledPoint p x
      where p = Point (i/h) (j/w)
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Heatmap from the package plot-light
        nh = fromIntegral $ length ll
        nw = fromIntegral $ length (head ll) 
        d' = toUnitFramedLP nw nh <$> toCoord ll
        valMin = minimum $ _lplabel <$> d'
        valMax = maximum $ _lplabel <$> d'
        
       
    
    toCoord :: (Num i, Enum i) => [[c]] -> [(i, i, c)]
    toCoord ll = concat $ reverse $ go 0 ll [] where
      go i (x:xs) acc = go (i + 1) xs $ zip3 [0 ..] (repeat i) x : acc
      go _ [] acc = acc
    
    toUnitFramedLP :: (Fractional t) =>
          t -> t -> (t, t, l) -> LabeledPoint l t
    toUnitFramedLP w h (i, j, x) = LabeledPoint p x
      where p = Point (i/h) (j/w)
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Heatmap from the package plot-light
        nh = fromIntegral $ length ll
        nw = fromIntegral $ length (head ll) 
        d' = toUnitFramedLP nw nh <$> toCoord ll
        valMin = minimum $ _lplabel <$> d'
        valMax = maximum $ _lplabel <$> d'
        
       
    
    toCoord :: (Num i, Enum i) => [[c]] -> [(i, i, c)]
    toCoord ll = concat $ reverse $ go 0 ll [] where
      go i (x:xs) acc = go (i + 1) xs $ zip3 [0 ..] (repeat i) x : acc
      go _ [] acc = acc
    
    toUnitFramedLP :: (Fractional t) =>
          t -> t -> (t, t, l) -> LabeledPoint l t
    toUnitFramedLP w h (i, j, x) = LabeledPoint p x
      where p = Point (i/h) (j/w)
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Heatmap from the package plot-light
        nh = fromIntegral $ length ll
        nw = fromIntegral $ length (head ll) 
        d' = toUnitFramedLP nw nh <$> toCoord ll
        valMin = minimum $ _lplabel <$> d'
        valMax = maximum $ _lplabel <$> d'
        
       
    
    toCoord :: (Num i, Enum i) => [[c]] -> [(i, i, c)]
    toCoord ll = concat $ reverse $ go 0 ll [] where
      go i (x:xs) acc = go (i + 1) xs $ zip3 [0 ..] (repeat i) x : acc
      go _ [] acc = acc
    
    toUnitFramedLP :: (Fractional t) =>
          t -> t -> (t, t, l) -> LabeledPoint l t
    toUnitFramedLP w h (i, j, x) = LabeledPoint p x
      where p = Point (i/h) (j/w)
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Heatmap from the package plot-light
        nh = fromIntegral $ length ll
        nw = fromIntegral $ length (head ll) 
        d' = toUnitFramedLP nw nh <$> toCoord ll
        valMin = minimum $ _lplabel <$> d'
        valMax = maximum $ _lplabel <$> d'
        
       
    
    toCoord :: (Num i, Enum i) => [[c]] -> [(i, i, c)]
    toCoord ll = concat $ reverse $ go 0 ll [] where
      go i (x:xs) acc = go (i + 1) xs $ zip3 [0 ..] (repeat i) x : acc
      go _ [] acc = acc
    
    toUnitFramedLP :: (Fractional t) =>
          t -> t -> (t, t, l) -> LabeledPoint l t
    toUnitFramedLP w h (i, j, x) = LabeledPoint p x
      where p = Point (i/h) (j/w)
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Heatmap from the package plot-light
      where
        nh = fromIntegral $ length ll
        nw = fromIntegral $ length (head ll) 
        d' = toUnitFramedLP nw nh <$> toCoord ll
        valMin = minimum $ _lplabel <$> d'
        valMax = maximum $ _lplabel <$> d'
        
       
    
    toCoord :: (Num i, Enum i) => [[c]] -> [(i, i, c)]
    toCoord ll = concat $ reverse $ go 0 ll [] where
      go i (x:xs) acc = go (i + 1) xs $ zip3 [0 ..] (repeat i) x : acc
      go _ [] acc = acc
    
    toUnitFramedLP :: (Fractional t) =>
          t -> t -> (t, t, l) -> LabeledPoint l t
    toUnitFramedLP w h (i, j, x) = LabeledPoint p x
      where p = Point (i/h) (j/w)
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Heatmap from the package plot-light
    fromRationalLP :: Fractional a => LabeledPoint l Rational -> LabeledPoint l a
    fromRationalLP (LabeledPoint (Point x y) l) = LabeledPoint (Point (fromRational x) (fromRational y)) l
    
    
    
    
    
    -- | `prepData d` assumes the input lists correspond to evenly sampled values of a scalar-valued field.
    --
    -- The function extracts the pixel mesh size, the data ranges and places the data points within the unit square [0,1] x [0,1]
    prepData ::
      (Ord t, Fractional a, Enum a) =>
         [[t]]  -- ^ Data
      -> (a, a, t, t, [LabeledPoint t a])  -- ^ (# of pixel rows, # of pixel columns, data minimum, data maximum, data points)
    prepData ll = (nh, nw, valMin, valMax, d')
      where
        nh = fromIntegral $ length ll
        nw = fromIntegral $ length (head ll) 
        d' = toUnitFramedLP nw nh <$> toCoord ll
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Heatmap from the package plot-light
    fromRationalLP :: Fractional a => LabeledPoint l Rational -> LabeledPoint l a
    fromRationalLP (LabeledPoint (Point x y) l) = LabeledPoint (Point (fromRational x) (fromRational y)) l
    
    
    
    
    
    -- | `prepData d` assumes the input lists correspond to evenly sampled values of a scalar-valued field.
    --
    -- The function extracts the pixel mesh size, the data ranges and places the data points within the unit square [0,1] x [0,1]
    prepData ::
      (Ord t, Fractional a, Enum a) =>
         [[t]]  -- ^ Data
      -> (a, a, t, t, [LabeledPoint t a])  -- ^ (# of pixel rows, # of pixel columns, data minimum, data maximum, data points)
    prepData ll = (nh, nw, valMin, valMax, d')
      where
        nh = fromIntegral $ length ll
        nw = fromIntegral $ length (head ll) 
        d' = toUnitFramedLP nw nh <$> toCoord ll
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Heatmap from the package plot-light
    fromRationalLP :: Fractional a => LabeledPoint l Rational -> LabeledPoint l a
    fromRationalLP (LabeledPoint (Point x y) l) = LabeledPoint (Point (fromRational x) (fromRational y)) l
    
    
    
    
    
    -- | `prepData d` assumes the input lists correspond to evenly sampled values of a scalar-valued field.
    --
    -- The function extracts the pixel mesh size, the data ranges and places the data points within the unit square [0,1] x [0,1]
    prepData ::
      (Ord t, Fractional a, Enum a) =>
         [[t]]  -- ^ Data
      -> (a, a, t, t, [LabeledPoint t a])  -- ^ (# of pixel rows, # of pixel columns, data minimum, data maximum, data points)
    prepData ll = (nh, nw, valMin, valMax, d')
      where
        nh = fromIntegral $ length ll
        nw = fromIntegral $ length (head ll) 
        d' = toUnitFramedLP nw nh <$> toCoord ll
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Heatmap from the package plot-light
    toFigFrame from to = moveLabeledPointBwFrames from to False False . fromRationalLP
    
    fromRationalLP :: Fractional a => LabeledPoint l Rational -> LabeledPoint l a
    fromRationalLP (LabeledPoint (Point x y) l) = LabeledPoint (Point (fromRational x) (fromRational y)) l
    
    
    
    
    
    -- | `prepData d` assumes the input lists correspond to evenly sampled values of a scalar-valued field.
    --
    -- The function extracts the pixel mesh size, the data ranges and places the data points within the unit square [0,1] x [0,1]
    prepData ::
      (Ord t, Fractional a, Enum a) =>
         [[t]]  -- ^ Data
      -> (a, a, t, t, [LabeledPoint t a])  -- ^ (# of pixel rows, # of pixel columns, data minimum, data maximum, data points)
    prepData ll = (nh, nw, valMin, valMax, d')
      where
        nh = fromIntegral $ length ll
        nw = fromIntegral $ length (head ll) 
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Heatmap from the package plot-light
         Frame a -> Frame a -> LabeledPoint l Rational -> LabeledPoint l a
    toFigFrame from to = moveLabeledPointBwFrames from to False False . fromRationalLP
    
    fromRationalLP :: Fractional a => LabeledPoint l Rational -> LabeledPoint l a
    fromRationalLP (LabeledPoint (Point x y) l) = LabeledPoint (Point (fromRational x) (fromRational y)) l
    
    
    
    
    
    -- | `prepData d` assumes the input lists correspond to evenly sampled values of a scalar-valued field.
    --
    -- The function extracts the pixel mesh size, the data ranges and places the data points within the unit square [0,1] x [0,1]
    prepData ::
      (Ord t, Fractional a, Enum a) =>
         [[t]]  -- ^ Data
      -> (a, a, t, t, [LabeledPoint t a])  -- ^ (# of pixel rows, # of pixel columns, data minimum, data maximum, data points)
    prepData ll = (nh, nw, valMin, valMax, d')
      where
        nh = fromIntegral $ length ll
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Heatmap from the package plot-light
          w = figFWidth fdat / nw
          h = figFHeight fdat / nh
          from = Frame (Point 0 0) (Point 1 1)
          to = frameFromFigData fdat
      forM_ d' (pixel palette w h vmin vmax . toFigFrame from to) 
    
    -- | `heatmap'` renders one SVG pixel for every `LabeledPoint` supplied as input. The `LabeledPoint`s must be bounded by the `Frame`.
    heatmap'
      :: (Foldable f, Functor f, Show a, RealFrac a, RealFrac t) =>
         FigureData a         -- ^ Figure data
         -> [C.Colour Double] -- ^ Colour palette
         -> Frame a           -- ^ Frame containing the data
         -> a                 -- ^ Number of points along x axis
         -> a                 -- ^ " y axis
         -> f (LabeledPoint t a) -- ^ Data
         -> Svg
    heatmap' fdat palette from nw nh lp = do
      let
        w = figFWidth fdat / nw
        h = figFHeight fdat / nh
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Heatmap from the package plot-light
      :: FigureData Rational   -- ^ Figure data
         -> [C.Colour Double]  -- ^ Colour palette
         -> [[Scientific]]     -- ^ Data
         -> Svg
    heatmap fdat palette d = do
      let (nh, nw, vmin, vmax, d') = prepData d
          w = figFWidth fdat / nw
          h = figFHeight fdat / nh
          from = Frame (Point 0 0) (Point 1 1)
          to = frameFromFigData fdat
      forM_ d' (pixel palette w h vmin vmax . toFigFrame from to) 
    
    -- | `heatmap'` renders one SVG pixel for every `LabeledPoint` supplied as input. The `LabeledPoint`s must be bounded by the `Frame`.
    heatmap'
      :: (Foldable f, Functor f, Show a, RealFrac a, RealFrac t) =>
         FigureData a         -- ^ Figure data
         -> [C.Colour Double] -- ^ Colour palette
         -> Frame a           -- ^ Frame containing the data
         -> a                 -- ^ Number of points along x axis
         -> a                 -- ^ " y axis
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Scatter from the package plot-light
    scatterLPBar :: (RealFrac t, Enum t, RealFrac b, Show b) =>
                    FigureData b
                 -> b                 -- ^ Legend width
                 -> t                 -- ^ Data value lower bound
                 -> t                 -- ^ Data value upper bound
                 -> Int               -- ^ Number of legend entries
                 -> LegendPosition_   -- ^ Legend position in the figure
                 -> b                 -- ^ Legend length
                 -> (t -> b -> b)     -- ^ Modifies the glyph size
                 -> (t -> b -> b)     -- ^ Modifies the glyph stroke width
                 -> (t -> C.Colour Double -> C.Colour Double) -- ^ Modifies the glyph colour
                 -> (t -> b -> b)     -- ^ Modifies the glyph opacity
                 -> ScatterPointData b    -- ^ Glyph style defaults
                 -> Svg
    scatterLPBar fdat w vmin vmax n legpos legh f g h i spdat = legendBar fdat w vmin vmax n legpos legh fun where
      wglyph = spSize spdat
      fun _ _ _ _ _ lp@(LabeledPoint p val) = do
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Scatter from the package plot-light
        ScatterPointData sh w' sw' col' a' = modifyScatterPoint f g h i spdat lp
    
    
    
    scatterLPBar :: (RealFrac t, Enum t, RealFrac b, Show b) =>
                    FigureData b
                 -> b                 -- ^ Legend width
                 -> t                 -- ^ Data value lower bound
                 -> t                 -- ^ Data value upper bound
                 -> Int               -- ^ Number of legend entries
                 -> LegendPosition_   -- ^ Legend position in the figure
                 -> b                 -- ^ Legend length
                 -> (t -> b -> b)     -- ^ Modifies the glyph size
                 -> (t -> b -> b)     -- ^ Modifies the glyph stroke width
                 -> (t -> C.Colour Double -> C.Colour Double) -- ^ Modifies the glyph colour
                 -> (t -> b -> b)     -- ^ Modifies the glyph opacity
                 -> ScatterPointData b    -- ^ Glyph style defaults
                 -> Svg
    scatterLPBar fdat w vmin vmax n legpos legh f g h i spdat = legendBar fdat w vmin vmax n legpos legh fun where
      wglyph = spSize spdat
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Scatter from the package plot-light
     where
        ScatterPointData sh w' sw' col' a' = modifyScatterPoint f g h i spdat lp
    
    
    
    scatterLPBar :: (RealFrac t, Enum t, RealFrac b, Show b) =>
                    FigureData b
                 -> b                 -- ^ Legend width
                 -> t                 -- ^ Data value lower bound
                 -> t                 -- ^ Data value upper bound
                 -> Int               -- ^ Number of legend entries
                 -> LegendPosition_   -- ^ Legend position in the figure
                 -> b                 -- ^ Legend length
                 -> (t -> b -> b)     -- ^ Modifies the glyph size
                 -> (t -> b -> b)     -- ^ Modifies the glyph stroke width
                 -> (t -> C.Colour Double -> C.Colour Double) -- ^ Modifies the glyph colour
                 -> (t -> b -> b)     -- ^ Modifies the glyph opacity
                 -> ScatterPointData b    -- ^ Glyph style defaults
                 -> Svg
    scatterLPBar fdat w vmin vmax n legpos legh f g h i spdat = legendBar fdat w vmin vmax n legpos legh fun where
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Scatter from the package plot-light
    scatterLP1 f g h i spdat lp = glyph w' sw' sh col' a' (_lp lp)
     where
        ScatterPointData sh w' sw' col' a' = modifyScatterPoint f g h i spdat lp
    
    
    
    scatterLPBar :: (RealFrac t, Enum t, RealFrac b, Show b) =>
                    FigureData b
                 -> b                 -- ^ Legend width
                 -> t                 -- ^ Data value lower bound
                 -> t                 -- ^ Data value upper bound
                 -> Int               -- ^ Number of legend entries
                 -> LegendPosition_   -- ^ Legend position in the figure
                 -> b                 -- ^ Legend length
                 -> (t -> b -> b)     -- ^ Modifies the glyph size
                 -> (t -> b -> b)     -- ^ Modifies the glyph stroke width
                 -> (t -> C.Colour Double -> C.Colour Double) -- ^ Modifies the glyph colour
                 -> (t -> b -> b)     -- ^ Modifies the glyph opacity
                 -> ScatterPointData b    -- ^ Glyph style defaults
                 -> Svg
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Scatter from the package plot-light
               -> (l -> b -> a)        -- ^ Modifies the glyph opacity
               -> ScatterPointData b   
               -> LabeledPoint l a
               -> Svg
    scatterLP1 f g h i spdat lp = glyph w' sw' sh col' a' (_lp lp)
     where
        ScatterPointData sh w' sw' col' a' = modifyScatterPoint f g h i spdat lp
    
    
    
    scatterLPBar :: (RealFrac t, Enum t, RealFrac b, Show b) =>
                    FigureData b
                 -> b                 -- ^ Legend width
                 -> t                 -- ^ Data value lower bound
                 -> t                 -- ^ Data value upper bound
                 -> Int               -- ^ Number of legend entries
                 -> LegendPosition_   -- ^ Legend position in the figure
                 -> b                 -- ^ Legend length
                 -> (t -> b -> b)     -- ^ Modifies the glyph size
                 -> (t -> b -> b)     -- ^ Modifies the glyph stroke width
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Scatter from the package plot-light
               -> (l -> C.Colour Double -> C.Colour Double)  -- ^ Modifies the glyph colour
               -> (l -> b -> a)        -- ^ Modifies the glyph opacity
               -> ScatterPointData b   
               -> LabeledPoint l a
               -> Svg
    scatterLP1 f g h i spdat lp = glyph w' sw' sh col' a' (_lp lp)
     where
        ScatterPointData sh w' sw' col' a' = modifyScatterPoint f g h i spdat lp
    
    
    
    scatterLPBar :: (RealFrac t, Enum t, RealFrac b, Show b) =>
                    FigureData b
                 -> b                 -- ^ Legend width
                 -> t                 -- ^ Data value lower bound
                 -> t                 -- ^ Data value upper bound
                 -> Int               -- ^ Number of legend entries
                 -> LegendPosition_   -- ^ Legend position in the figure
                 -> b                 -- ^ Legend length
                 -> (t -> b -> b)     -- ^ Modifies the glyph size
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Scatter from the package plot-light
    scatterLP1 :: (Show a, RealFrac a) =>
                  (l -> b -> a)            -- ^ Modifies the glyph size
               -> (l -> b -> a)         -- ^ Modifies the glyph stroke width
               -> (l -> C.Colour Double -> C.Colour Double)  -- ^ Modifies the glyph colour
               -> (l -> b -> a)        -- ^ Modifies the glyph opacity
               -> ScatterPointData b   
               -> LabeledPoint l a
               -> Svg
    scatterLP1 f g h i spdat lp = glyph w' sw' sh col' a' (_lp lp)
     where
        ScatterPointData sh w' sw' col' a' = modifyScatterPoint f g h i spdat lp
    
    
    
    scatterLPBar :: (RealFrac t, Enum t, RealFrac b, Show b) =>
                    FigureData b
                 -> b                 -- ^ Legend width
                 -> t                 -- ^ Data value lower bound
                 -> t                 -- ^ Data value upper bound
                 -> Int               -- ^ Number of legend entries
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Scatter from the package plot-light
    scatterLP1 :: (Show a, RealFrac a) =>
                  (l -> b -> a)            -- ^ Modifies the glyph size
               -> (l -> b -> a)         -- ^ Modifies the glyph stroke width
               -> (l -> C.Colour Double -> C.Colour Double)  -- ^ Modifies the glyph colour
               -> (l -> b -> a)        -- ^ Modifies the glyph opacity
               -> ScatterPointData b   
               -> LabeledPoint l a
               -> Svg
    scatterLP1 f g h i spdat lp = glyph w' sw' sh col' a' (_lp lp)
     where
        ScatterPointData sh w' sw' col' a' = modifyScatterPoint f g h i spdat lp
    
    
    
    scatterLPBar :: (RealFrac t, Enum t, RealFrac b, Show b) =>
                    FigureData b
                 -> b                 -- ^ Legend width
                 -> t                 -- ^ Data value lower bound
                 -> t                 -- ^ Data value upper bound
                 -> Int               -- ^ Number of legend entries
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Scatter from the package plot-light
      forM_ ps $ glyph w sw glshape fcol alpha
    
    
    -- | Parametric scatter plot
    --
    -- The parameters of every point in the scatter plot are modulated according to the label, using the three functions.
    --
    -- This can be used to produce rich infographics, in which e.g. the colour and size of the glyphs carry additional information.
    scatterLP :: (Foldable t, RealFrac a, Show a) =>
                 (l -> b -> a)            -- ^ Modifies the glyph size
              -> (l -> b -> a)         -- ^ Modifies the glyph stroke width
              -> (l -> C.Colour Double -> C.Colour Double)  -- ^ Modifies the glyph colour
              -> (l -> b -> a)        -- ^ Modifies the glyph opacity
              -> ScatterPointData b    -- ^ Glyph style defaults
              -> t (LabeledPoint l a) -- ^ Data
              -> Svg
    scatterLP f g h i spdat lps = forM_ lps (scatterLP1 f g h i spdat)
    
    
    scatterLP1 :: (Show a, RealFrac a) =>
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Scatter from the package plot-light
    -- Every point in the plot has the same parameters, as declared in the `ScatterPointData` record
    scatter :: (Foldable t, Show a, RealFrac a) =>
               ScatterPointData a
            -> t (Point a)
            -> Svg
    scatter (ScatterPointData glshape w sw fcol alpha) ps = 
      forM_ ps $ glyph w sw glshape fcol alpha
    
    
    -- | Parametric scatter plot
    --
    -- The parameters of every point in the scatter plot are modulated according to the label, using the three functions.
    --
    -- This can be used to produce rich infographics, in which e.g. the colour and size of the glyphs carry additional information.
    scatterLP :: (Foldable t, RealFrac a, Show a) =>
                 (l -> b -> a)            -- ^ Modifies the glyph size
              -> (l -> b -> a)         -- ^ Modifies the glyph stroke width
              -> (l -> C.Colour Double -> C.Colour Double)  -- ^ Modifies the glyph colour
              -> (l -> b -> a)        -- ^ Modifies the glyph opacity
              -> ScatterPointData b    -- ^ Glyph style defaults
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Scatter from the package plot-light
    import Text.Blaze.Svg
    import Text.Blaze.Svg.Renderer.String (renderSvg)
    
    import qualified Data.Colour as C
    -- import qualified Data.Colour.Palette.BrewerSet as CP
    import qualified Data.Colour.Names as C
    import qualified Data.Text as T
    import qualified Data.Text.IO as T
    
    -- | Scatter plot
    --
    -- Every point in the plot has the same parameters, as declared in the `ScatterPointData` record
    scatter :: (Foldable t, Show a, RealFrac a) =>
               ScatterPointData a
            -> t (Point a)
            -> Svg
    scatter (ScatterPointData glshape w sw fcol alpha) ps = 
      forM_ ps $ glyph w sw glshape fcol alpha
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Scatter from the package plot-light
    import Control.Monad (forM_)
    
    import Text.Blaze.Svg
    import Text.Blaze.Svg.Renderer.String (renderSvg)
    
    import qualified Data.Colour as C
    -- import qualified Data.Colour.Palette.BrewerSet as CP
    import qualified Data.Colour.Names as C
    import qualified Data.Text as T
    import qualified Data.Text.IO as T
    
    -- | Scatter plot
    --
    -- Every point in the plot has the same parameters, as declared in the `ScatterPointData` record
    scatter :: (Foldable t, Show a, RealFrac a) =>
               ScatterPointData a
            -> t (Point a)
            -> Svg
    scatter (ScatterPointData glshape w sw fcol alpha) ps = 
      forM_ ps $ glyph w sw glshape fcol alpha
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.TimeSeries from the package plot-light
    --   td1 = fromTick t1
    --   td2 = fromTick t2
    
    
    
    
    -- * Helpers
    
    -- | Create a `LabeledPoint` from a time series point (`TsPoint`). The `_tick` (time axis) field will be used for the x coordinate, whereas both fields of TsPoint may be used to create the label field.
    --
    -- NB : The coordinates of the resulting LabelPoint still live in the original data space; they must be rescaled to fit in the figure viewport
    tspToLP :: Fractional a => 
         (t -> a)
      -> (Tick -> t -> l)
      -> TsPoint t
      -> LabeledPoint l a
    tspToLP fy g = LabeledPoint <$> pf <*> lf where
      pf = Point <$> tickToFractional <*> fy . _val
      lf = g <$> _tick <*> _val
      
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.TimeSeries from the package plot-light
    -- tickRange t1 t2 dt = toTick <$> [td1, td1 + dt .. td2] where
    --   td1 = fromTick t1
    --   td2 = fromTick t2
    
    
    
    
    -- * Helpers
    
    -- | Create a `LabeledPoint` from a time series point (`TsPoint`). The `_tick` (time axis) field will be used for the x coordinate, whereas both fields of TsPoint may be used to create the label field.
    --
    -- NB : The coordinates of the resulting LabelPoint still live in the original data space; they must be rescaled to fit in the figure viewport
    tspToLP :: Fractional a => 
         (t -> a)
      -> (Tick -> t -> l)
      -> TsPoint t
      -> LabeledPoint l a
    tspToLP fy g = LabeledPoint <$> pf <*> lf where
      pf = Point <$> tickToFractional <*> fy . _val
      lf = g <$> _tick <*> _val
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.TimeSeries from the package plot-light
    -- tickRange :: Tick -> Tick -> Rational -> [Tick]
    -- tickRange t1 t2 dt = toTick <$> [td1, td1 + dt .. td2] where
    --   td1 = fromTick t1
    --   td2 = fromTick t2
    
    
    
    
    -- * Helpers
    
    -- | Create a `LabeledPoint` from a time series point (`TsPoint`). The `_tick` (time axis) field will be used for the x coordinate, whereas both fields of TsPoint may be used to create the label field.
    --
    -- NB : The coordinates of the resulting LabelPoint still live in the original data space; they must be rescaled to fit in the figure viewport
    tspToLP :: Fractional a => 
         (t -> a)
      -> (Tick -> t -> l)
      -> TsPoint t
      -> LabeledPoint l a
    tspToLP fy g = LabeledPoint <$> pf <*> lf where
      pf = Point <$> tickToFractional <*> fy . _val
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.TimeSeries from the package plot-light
        _val :: a
        } deriving (Eq, Show)
    
    tickToFractional :: Fractional b => TsPoint a -> b
    tickToFractional = fromRational . fromTick . _tick
    
    -- | Map a Tick onto the rationals
    fromTick :: Tick -> Rational
    fromTick (Tick d t) = fromIntegral (toModifiedJulianDay d) + timeOfDayToDayFraction t
        
    -- | Map a rational onto a Tick
    toTick :: Rational -> Tick
    toTick n = Tick d t
      where
        t = dayFractionToTimeOfDay dec
        d = ModifiedJulianDay wh
        (wh, dec) = wholeDecimal n
    
    
    hourTick, halfHourTick, quarterHourTick :: Rational
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.TimeSeries from the package plot-light
      Tsp {
        _tick :: Tick,
        _val :: a
        } deriving (Eq, Show)
    
    tickToFractional :: Fractional b => TsPoint a -> b
    tickToFractional = fromRational . fromTick . _tick
    
    -- | Map a Tick onto the rationals
    fromTick :: Tick -> Rational
    fromTick (Tick d t) = fromIntegral (toModifiedJulianDay d) + timeOfDayToDayFraction t
        
    -- | Map a rational onto a Tick
    toTick :: Rational -> Tick
    toTick n = Tick d t
      where
        t = dayFractionToTimeOfDay dec
        d = ModifiedJulianDay wh
        (wh, dec) = wholeDecimal n
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.TimeSeries from the package plot-light
       return $ Tick d tim
    
    -- | A point in a time series
    data TsPoint a =
      Tsp {
        _tick :: Tick,
        _val :: a
        } deriving (Eq, Show)
    
    tickToFractional :: Fractional b => TsPoint a -> b
    tickToFractional = fromRational . fromTick . _tick
    
    -- | Map a Tick onto the rationals
    fromTick :: Tick -> Rational
    fromTick (Tick d t) = fromIntegral (toModifiedJulianDay d) + timeOfDayToDayFraction t
        
    -- | Map a rational onto a Tick
    toTick :: Rational -> Tick
    toTick n = Tick d t
      where
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.TimeSeries from the package plot-light
       return $ Tick d tim
    
    -- | A point in a time series
    data TsPoint a =
      Tsp {
        _tick :: Tick,
        _val :: a
        } deriving (Eq, Show)
    
    tickToFractional :: Fractional b => TsPoint a -> b
    tickToFractional = fromRational . fromTick . _tick
    
    -- | Map a Tick onto the rationals
    fromTick :: Tick -> Rational
    fromTick (Tick d t) = fromIntegral (toModifiedJulianDay d) + timeOfDayToDayFraction t
        
    -- | Map a rational onto a Tick
    toTick :: Rational -> Tick
    toTick n = Tick d t
      where
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.TimeSeries from the package plot-light
    --     fplot lps = polyline  sw Continuous Round colData (_lp <$> lps)
      
    tsAxis
      :: (Functor t, Foldable t, Show a, RealFrac a) =>
         FigureData a
         -> (l -> a)
         -> (l -> a)
         -> (l -> a)
         -> (l -> a)
         -> a
         -> C.Colour Double
         -> a
         -> Maybe (t (LabeledPoint l a))
         -> Maybe (t (LabeledPoint l a))
         -> t (LabeledPoint l a)
         -> Svg
    tsAxis fd fboxmin fboxmax fmin fmax sw colAxis rot plabx plaby ps =
      toPlot fd baz baz rot 0 sw colAxis plabx plaby fplot ps where
        from = frameFromPoints $ _lp <$> ps
        to = frameFromFigData fd
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.TimeSeries from the package plot-light
    --   toPlot fd T.pack T.pack rot 0 sw colAxis plabx plaby fplot ps where
    --     fplot lps = polyline  sw Continuous Round colData (_lp <$> lps)
      
    tsAxis
      :: (Functor t, Foldable t, Show a, RealFrac a) =>
         FigureData a
         -> (l -> a)
         -> (l -> a)
         -> (l -> a)
         -> (l -> a)
         -> a
         -> C.Colour Double
         -> a
         -> Maybe (t (LabeledPoint l a))
         -> Maybe (t (LabeledPoint l a))
         -> t (LabeledPoint l a)
         -> Svg
    tsAxis fd fboxmin fboxmax fmin fmax sw colAxis rot plabx plaby ps =
      toPlot fd baz baz rot 0 sw colAxis plabx plaby fplot ps where
        from = frameFromPoints $ _lp <$> ps
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.TimeSeries from the package plot-light
    -- tsAxis fd sw colAxis colData rot plabx plaby ps =
    --   toPlot fd T.pack T.pack rot 0 sw colAxis plabx plaby fplot ps where
    --     fplot lps = polyline  sw Continuous Round colData (_lp <$> lps)
      
    tsAxis
      :: (Functor t, Foldable t, Show a, RealFrac a) =>
         FigureData a
         -> (l -> a)
         -> (l -> a)
         -> (l -> a)
         -> (l -> a)
         -> a
         -> C.Colour Double
         -> a
         -> Maybe (t (LabeledPoint l a))
         -> Maybe (t (LabeledPoint l a))
         -> t (LabeledPoint l a)
         -> Svg
    tsAxis fd fboxmin fboxmax fmin fmax sw colAxis rot plabx plaby ps =
      toPlot fd baz baz rot 0 sw colAxis plabx plaby fplot ps where
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.TimeSeries from the package plot-light
    --      FigureData a
    --      -> a
    --      -> C.Colour Double
    --      -> C.Colour Double
    --      -> a
    --      -> Maybe (t (LabeledPoint String a))
    --      -> Maybe (t (LabeledPoint String a))
    --      -> t (LabeledPoint String a)
    --      -> Svg
    -- tsAxis fd sw colAxis colData rot plabx plaby ps =
    --   toPlot fd T.pack T.pack rot 0 sw colAxis plabx plaby fplot ps where
    --     fplot lps = polyline  sw Continuous Round colData (_lp <$> lps)
      
    tsAxis
      :: (Functor t, Foldable t, Show a, RealFrac a) =>
         FigureData a
         -> (l -> a)
         -> (l -> a)
         -> (l -> a)
         -> (l -> a)
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.TimeSeries from the package plot-light
    --      FigureData a
    --      -> a
    --      -> C.Colour Double
    --      -> C.Colour Double
    --      -> a
    --      -> Maybe (t (LabeledPoint String a))
    --      -> Maybe (t (LabeledPoint String a))
    --      -> t (LabeledPoint String a)
    --      -> Svg
    -- tsAxis fd sw colAxis colData rot plabx plaby ps =
    --   toPlot fd T.pack T.pack rot 0 sw colAxis plabx plaby fplot ps where
    --     fplot lps = polyline  sw Continuous Round colData (_lp <$> lps)
      
    tsAxis
      :: (Functor t, Foldable t, Show a, RealFrac a) =>
         FigureData a
         -> (l -> a)
         -> (l -> a)
         -> (l -> a)
         -> (l -> a)
    

    toSvg No usage example found for this symbol :( Collapse [-]
    tr No usage example found for this symbol :( Collapse [-]
    translate See 2 Occurences [+] Collapse [-]
    Found in Graphics.Rendering.Plot.Light.Internal from the package plot-light
    strokeLineJoin slj = SA.strokeLinejoin (S.toValue str) where
      str | slj == Miter = "miter" :: String
          | slj == Round = "round"
          | slj == Bevel = "bevel"
          | otherwise = "inherit"
    
    
    
    
    
    
    
    -- | Move a Svg entity to a new position
    translateSvg :: Show a => Point a -> Svg -> Svg
    translateSvg (Point x y) svg = S.g ! SA.transform (S.translate x y) $ svg
    

    Found in Graphics.Rendering.Plot.Light.Internal from the package plot-light
    --
    -- The user can supply an additional `V2` displacement which will be applied /after/ rotation and anchoring and refers to the rotated text box frame.
    --
    -- > > putStrLn $ renderSvg $ text (-45) C.green TAEnd "blah" (V2 (- 10) 0) (Point 250 0)
    -- > <text x="-10.0" y="0.0" transform="translate(250.0 0.0)rotate(-45.0)" fill="#008000" text-anchor="end">blah</text>
    text :: (Show a, Real a) =>
            a               -- ^ Rotation angle of the textbox
         -> Int             -- ^ Font size
         -> C.Colour Double -- ^ Font colour
         -> TextAnchor_     -- ^ How to anchor the text to the point
         -> T.Text          -- ^ Text 
         -> V2 a            -- ^ Displacement w.r.t. rotated textbox
         -> Point a         -- ^ Initial position of the text box (i.e. before rotation and displacement)
         -> Svg
    text rot fontsize col ta te (V2 vx vy) (Point x y) = S.text_ (S.toMarkup te) ! SA.x (vd vx) ! SA.y (vd vy) ! SA.transform (S.translate (real x) (real y) <> S.rotate (real rot)) ! SA.fontSize (vi fontsize) ! SA.fill (colourAttr col) ! textAnchor ta
    
    -- | Specify at which end should the text be anchored to its current point
    data TextAnchor_ = TAStart | TAMiddle | TAEnd deriving (Eq, Show)
    
    textAnchor :: TextAnchor_ -> S.Attribute
    

    v See 10 Occurences [+] Collapse [-]
    Found in Graphics.Rendering.Plot.Light.PlotTypes.Histogram from the package plot-light
    histo :: (Foldable v, VU.Unbox a, Num a) =>
             Int
          -> v Double
          -> H.Histogram H.BinD a
    histo n v = histo'' bins v where
      mi = minimum v
      ma = maximum v + 1
      bins = H.binD mi n ma
    
    
    histo'' :: (Foldable f, H.Bin bin, VU.Unbox val, Num val) =>
               bin
            -> f (H.BinValue bin)
            -> H.Histogram bin val
    histo'' bins v = H.fillBuilder buildr v
      where
        buildr = H.mkSimple bins
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Histogram from the package plot-light
    histo :: (Foldable v, VU.Unbox a, Num a) =>
             Int
          -> v Double
          -> H.Histogram H.BinD a
    histo n v = histo'' bins v where
      mi = minimum v
      ma = maximum v + 1
      bins = H.binD mi n ma
    
    
    histo'' :: (Foldable f, H.Bin bin, VU.Unbox val, Num val) =>
               bin
            -> f (H.BinValue bin)
            -> H.Histogram bin val
    histo'' bins v = H.fillBuilder buildr v
      where
        buildr = H.mkSimple bins
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Histogram from the package plot-light
      pshs = zip ps binCounts 
      (binCenters, binCounts) = unzip $ H.asList his
      binW = H.binSize $ H.bins his  -- bin width
      hMult = 10 -- height multiplication coeff. (hack)
    
    
    
    -- | Uniform, un-weighted bins
    histo :: (Foldable v, VU.Unbox a, Num a) =>
             Int
          -> v Double
          -> H.Histogram H.BinD a
    histo n v = histo'' bins v where
      mi = minimum v
      ma = maximum v + 1
      bins = H.binD mi n ma
    
    
    histo'' :: (Foldable f, H.Bin bin, VU.Unbox val, Num val) =>
               bin
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Histogram from the package plot-light
      ps = pointRange nBins p1 p2
      pshs = zip ps binCounts 
      (binCenters, binCounts) = unzip $ H.asList his
      binW = H.binSize $ H.bins his  -- bin width
      hMult = 10 -- height multiplication coeff. (hack)
    
    
    
    -- | Uniform, un-weighted bins
    histo :: (Foldable v, VU.Unbox a, Num a) =>
             Int
          -> v Double
          -> H.Histogram H.BinD a
    histo n v = histo'' bins v where
      mi = minimum v
      ma = maximum v + 1
      bins = H.binD mi n ma
    
    
    histo'' :: (Foldable f, H.Bin bin, VU.Unbox val, Num val) =>
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Histogram from the package plot-light
      p2 = Point (last binCenters) 0
      ps = pointRange nBins p1 p2
      pshs = zip ps binCounts 
      (binCenters, binCounts) = unzip $ H.asList his
      binW = H.binSize $ H.bins his  -- bin width
      hMult = 10 -- height multiplication coeff. (hack)
    
    
    
    -- | Uniform, un-weighted bins
    histo :: (Foldable v, VU.Unbox a, Num a) =>
             Int
          -> v Double
          -> H.Histogram H.BinD a
    histo n v = histo'' bins v where
      mi = minimum v
      ma = maximum v + 1
      bins = H.binD mi n ma
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Histogram from the package plot-light
      p2 = Point (last binCenters) 0
      ps = pointRange nBins p1 p2
      pshs = zip ps binCounts 
      (binCenters, binCounts) = unzip $ H.asList his
      binW = H.binSize $ H.bins his  -- bin width
      hMult = 10 -- height multiplication coeff. (hack)
    
    
    
    -- | Uniform, un-weighted bins
    histo :: (Foldable v, VU.Unbox a, Num a) =>
             Int
          -> v Double
          -> H.Histogram H.BinD a
    histo n v = histo'' bins v where
      mi = minimum v
      ma = maximum v + 1
      bins = H.binD mi n ma
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Histogram from the package plot-light
      his = histo nBins dats
      p1 = Point (head binCenters) 0
      p2 = Point (last binCenters) 0
      ps = pointRange nBins p1 p2
      pshs = zip ps binCounts 
      (binCenters, binCounts) = unzip $ H.asList his
      binW = H.binSize $ H.bins his  -- bin width
      hMult = 10 -- height multiplication coeff. (hack)
    
    
    
    -- | Uniform, un-weighted bins
    histo :: (Foldable v, VU.Unbox a, Num a) =>
             Int
          -> v Double
          -> H.Histogram H.BinD a
    histo n v = histo'' bins v where
      mi = minimum v
      ma = maximum v + 1
      bins = H.binD mi n ma
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Histogram from the package plot-light
              -> Svg
    histogram col nBins dats = forM_ pshs $ \(p, h) -> rectCenteredMidpointBase binW (hMult * h) col p where
      his = histo nBins dats
      p1 = Point (head binCenters) 0
      p2 = Point (last binCenters) 0
      ps = pointRange nBins p1 p2
      pshs = zip ps binCounts 
      (binCenters, binCounts) = unzip $ H.asList his
      binW = H.binSize $ H.bins his  -- bin width
      hMult = 10 -- height multiplication coeff. (hack)
    
    
    
    -- | Uniform, un-weighted bins
    histo :: (Foldable v, VU.Unbox a, Num a) =>
             Int
          -> v Double
          -> H.Histogram H.BinD a
    histo n v = histo'' bins v where
      mi = minimum v
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Histogram from the package plot-light
    dats = [46,30,4,7,73,12,23,90,34,24,5,6,12,3,55,61]
    
    main = do
      let
        kol = shapeColNoBorder C.red 1
        svg_t = svgHeader xPlot yPlot $ histogram kol 5 dats
      T.writeFile fnameOut $ T.pack $ renderSvg svg_t
    
    
    
    
    histogram :: Foldable v =>
                 ShapeCol Double -- ^ Colour information (fill, stroke, opacity)
              -> Int             -- ^ Number of histogram bins
              -> v Double        -- ^ Data
              -> Svg
    histogram col nBins dats = forM_ pshs $ \(p, h) -> rectCenteredMidpointBase binW (hMult * h) col p where
      his = histo nBins dats
      p1 = Point (head binCenters) 0
      p2 = Point (last binCenters) 0
    

    Found in Graphics.Rendering.Plot.Light.PlotTypes.Histogram from the package plot-light
    yPlot = 300
    fnameOut = "data/histogram-1.svg"
    
    dats = [46,30,4,7,73,12,23,90,34,24,5,6,12,3,55,61]
    
    main = do
      let
        kol = shapeColNoBorder C.red 1
        svg_t = svgHeader xPlot yPlot $ histogram kol 5 dats
      T.writeFile fnameOut $ T.pack $ renderSvg svg_t
    
    
    
    
    histogram :: Foldable v =>
                 ShapeCol Double -- ^ Colour information (fill, stroke, opacity)
              -> Int             -- ^ Number of histogram bins
              -> v Double        -- ^ Data
              -> Svg
    histogram col nBins dats = forM_ pshs $ \(p, h) -> rectCenteredMidpointBase binW (hMult * h) col p where
    

    vr No usage example found for this symbol :( Collapse [-]
    z No usage example found for this symbol :( Collapse [-]
    Path No usage example found for this symbol :( Collapse [-]
    Svg No usage example found for this symbol :( Collapse [-]