https://github.com/nating/interactive-shape-server
An Interactive SVG Shape Haskell Server.
https://github.com/nating/interactive-shape-server
Last synced: 6 days ago
JSON representation
An Interactive SVG Shape Haskell Server.
- Host: GitHub
- URL: https://github.com/nating/interactive-shape-server
- Owner: nating
- License: bsd-3-clause
- Created: 2017-10-31T11:32:22.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-11-27T12:51:48.000Z (over 8 years ago)
- Last Synced: 2025-11-12T08:26:03.768Z (7 months ago)
- Language: Haskell
- Homepage:
- Size: 62 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Interactive Shape Server
An Interactive SVG Shape Server written in Haskell using the [Scotty](https://hackage.haskell.org/package/scotty) & [Blaze-SVG](https://hackage.haskell.org/package/blaze-svg) Web eDSL languages.

## Requirements
This project requires the [Haskell Tool Stack](https://docs.haskellstack.org/en/stable/README/) to run.
To download the Haskell Tool Stack on Unix, you can run:
```
curl -sSL https://get.haskellstack.org/ | sh
```
## Installation
To install The Interactive Shape Server:
* Clone this repository:
```
git clone https://nating/interactive-shape-server.git
```
* Navigate into the repository's folder & setup stack:
```
cd interactive-shape-server && stack setup
```
* Build the project:
```
stack build
```
## Usage
To run the server, use the command:
```
stack exec interactive-shape-server
```
You can now interact with SVG shapes from your browser at `localhost:3000`.
## SVG Shape Description
An index page with a text-area input is served at localhost:3000 by the Interactive Shape Server where you can describe shapes and their styles and transformations.
Accepted input for describing the SVG shapes is to be of the form:
```
'['
'(' Shape ',' Transform ',' Style ')'
{ ',' '(' Shape ',' Transform ',' Style ')' }
']'
```
*Shapes, Transforms and Styles are defined below.*
### Shapes
Supported shapes:
* `Empty`
* `Rect`
* `Circle`
### Transforms
Supported Transforms:
* `Identity`
* `Translate `
* `Scale `
* `Rotate `
* `SkewX `
* `SkewY `
* `Compose () ()`
### Styles
Supported Styles:
* `Fill `
* `FillOpacity `
* `StrokeWidth `
* `StrokeColor `
* `StyleCompose () (<Style>)`
### Colors
Supported Colors:
* `Black`
* `White`
* `Blue`
* `Green`
* `Red`
* `Silver`
* `Gray`
* `Yellow`
* `Maroon`
* `Olive`
* `Lime`
* `Aqua`
* `Teal`
* `Navy`
* `Fuchsia`
* `Purple`