The blank-canvas package

[Tags: bsd3, library]

blank-canvas is a Haskell binding to the complete HTML5 Canvas API. blank-canvas allows Haskell users to write, in Haskell, interactive images onto their web browsers. blank-canvas gives the user a single full-window canvas, and provides many well-documented functions for rendering images.

{-# LANGUAGE OverloadedStrings #-}
module Main where
import Graphics.Blank                     -- import the blank canvas

main = blankCanvas 3000 $ \ context -> do -- start blank canvas on port 3000
  send context $ do                       -- send commands to this specific context
    moveTo(50,50)
    lineTo(200,100)
    lineWidth 10
    strokeStyle "red"
    stroke()                              -- this draws the ink into the canvas

For more details, read the blank-canvas wiki.


[Skip to ReadMe]

Properties

Versions0.2.0, 0.2.0.1, 0.2.2, 0.2.3, 0.2.3.1, 0.2.3.2, 0.3.1, 0.4.0, 0.5, 0.6
Change logChangelog.md
Dependenciesaeson (>=0.7 && <0.12), base (>=4.6 && <4.9), base-compat (>=0.8.1 && <1), base64-bytestring (==1.0.*), bytestring (==0.10.*), colour (>=2.2 && <3.0), containers (==0.5.*), data-default-class (==0.0.*), http-types (>=0.8 && <0.10), kansas-comet (==0.4.*), mime-types (>=0.1.0.3 && <0.2), scotty (>=0.10 && <0.12), stm (>=2.2 && <2.5), text (>=1.1 && <1.3), text-show (>=2 && <4), transformers (>=0.3 && <0.5), vector (>=0.10 && <0.12), wai (==3.*), wai-extra (>=3.0.1 && <3.1), warp (==3.*) [details]
LicenseBSD3
CopyrightCopyright (c) 2014 The University of Kansas
AuthorAndy Gill and Ryan Scott
Maintainerandygill@ku.edu
StabilityBeta
CategoryGraphics
Home pagehttps://github.com/ku-fpg/blank-canvas/wiki
Bug trackerhttps://github.com/ku-fpg/blank-canvas/issues
Source repositoryhead: git clone git://github.com/ku-fpg/blank-canvas.git
UploadedFri Dec 4 22:30:08 UTC 2015 by AndyGill
UpdatedMon Feb 8 23:50:17 UTC 2016 by ryanglscott to revision 3
DistributionsLTSHaskell:0.6, NixOS:0.6, Stackage:0.6
Downloads2313 total (30 in last 30 days)
Votes
0 []
StatusDocs available [build log]
Last success reported on 2015-12-10 [all 1 reports]

Modules

[Index]

Downloads

Maintainers' corner

For package maintainers and hackage trustees

Readme for blank-canvas-0.6

Background

blank-canvas is a Haskell binding to the complete HTML5 Canvas API. blank-canvas allows Haskell users to write, in Haskell, interactive images onto their web browsers. blank-canvas gives the user a single full-window canvas, and provides many well-documented functions for rendering images.

First Example

{-# LANGUAGE OverloadedStrings #-}
module Main where

import Graphics.Blank                     -- import the blank canvas

main = blankCanvas 3000 $ \ context -> do -- start blank canvas on port 3000
        send context $ do                 -- send commands to this specific context
                moveTo(50,50)
                lineTo(200,100)
                lineWidth 10
                strokeStyle "red"
                stroke()                  -- this draws the ink into the canvas

Running this program, and going to http://localhost:3000/ gives

images/Red_Line.png

For more details about this example, see Red Line.

Documentation

| Link | Notes | |-------|-------| | Examples | Various complete examples of using blank-canvas | | Installation | How to install blank-canvas | | Hackage | Current release is 0.5 | | API | Discussion of API, compared with the original JavaScript API | | Canvas Examples | Transliterated from http://www.html5canvastutorials.com/ into Haskell and blank-canvas, with kind permission of Eric Rowell, author of the JavaScript HTML5 Canvas Tutorial. | | FAQ | F.A.Q. |

Other Links

Credits

Thank you to Eric Rowell, for allowing blank-canvas to base our Canvas examples on his JavaScript Canvas examples.

The "Haskell" picture is taken by Mandy Lackey, from link <http://www.flickr.com/photos/77649176@N00/3776224595/.> This picture allows sharing, under the creative commons license.