diagrams-canvas: HTML5 canvas backend for diagrams drawing EDSL

[ bsd3, graphics, library ] [ Propose Tags ] [ Report a vulnerability ]

This package provides a modular backend for rendering diagrams created with the diagrams EDSL using an HTML5 canvas.


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.2, 0.2.0.1, 0.2.0.2, 0.2.0.3, 0.3, 0.3.0.1, 0.3.0.2, 0.3.0.3, 0.3.0.4, 1.3, 1.3.0.1, 1.3.0.2, 1.3.0.3, 1.3.0.4, 1.3.0.5, 1.3.0.6, 1.3.0.7, 1.4, 1.4.1, 1.4.1.1, 1.4.1.2, 1.4.2
Change log CHANGELOG.md
Dependencies base (>=4.13 && <4.21), blank-canvas (>=0.5 && <0.8), cmdargs (>=0.6 && <0.11), containers (>=0.3 && <0.8), data-default (>=0.8 && <0.9), diagrams-core (>=1.3 && <1.6), diagrams-lib (>=1.3 && <1.5), lens (>=4.0 && <5.4), mtl (>=2.0 && <2.4), NumInstances (>=1.0 && <1.5), optparse-applicative (>=0.13 && <0.19), statestack (>=0.2 && <0.4), text (>=1.0 && <2.2) [details]
Tested with ghc ==8.8.4 || ==8.10.7 || ==9.0.2 || ==9.2.8 || ==9.4.8 || ==9.6.5 || ==9.8.2 || ==9.10.1
License BSD-3-Clause
Author Jeffrey Rosenbluth, Ryan Yates, Brent Yorgey, Andy Gill, Daniel Bergey
Maintainer diagrams-discuss@googlegroups.com
Category Graphics
Home page https://diagrams.github.io/
Bug tracker http://github.com/diagrams/diagrams-canvas/issues
Source repo head: git clone https://github.com/diagrams/diagrams-canvas.git
Uploaded by BrentYorgey at 2024-10-30T21:35:57Z
Distributions LTSHaskell:1.4.1.2, NixOS:1.4.1.2, Stackage:1.4.2
Reverse Dependencies 2 direct, 25 indirect [details]
Downloads 15681 total (69 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2024-10-30 [all 1 reports]

Readme for diagrams-canvas-1.4.2

[back to package description]

diagrams-canvas

diagrams-canvas is a canvas backend for diagrams based on the blank-canvas https://github.com/ku-fpg/blank-canvas package. Diagrams is a powerful, flexible, declarative domain-specific language for creating vector graphics, using the Haskell programming language. It supports most features defined in diagrams-lib.

Installation

cabal update && cabal install diagrams-canvas

Usage

A simple example that uses diagrams-canvas to draw a square.

import Diagrams.Prelude
import Diagrams.Backend.Canvas.CmdLine

b1 = (square 20 :: Diagram B) # lw 0.002

main = mainWith (pad 1.1 b1)

Save this to file named Square.hs and compile this program:

ghc --make -threaded Square.hs

This will generate an executable which, when run dispays the resulting diagrams to http://localhost:3000/

$ ./Square -w 750