aivika-experiment-diagrams (empty) → 1.3
raw patch · 4 files changed
+114/−0 lines, 4 filesdep +Chartdep +Chart-diagramsdep +aivika-experimentsetup-changed
Dependencies added: Chart, Chart-diagrams, aivika-experiment, aivika-experiment-chart, base, containers, filepath
Files
- LICENSE +30/−0
- Setup.lhs +3/−0
- Simulation/Aivika/Experiment/DiagramsRenderer.hs +44/−0
- aivika-experiment-diagrams.cabal +37/−0
+ LICENSE view
@@ -0,0 +1,30 @@+Copyright (c) 2012, 2013, 2014 David Sorokin <david.sorokin@gmail.com>++All rights reserved.++Redistribution and use in source and binary forms, with or without+modification, are permitted provided that the following conditions+are met:++1. Redistributions of source code must retain the above copyright+ notice, this list of conditions and the following disclaimer.++2. Redistributions in binary form must reproduce the above copyright+ notice, this list of conditions and the following disclaimer in the+ documentation and/or other materials provided with the distribution.++3. Neither the name of the author nor the names of his contributors+ may be used to endorse or promote products derived from this software+ without specific prior written permission.++THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE+ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF+SUCH DAMAGE.
+ Setup.lhs view
@@ -0,0 +1,3 @@+#!/usr/bin/env runhaskell+> import Distribution.Simple+> main = defaultMain
+ Simulation/Aivika/Experiment/DiagramsRenderer.hs view
@@ -0,0 +1,44 @@++-- |+-- Module : Simulation.Aivika.Experiment.DiagramsRenderer+-- Copyright : Copyright (c) 2012-2014, David Sorokin <david.sorokin@gmail.com>+-- License : BSD3+-- Maintainer : David Sorokin <david.sorokin@gmail.com>+-- Stability : experimental+-- Tested with: GHC 7.6.3+--+-- This module defines a renderer that uses the Chart-diagrams library+-- for rendering charts with simulation results, i.e. without using Cairo,+-- which can be suitable for MS Windows.+--++module Simulation.Aivika.Experiment.DiagramsRenderer+ (DiagramsRenderer(..)) where++import System.FilePath+import Data.Map++import Graphics.Rendering.Chart+import Graphics.Rendering.Chart.Backend.Diagrams++import Simulation.Aivika.Experiment+import Simulation.Aivika.Experiment.Chart++-- | This renderer uses the Chart-diagrams library for rendering charts with simulation results.+data DiagramsRenderer =+ DiagramsRenderer { rendererFileFormat :: FileFormat,+ -- ^ It returns the file format used for saving the image.+ rendererCustomFonts :: Map (String, FontSlant, FontWeight) FilePath+ -- ^ It contains the custom fonts.+ }++instance FileRenderer DiagramsRenderer++instance ChartRenderer DiagramsRenderer where++ renderableFileExtension (DiagramsRenderer EPS _) = ".eps"+ renderableFileExtension (DiagramsRenderer SVG _) = ".svg"+ renderableFileExtension (DiagramsRenderer SVG_EMBEDDED _) = ".svg"+ + renderChart (DiagramsRenderer format fonts) (width, height) =+ renderableToFile (FileOptions (fromIntegral width, fromIntegral height) format fonts)
+ aivika-experiment-diagrams.cabal view
@@ -0,0 +1,37 @@+name: aivika-experiment-diagrams+version: 1.3+synopsis: Diagrams backend for the Aivika simulation library+description:+ This package complements the Aivika and Aivika Experiment packages + and it allows rendering the charts using the Chart-diagrams library,+ i.e. without using Cairo, which can be suitable for MS Windows.+ .+category: Simulation+license: BSD3+license-file: LICENSE+copyright: (c) 2012-2014. David Sorokin <david.sorokin@gmail.com>+author: David Sorokin+maintainer: David Sorokin <david.sorokin@gmail.com>+homepage: http://github.com/dsorokin/aivika-experiment-diagrams+cabal-version: >= 1.6+build-type: Simple+tested-with: GHC == 7.6.3++library++ exposed-modules: Simulation.Aivika.Experiment.DiagramsRenderer++ build-depends: base >= 3 && < 6,+ containers >= 0.4.0.0,+ filepath >= 1.3.0.0,+ Chart >= 1.2,+ Chart-diagrams >= 1.2,+ aivika-experiment >= 1.3,+ aivika-experiment-chart >= 1.3++ ghc-options: -O2++source-repository head++ type: git+ location: https://github.com/dsorokin/aivika-experiment-diagrams