Draw and update graphs in real time with OpenGL
Haskell GLSL
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
Graphics/DynamicGraph
examples
shaders
LICENSE
Readme.md
Setup.hs
dynamic-graph.cabal

Readme.md

Dynamic-Graph

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.

Screenshots

Screenshot Screenshot

Installation

dynamic-graph is available on Hackage. Install with cabal install dynamic-graph.

Usage

To plot a waterfall of random data:

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
import Graphics.DynamicGraph.Window

randomVect :: Producer [GLfloat] IO ()
randomVect =  P.repeatM $ do
    res <- replicateM 1000 randomIO
    threadDelay 10000
    return res

main = eitherT putStrLn return $ do
    setupGLFW
    waterfall <- window 1024 480 $ renderWaterfall 1000 1000 jet_mod

    lift $ runEffect $ randomVect >-> waterfall