-- |
-- Module      : Graphics.BarChart
-- Copyright   : Sebastian Fischer
-- License     : BSD3
-- Maintainer  : Sebastian Fischer <mailto:sebf@informatik.uni-kiel.de>
-- Stability   : experimental
-- This library provides functions and data type for generating bar
-- charts, for example, from CSV files. If the functionality provided
-- by the command-line program is insufficient for your needs, you can
-- use the API provided by this library to draw custom bar charts.
-- The library provides high-level functions to generate bar-chart
-- values from different types but also exports the underlying
-- datatype and all functions used for rendering such that you have
-- access to all internal details.
module Graphics.BarChart (

  -- * Reading from CSV files

  -- | There are three different modes for parsing simple CSV files:
  --   treating different values in one row as blocks of one bar,
  --   treating them as deviations from a mean value, or both. 

  -- ** Writing images

  -- | The following three functions implement these modes parsing the
  --   input from a CSV file and producing output in an image file.

  writeMultiBarChart, writeIntervalChart, writeMultiBarIntervalChart,

  Config(..), Label,

  -- ** Creating bar charts

  -- | The previous functions use the following helper functions to
  --   create a 'BarChart' from a CSV file.

  multiBarChart, intervalChart, multiBarIntervalChart,


  -- ** Bar chart representations

  -- | The three different parsing modes are reflected by three data
  --   types that can be parsed from a CSV file.

  MultiBars(..), parseMultiBars, drawMultiBars,
  Intervals(..), parseIntervals, drawIntervals,
  MultiBarIntervals(..), parseMultiBarIntervals, drawMultiBarIntervals,

  -- | When you have multiple CSV files representing an interval
  --   chart, you can merge them to a single multi-bar interval
  --   chart. Such charts can be flipped such that bars and blocks
  --   change their roles.

  mergeIntervals, flipMultiBarIntervals,

  -- | Bar charts are represented as values of type 'BarChart' @a@.

  BarChart(..), Bar(..), Block(..),

  -- * Rendering

  -- | Values of type 'BarChart' @a@ can be rendered to PNG, SVG, PDF,
  --   and PS files.

  render, renderWith, conf,

  -- ** Creating diagrams

  -- | Bar charts are rendered by conversion into 'Diagram's.


  -- * Benchmarking visualisation

  -- | There are special functions for parsing data generated by the
  --   benchmarking tools criterion and progression.

  -- ** Criterion

  writeCriterionChart, writeComparisonChart,
  criterionChart, comparisonChart,

  -- ** Progression

  writeProgressionChart, progressionChart,

  ) where

import Graphics.BarChart.Types
import Graphics.BarChart.Rendering
import Graphics.BarChart.Parser
import Graphics.BarChart.Parser.Criterion
import Graphics.BarChart.Parser.Progression