ghci viewer for OS X

I am planning to write a library to prototype signal processing algorithms with Haskell (speech, acoustic ...). The first missing block is plotting.

So, I wrote a very quick-and-dirty solution which is enough for me and may be useful to others even if it is very preliminary.

It is made of two parts. An OS X application with is just a PDF viewer listening on port 9000. The displayed PDF can be saved and the window can be rescaled or switched to full screen. I am naming this app hViewer. You can get it on github

The second part is a small set of Haskell files that you can get on github. One of the files is used to communicate with the hViewer and generate a compressed PDF stream.

Another file is defining the Displayable class. The values which can be displayed : they can be converted into a Draw() value from the HPDF package.

And, as an example, I am providing an implementation of plotting for signals with a few settings.

Some tests are available in the file Test.hs. Just load it into ghci, type testt to generate a plot of the signals and testf to generate a plot of the spectrum. The hViewer must be running.

Here is the result:

So, why PDF ? First, because it is the standard format on OS X and I can easily generate it with my HPDF Haskell library. Second, because the pictures look great and I have a good control on the typesetting which is useful to position labels, wrap text ...

And, PDF can be easily imported into a TeX document.

blog comments powered by Disqus