Skip to content

Commit

Permalink
Re-commit of v2.0.0. Previous commit not complete.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kwarrtz committed Jan 2, 2017
1 parent 2cdab81 commit 2ff9101
Show file tree
Hide file tree
Showing 3 changed files with 466 additions and 548 deletions.
47 changes: 28 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,42 @@
# Graphics.Render

Graphics.Render is a lightweight graphics library for Elm. It is intended primarily to
replace the hole left by the deprecation of Graphics.Collage. The API of Graphics.Render
is similar to that of the older library, so it should feel familiar, to those who have
used it before. However, there are a few major changes to be aware of between
this library and Graphics.Collage. Most notably, the origin of the coordinate system of the
render library is positioned at the center of the viewbox, rather than the top left corner,
and render compiles to SVG rather the HTML5 canvas. For more in depth documentation, take a
look at the documentation for the
[Graphics.Render module](http://package.elm-lang.org/packages/Kwarrtz/render/1.0.0/Graphics-Render).

NOTE THAT THIS LIBRARY IS STILL VERY MUCH EXPERIMENTAL, AND THE API IS SUBJECT TO CHANGE.
Graphics.Render is a lightweight graphics library for Elm. It is intended primarily to
replace the hole left by the deprecation of Graphics.Collage. The API of Graphics.Render
is similar to that of the older library, so it should feel familiar, to those who have
used it before. However, there are a few major changes to be aware of between this library
and Graphics.Collage. Most notably that it currently compiles to SVG rather the HTML5 canvas
(although support for this latter option is planned). For more in depth documentation, take a
look at the documentation for the [Graphics.Render module](http://package.elm-lang.org/packages/Kwarrtz/render/latest/Graphics-Render).

My life has suddenly become much busier than it was when I started this project, so I doubt I will be
able to devote much time to it in the coming months. Still, if you notice any outstanding issues
feel free to open an issue, and I will try to get to it when I can.

NOTE THAT THIS LIBRARY IS STILL VERY EXPERIMENTAL, AND ITS API IS SUBJECT TO CHANGE.

## Notes for v2.x.x

As of version 2.0.0, positions are now from the top left hand corner of the viewport rather than the center. There are several other major changes to the API from version 1.x.x. For more details, take a look at [the
documentation](http://package.elm-lang.org/packages/Kwarrtz/render/latest/Graphics-Render).

## Examples

The following Elm code draws a blue ellipse with a black border.
The following Elm code draws a blue ellipse with a black border at position (100,100) in a
500x500 SVG viewport.

import Graphics.Render as Render
import Graphics.Render exposing (ellipse, filledAndBordered, position, svg)
import Color exposing (rgb)

main = Render.ellipse 150 150
|> Render.solidFillWithBorder (rgb 0 0 255) 5 (rgb 0 0 0)
|> Render.svg 500 500

main = ellipse 150 150
|> filledAndBordered (solid <| rgb 0 0 255)
5 (solid <| rgb 0 0 0)
|> position (100,100)
|> svg 500 500

## TODO

* Gradient fills
* Paths and arcs
* Apply for Elm native JS whitelist
* HTML5 canvas support
* Add examples
* Improve documentation
12 changes: 6 additions & 6 deletions elm-package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.0.1",
"version": "2.0.0",
"summary": "Lightweight graphics similar to Graphics.Collage (backed by SVG)",
"repository": "https://github.com/Kwarrtz/render.git",
"license": "BSD3",
Expand All @@ -11,10 +11,10 @@
"Graphics.Render"
],
"dependencies": {
"elm-lang/core": "4.0.0 <= v < 4.0.5",
"elm-lang/html": "1.1.0 <= v < 2.0.0",
"elm-lang/svg": "1.1.0 <= v < 2.0.0",
"jergason/elm-hash": "1.0.0 <= v < 2.0.0"
"elm-lang/core": "5.0.0 <= v < 6.0.0",
"elm-lang/html": "2.0.0 <= v < 3.0.0",
"elm-lang/svg": "2.0.0 <= v < 3.0.0",
"elm-lang/virtual-dom": "2.0.0 <= v < 3.0.0"
},
"elm-version": "0.17.0 <= v < 0.18.0"
"elm-version": "0.18.0 <= v < 0.19.0"
}
Loading

0 comments on commit 2ff9101

Please sign in to comment.