packages feed

hgg-svg-0.1.0.0: hgg-svg.cabal

cabal-version:      3.0
name:               hgg-svg
version:            0.1.0.0
extra-doc-files:    CHANGELOG.md
synopsis:           SVG backend for hgg (pure Haskell)
description:
  Browser-independent SVG output backend for hgg, written in pure
  Haskell. This is the backend most users go through to generate plots.
license:            BSD-3-Clause
homepage:           https://github.com/frenzieddoll/hgg
license-file:       LICENSE
author:             Toshiaki Honda
maintainer:         frenzieddoll@gmail.com
copyright:          2026 Aelysce Project (Toshiaki Honda)
category:           Graphics
build-type:         Simple

common warnings
  ghc-options:        -Wall -Wcompat -Widentities -Wincomplete-record-updates
                      -Wincomplete-uni-patterns -Wpartial-fields
                      -Wredundant-constraints

library
  import:           warnings
  exposed-modules:  Graphics.Hgg.Backend.SVG
                    Graphics.Hgg.Quick
  hs-source-dirs:   src
  build-depends:    base               >= 4.17 && < 5
                  , text               >= 2.0  && < 2.2
                  , vector             >= 0.13 && < 0.14
                  , hgg-core  ^>= 0.1
                  , hgg-frame ^>= 0.1
  default-language: Haskell2010

executable scatter-demo
  import:           warnings
  main-is:          ScatterDemo.hs
  hs-source-dirs:   examples
  build-depends:    base               >= 4.17 && < 5
                  , text
                  , vector
                  , hgg-core
                  , hgg-svg
  default-language: Haskell2010

executable custom-mark-demo
  import:           warnings
  main-is:          CustomMarkDemo.hs
  hs-source-dirs:   examples
  build-depends:    base               >= 4.17 && < 5
                  , vector
                  , hgg-core
                  , hgg-svg
  default-language: Haskell2010

executable vega-lite-gallery
  import:           warnings
  main-is:          VegaLiteGallery.hs
  hs-source-dirs:   examples
  build-depends:    base               >= 4.17 && < 5
                  , vector
                  , directory
                  , hgg-core
                  , hgg-svg
  default-language: Haskell2010

executable df-plot-demo
  import:           warnings
  main-is:          DfPlotDemo.hs
  hs-source-dirs:   examples
  build-depends:    base               >= 4.17 && < 5
                  , containers
                  , directory
                  , text
                  , vector
                  , hgg-core
                  , hgg-frame
                  , hgg-svg
  default-language: Haskell2010

executable gallery-demo
  import:           warnings
  main-is:          GalleryDemo.hs
  hs-source-dirs:   examples
  build-depends:    base               >= 4.17 && < 5
                  , text
                  , vector
                  , directory
                  , aeson
                  , bytestring
                  , hgg-core
                  , hgg-svg
  default-language: Haskell2010

executable dag-comparison-demo
  import:           warnings
  main-is:          DagComparisonDemo.hs
  hs-source-dirs:   examples
  build-depends:    base               >= 4.17 && < 5
                  , text
                  , hgg-core
                  , hgg-svg
  default-language: Haskell2010

executable dag-parity-bench
  import:           warnings
  main-is:          DagParityBench.hs
  hs-source-dirs:   examples
  -- Safety net: cap the heap at 2.5G so a runaway case fails with a clean
  -- GHC RTS "heap overflow" exception instead of exhausting system memory.
  ghc-options:      -rtsopts "-with-rtsopts=-M2500m"
  build-depends:    base               >= 4.17 && < 5
                  , text
                  , directory
                  , hgg-core
                  , hgg-svg
  default-language: Haskell2010

executable json-dump
  import:           warnings
  main-is:          JsonDump.hs
  hs-source-dirs:   examples
  build-depends:    base               >= 4.17 && < 5
                  , bytestring
                  , aeson
                  , hgg-core
  default-language: Haskell2010

-- Runnable examples for the docs/ tutorials (referenced from docs/getting-started.md / api-guide.md)
executable tutorial-01-easy
  import:           warnings
  main-is:          Tutorial01Easy.hs
  hs-source-dirs:   examples
  build-depends:    base >= 4.17 && < 5, hgg-core, hgg-svg
  default-language: Haskell2010

executable tutorial-02-grammar
  import:           warnings
  main-is:          Tutorial02Grammar.hs
  hs-source-dirs:   examples
  build-depends:    base >= 4.17 && < 5, text, hgg-core, hgg-svg
  default-language: Haskell2010

executable tutorial-03-overlay
  import:           warnings
  main-is:          Tutorial03Overlay.hs
  hs-source-dirs:   examples
  build-depends:    base >= 4.17 && < 5, hgg-core, hgg-svg
  default-language: Haskell2010

executable tutorial-04-distribution
  import:           warnings
  main-is:          Tutorial04Distribution.hs
  hs-source-dirs:   examples
  build-depends:    base >= 4.17 && < 5, text, hgg-core, hgg-svg
  default-language: Haskell2010

executable tutorial-05-theme
  import:           warnings
  main-is:          Tutorial05Theme.hs
  hs-source-dirs:   examples
  build-depends:    base >= 4.17 && < 5, text, hgg-core, hgg-svg
  default-language: Haskell2010

-- Generates the figures embedded in docs/ (cabal run doc-figures, from the repo root)
executable doc-figures
  import:           warnings
  main-is:          DocFigures.hs
  hs-source-dirs:   examples
  other-modules:    DocFig.Common
                  , DocFig.Quickstart
                  , DocFig.Layers
                  , DocFig.EncodingScale
                  , DocFig.Decoration
  build-depends:    base >= 4.17 && < 5, text, vector, directory, hgg-core, hgg-svg
  default-language: Haskell2010

-- Smoke test for BoundPlot (df |>> spec) → SVG. Lives here rather than in
-- frame:test because cabal would see frame <-> svg as a package cycle.
test-suite hgg-svg-tests
  import:           warnings
  type:             exitcode-stdio-1.0
  main-is:          Spec.hs
  hs-source-dirs:   test
  build-depends:    base               >= 4.17 && < 5
                  , text
                  , vector
                  , containers
                  , hgg-core
                  , hgg-frame
                  , hgg-svg
                  , hspec      >= 2.10 && < 2.12
  default-language: Haskell2010