-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
1,387 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,28 @@ | ||
pom.xml | ||
pom.xml.asc | ||
*.jar | ||
*.class | ||
/lib/ | ||
/classes/ | ||
/target/ | ||
/checkouts/ | ||
.lein-deps-sum | ||
.lein-repl-history | ||
.lein-plugins/ | ||
.lein-failures | ||
.nrepl-port | ||
.cpcache/ | ||
|
||
node_modules/ | ||
examples/js | ||
test/public/js | ||
|
||
/target | ||
/checkouts | ||
/src/gen | ||
|
||
pom.xml | ||
pom.xml.asc | ||
*.iml | ||
*.jar | ||
*.log | ||
.shadow-cljs | ||
.idea | ||
.lein-* | ||
.nrepl-* | ||
.DS_Store | ||
|
||
.hgignore | ||
.hg/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# Rough-CLJS | ||
|
||
A data-driven, reagent-wrapper for [RoughJS](https://roughjs.com/) | ||
|
||
This library provides a simple reagent component for RoughJS which is a fun library to create diagrams that look hand-drawn. | ||
|
||
See examples below. | ||
|
||
# Installation | ||
|
||
Get it from Clojars: `[monoid/rough-cljs "1.0"]` | ||
|
||
If you are using [Shadow-CLJS](http://shadow-cljs.org/), it will download the JavaScript dependency automatically. | ||
|
||
Otherwise, add RoughJS via NPM: | ||
`$ npm install -D roughjs` | ||
|
||
You will also need reagent 0.10.0 in your project. | ||
|
||
# Usage | ||
|
||
To use it, require it and add it to your hiccup: | ||
|
||
``` | ||
(require '[rough-cljs.core :refer [Rough]]) | ||
(defn MyComponent [] | ||
[:div [Rough {:svg {:width 200 :height 200}} [[:rectangle [10 10 100 100] {:fill "blue"}]]] | ||
``` | ||
|
||
> Note: Only changes to the drawing primitives have any effect when re-drawing this component. | ||
All supported primitives like rectangle, circle etc. have been defined via spec. | ||
(see rough-cljs/spec) | ||
|
||
Check the docstring of `Rough` for more information. | ||
|
||
# Examples | ||
|
||
[This way please!](https://rough-cljs.netlify.com/) | ||
|
||
# Build | ||
|
||
Use shadow-cljs: `$ shadow-cljs watch app` | ||
|
||
# Kudos | ||
|
||
You guys rock: | ||
|
||
- Preet Shihn - Author of [RoughJS](https://roughjs.com/) | ||
- Thomas Heller - for [Shadow-CLJS](http://shadow-cljs.org/). Keeps me sane! | ||
- [Reagent project](https://github.com/reagent-project/reagent) - super powers for React | ||
- And the ClojureScript team of course |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<title>Rough-CLJS Examples</title> | ||
<link rel="stylesheet" href="https://cdn.rawgit.com/Chalarangelo/mini.css/v3.0.1/dist/mini-default.min.css"> | ||
</head> | ||
<body> | ||
<div id="app"> | ||
</div> | ||
<script src="js/compiled/main.js" type="text/javascript"></script> | ||
<script>example.init();</script> | ||
</body> | ||
</html> |
Oops, something went wrong.