Plot-ho-matic 0.9.0.7 → 0.9.0.8
raw patch · 6 files changed
+27/−138 lines, 6 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- .gitignore +1/−0
- .travis.yml +13/−30
- CHANGELOG.md +4/−0
- Plot-ho-matic.cabal +6/−7
- src/PlotHo/ChartRender.hs +3/−1
- src/SetHo/OptionsWidget.hs +0/−100
.gitignore view
@@ -1,1 +1,2 @@ dist+.stack-work
.travis.yml view
@@ -1,50 +1,33 @@-# from https://github.com/hvr/multi-ghc-travis- # explicitly request container-based infrastructure sudo: false env:- - CABALVER=1.22 GHCVER=7.8.4 # see note about Alex/Happy- - CABALVER=1.22 GHCVER=7.10.3 # see note about Alex/Happy+ - GHCVER=7.10.3 +cache:+ directories:+ - ~/.stack+ addons: apt: sources: - hvr-ghc packages:- - ghc-7.6.3- - ghc-7.8.4 - ghc-7.10.3- - cabal-install-1.22 - libgsl0-dev - liblapack-dev - libgtk-3-dev before_install:- - export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH+ - export PATH=/opt/ghc/$GHCVER/bin:$PATH+ - mkdir -p ~/.local/bin+ - export PATH=~/.local/bin:$PATH+ - travis_retry curl -L https://www.stackage.org/stack/linux-x86_64 | tar -xzO --wildcards '*/stack' > ~/.local/bin/stack+ - chmod a+x ~/.local/bin/stack install:- - cabal update- - cabal install alex- - cabal install happy- - cabal install gtk2hs-buildtools- - for pkg in $(ghc-pkg list --user); do ghc-pkg unregister --force ${pkg}; done- - cabal install --only-dependencies --enable-tests --enable-benchmarks --reorder-goals+ - stack setup --no-terminal+ - stack build --only-snapshot --no-terminal -# Here starts the actual work to be performed for the package under test; any command which exits with a non-zero exit code causes the build to fail. script:- - cabal configure --enable-tests --enable-benchmarks -v2 # -v2 provides useful information for debugging- - cabal build # this builds all libraries and executables (including tests/benchmarks)- - cabal test --show-details=always-# - cabal check- - cabal sdist # tests that a source-distribution can be generated--# The following scriptlet checks that the resulting source distribution can be built & installed- - export SRC_TGZ=$(cabal info . | awk '{print $2 ".tar.gz";exit}') ;- cd dist/;- if [ -f "$SRC_TGZ" ]; then- cabal install "$SRC_TGZ";- else- echo "expected '$SRC_TGZ' not found";- exit 1;- fi+ - stack build --no-terminal
CHANGELOG.md view
@@ -1,3 +1,7 @@+0.9.0.8+---+* Make title text smaller+ 0.9.0.7 --- * Put scrolledWindow inside expander
Plot-ho-matic.cabal view
@@ -1,5 +1,5 @@ name: Plot-ho-matic-version: 0.9.0.7+version: 0.9.0.8 synopsis: Real-time line plotter for generic data license: BSD3 license-file: LICENSE@@ -32,7 +32,6 @@ PlotHo.Plotter, PlotHo.PlotTypes, SetHo.LookupTree- SetHo.OptionsWidget build-depends: base >= 4.6.0.0 && < 5 , bytestring@@ -52,7 +51,7 @@ , vector ghc-options: -O2 -Wall- ghc-prof-options: -O2 -Wall -prof -fprof-auto -fprof-cafs -rtsopts+ ghc-prof-options: -O2 -Wall flag examples@@ -71,8 +70,8 @@ , Plot-ho-matic , containers - ghc-options: -O2 -with-rtsopts=-T- ghc-prof-options: -O2 -Wall -prof -fprof-auto -fprof-cafs -rtsopts+ ghc-options: -O2 -Wall -with-rtsopts=-T+ ghc-prof-options: -O2 -Wall -with-rtsopts=-T executable set-example if flag(examples)@@ -86,5 +85,5 @@ , Plot-ho-matic , generic-accessors - ghc-options: -O2 -with-rtsopts=-T- ghc-prof-options: -O2 -Wall -prof -fprof-auto -fprof-cafs -rtsopts+ ghc-options: -O2 -Wall -with-rtsopts=-T+ ghc-prof-options: -O2 -Wall -with-rtsopts=-T
src/PlotHo/ChartRender.hs view
@@ -52,7 +52,9 @@ title = case mtitle of Nothing -> id- Just t -> Chart.layout_title .~ t+ Just t ->+ (Chart.layout_title .~ t) .+ ((Chart.layout_title_style . Chart.font_size) .~ 10) layout = Chart.layout_plots .~ map Chart.toPlot allLines $ title $ Chart.layout_x_axis . Chart.laxis_title .~ "time [s]"
− src/SetHo/OptionsWidget.hs
@@ -1,100 +0,0 @@-{-# OPTIONS_GHC -Wall #-}-{-# LANGUAGE ScopedTypeVariables #-}-{-# Language PackageImports #-}--module SetHo.OptionsWidget- ( GraphInfo(..)- , makeOptionsWidget- ) where--import qualified Control.Concurrent as CC-import "gtk3" Graphics.UI.Gtk ( AttrOp( (:=) ) )-import qualified "gtk3" Graphics.UI.Gtk as Gtk-import System.Glib.Signals ( on )-import Text.Read ( readMaybe )-import qualified Data.Text as T---- what the graph should draw-data GraphInfo =- GraphInfo { giXScaling :: Bool- , giXRange :: Maybe (Double,Double)- }--makeOptionsWidget :: CC.MVar GraphInfo -> IO Gtk.VBox-makeOptionsWidget graphInfoMVar = do- -- user selectable range- xRange <- Gtk.entryNew- Gtk.set xRange [ Gtk.entryEditable := False- , Gtk.widgetSensitive := False- ]- xRangeBox <- labeledWidget "x range:" xRange- Gtk.set xRange [Gtk.entryText := "(-10,10)"]- let updateXRange = do- Gtk.set xRange [ Gtk.entryEditable := True- , Gtk.widgetSensitive := True- ]- txt <- Gtk.get xRange Gtk.entryText- gi <- CC.readMVar graphInfoMVar- case readMaybe txt of- Nothing -> do- putStrLn $ "invalid x range entry: " ++ txt- Gtk.set xRange [Gtk.entryText := "(min,max)"]- Just (z0,z1) -> if z0 >= z1- then do- putStrLn $ "invalid x range entry (min >= max): " ++ txt- Gtk.set xRange [Gtk.entryText := "(min,max)"]- return ()- else do- _ <- CC.swapMVar graphInfoMVar (gi {giXRange = Just (z0,z1)})- return ()- _ <- on xRange Gtk.entryActivate updateXRange-- -- linear or log scaling on the x and y axis?- xScalingSelector <- Gtk.comboBoxNewText- mapM_ (Gtk.comboBoxAppendText xScalingSelector . T.pack)- ["linear (auto)","linear (manual)","logarithmic (auto)"]- Gtk.comboBoxSetActive xScalingSelector 0- xScalingBox <- labeledWidget "x scaling:" xScalingSelector- let updateXScaling = do- k <- Gtk.comboBoxGetActive xScalingSelector- case k of- 0 -> do- Gtk.set xRange [ Gtk.entryEditable := False- , Gtk.widgetSensitive := False- ]- CC.modifyMVar_ graphInfoMVar $- \gi -> return $ gi {giXScaling = False, giXRange = Nothing}- 1 -> do- Gtk.set xRange [ Gtk.entryEditable := False- , Gtk.widgetSensitive := False- ]- CC.modifyMVar_ graphInfoMVar $- \gi -> return $ gi {giXScaling = True, giXRange = Nothing}- _ -> error "the \"impossible\" happened: x scaling comboBox index should be < 3"- updateXScaling- _ <- on xScalingSelector Gtk.changed updateXScaling-- -- vbox to hold the little window on the left- vbox <- Gtk.vBoxNew False 4-- Gtk.set vbox [ Gtk.containerChild := xScalingBox- , Gtk.boxChildPacking xScalingBox := Gtk.PackNatural- , Gtk.containerChild := xRangeBox- , Gtk.boxChildPacking xRangeBox := Gtk.PackNatural- ]-- return vbox------ helper to make an hbox with a label-labeledWidget :: Gtk.WidgetClass a => String -> a -> IO Gtk.HBox-labeledWidget name widget = do- label <- Gtk.labelNew (Just name)- hbox <- Gtk.hBoxNew False 4- Gtk.set hbox [ Gtk.containerChild := label- , Gtk.containerChild := widget- , Gtk.boxChildPacking label := Gtk.PackNatural--- , Gtk.boxChildPacking widget := Gtk.PackNatural- ]- return hbox