packages feed

dynamic-graph 0.1.0.4 → 0.1.0.5

raw patch · 7 files changed

+127/−32 lines, 7 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

Graphics/DynamicGraph/Axis.hs view
@@ -4,7 +4,17 @@  {-# LANGUAGE RecordWildCards #-} -module Graphics.DynamicGraph.Axis where+module Graphics.DynamicGraph.Axis (+    blankCanvas,+    blankCanvasAlpha,+    drawAxes,+    gridXCoords,+    gridYCoords,+    xAxisLabels,+    yAxisLabels,+    xAxisGrid,+    yAxisGrid+    ) where  import Control.Monad import Data.Colour.RGBSpace
+ Graphics/DynamicGraph/ColorMaps.hs view
@@ -0,0 +1,30 @@+module Graphics.DynamicGraph.ColorMaps (+    jet,+    jet_mod,+    hot,+    bw,+    wb,+    ) where++import Graphics.Rendering.OpenGL++-- | The matlab / octave \"jet\" color map+jet :: [GLfloat]+jet =  [0, 0, 0.5,  0, 0, 1,  0, 0.5, 1,   0, 1, 1,  0.5, 1, 0.5,  1, 1, 0,  1, 0.5, 0,  1, 0, 0,  0.5, 0, 0]++-- | \"jet\" modified so that low values are a darker blue+jet_mod :: [GLfloat]+jet_mod =  [0, 0, 0.1,  0, 0, 1,  0, 0.5, 1,   0, 1, 1,  0.5, 1, 0.5,  1, 1, 0,  1, 0.5, 0,  1, 0, 0,  0.5, 0, 0]++-- | The matlab / octave \"hot\" color map+hot :: [GLfloat]+hot =  [0, 0, 0,  1, 0, 0,  1, 1, 0,  1, 1, 1]++-- | Ranges from black to white+bw :: [GLfloat]+bw =  [0, 0, 0, 1, 1, 1]++-- | Ranges from white to black+wb :: [GLfloat]+wb =  [1, 1, 1, 0, 0, 0]+
Graphics/DynamicGraph/FillLine.hs view
@@ -1,11 +1,37 @@ {-# LANGUAGE ScopedTypeVariables #-}  {-| Draw and update filled in line graphs with OpenGL.++Example usage:++> import Control.Monad+> import Control.Monad.Trans.Either+> import Control.Concurrent+> import Pipes+> import qualified Pipes.Prelude as P+> import System.Random+> import Graphics.Rendering.OpenGL+> +> import Graphics.DynamicGraph.FillLine+> +> randomVect :: Producer [GLfloat] IO ()+> randomVect =  P.repeatM $ do+>     res <- replicateM 1000 randomIO+>     threadDelay 10000+>     return res+> +> main = eitherT putStrLn return $ do+>     setupGLFW+>     lineGraph <- filledLineWindow 1024 480 1000 jet_mod+> +>     lift $ runEffect $ randomVect >-> lineGraph -}  module Graphics.DynamicGraph.FillLine (     filledLineWindow,-    renderFilledLine+    renderFilledLine,+    setupGLFW,+    module Graphics.DynamicGraph.ColorMaps     ) where  import Control.Monad@@ -24,6 +50,7 @@ import Pipes  import Graphics.DynamicGraph.Util+import Graphics.DynamicGraph.ColorMaps  import Paths_dynamic_graph 
Graphics/DynamicGraph/TextureLine.hs view
@@ -3,11 +3,36 @@ {-| Draw and update line graphs with OpenGL.      Based on: <https://en.wikibooks.org/wiki/OpenGL_Programming/Scientific_OpenGL_Tutorial_02>++    Example usage:++> import Control.Monad+> import Control.Monad.Trans.Either+> import Control.Concurrent+> import Pipes+> import qualified Pipes.Prelude as P+> import System.Random+> import Graphics.Rendering.OpenGL+> +> import Graphics.DynamicGraph.TextureLine+> +> randomVect :: Producer [GLfloat] IO ()+> randomVect =  P.repeatM $ do+>     res <- replicateM 1000 randomIO+>     threadDelay 10000+>     return res+> +> main = eitherT putStrLn return $ do+>     setupGLFW+>     lineGraph <- textureLineWindow 1024 480 1000 1024 +> +>     lift $ runEffect $ randomVect >-> lineGraph -}  module Graphics.DynamicGraph.TextureLine (     textureLineWindow,-    renderTextureLine+    renderTextureLine,+    setupGLFW     ) where  import Control.Monad
Graphics/DynamicGraph/Waterfall.hs view
@@ -1,14 +1,35 @@ {-# LANGUAGE ScopedTypeVariables #-} {-| Draw and update waterfall plots with OpenGL. Useful for spectrograms.++Example usage:++> import Control.Monad+> import Control.Monad.Trans.Either+> import Control.Concurrent+> import Pipes+> import qualified Pipes.Prelude as P+> import System.Random+> import Graphics.Rendering.OpenGL+> +> import Graphics.DynamicGraph.Waterfall+> +> randomVect :: Producer [GLfloat] IO ()+> randomVect =  P.repeatM $ do+>     res <- replicateM 1000 randomIO+>     threadDelay 10000+>     return res+> +> main = eitherT putStrLn return $ do+>     setupGLFW+>     waterfall <- waterfallWindow 1024 480 1000 1000 jet_mod+> +>     lift $ runEffect $ randomVect >-> waterfall -} module Graphics.DynamicGraph.Waterfall (-    jet,-    jet_mod,-    hot,-    bw,-    wb,     waterfallWindow,-    renderWaterfall+    renderWaterfall,+    setupGLFW,+    module Graphics.DynamicGraph.ColorMaps     ) where  import Control.Monad@@ -27,28 +48,9 @@ import Pipes  import Graphics.DynamicGraph.Util+import Graphics.DynamicGraph.ColorMaps  import Paths_dynamic_graph---- | The matlab / octave \"jet\" color map-jet :: [GLfloat]-jet =  [0, 0, 0.5,  0, 0, 1,  0, 0.5, 1,   0, 1, 1,  0.5, 1, 0.5,  1, 1, 0,  1, 0.5, 0,  1, 0, 0,  0.5, 0, 0]---- | \"jet\" modified so that low values are a darker blue-jet_mod :: [GLfloat]-jet_mod =  [0, 0, 0.1,  0, 0, 1,  0, 0.5, 1,   0, 1, 1,  0.5, 1, 0.5,  1, 1, 0,  1, 0.5, 0,  1, 0, 0,  0.5, 0, 0]---- | The matlab / octave \"hot\" color map-hot :: [GLfloat]-hot =  [0, 0, 0,  1, 0, 0,  1, 1, 0,  1, 1, 1]---- | Ranges from black to white-bw :: [GLfloat]-bw =  [0, 0, 0, 1, 1, 1]---- | Ranges from white to black-wb :: [GLfloat]-wb =  [1, 1, 1, 0, 0, 0]  {-| @(waterfallWindow windowWidth windowHeight width height colormap)@     creates a window of width @windowWidth@ and height @windowHeight@ for
dynamic-graph.cabal view
@@ -2,7 +2,7 @@ -- documentation, see http://haskell.org/cabal/users-guide/  name:                dynamic-graph-version:             0.1.0.4+version:             0.1.0.5 synopsis:            Draw and update graphs in real time with OpenGL description:         Draw and update graphs in real time with OpenGL. Suitable for displaying large amounts of frequently changing data. Line graphs and waterfall plots are supported, as well as axis drawing. license:             BSD3@@ -11,6 +11,8 @@ maintainer:          adamwalker10@gmail.com copyright:           2014 Adam Walker category:            Graphics+homepage:            https://github.com/adamwalker/dynamic-graph +bug-reports:         https://github.com/adamwalker/dynamic-graph/issues build-type:          Simple -- extra-source-files:   cabal-version:       >=1.10@@ -21,7 +23,7 @@     location: https://github.com/adamwalker/dynamic-graph  library-  exposed-modules:     Graphics.DynamicGraph.TextureLine, Graphics.DynamicGraph.Waterfall, Graphics.DynamicGraph.Util, Graphics.DynamicGraph.FillLine, Graphics.DynamicGraph.Axis, Graphics.DynamicGraph.RenderCairo+  exposed-modules:     Graphics.DynamicGraph.TextureLine, Graphics.DynamicGraph.Waterfall, Graphics.DynamicGraph.Util, Graphics.DynamicGraph.FillLine, Graphics.DynamicGraph.Axis, Graphics.DynamicGraph.RenderCairo, Graphics.DynamicGraph.ColorMaps   -- other-modules:          -- other-extensions:       build-depends:       base >=4.6 && <4.8, GLFW-b >=1.4 && <1.5, OpenGL >=2.9 && <2.10, GLUtil >=0.7 && <0.9, transformers >=0.3 && <0.5, either >=4.1 && <4.4, pipes, pango, cairo, colour, bytestring, deepseq
shaders/waterfall.frag view
@@ -10,6 +10,5 @@ void main() {     float intensity = texture2D(texture, f_coord).r;     gl_FragColor    = texture2D(colorMap, vec2(intensity * scale + offset, 0));-    //gl_FragColor    = vec4(0, 0, intensity, 0);  }