All Projects → beders → rough-cljs

beders / rough-cljs

Licence: MIT license
A data-driven, reagent wrapper for RoughJS

Programming Languages

clojure
4091 projects

Projects that are alternatives of or similar to rough-cljs

re-frame-routing
ClojureScript (re-frame) library that manages routing and route state.
Stars: ✭ 16 (+0%)
Mutual labels:  clojurescript-library
sitefox
Node + cljs backend web framework
Stars: ✭ 180 (+1025%)
Mutual labels:  clojurescript-library
threeagent
ClojureScript library for building Three.js apps in a reagent-like fashion
Stars: ✭ 124 (+675%)
Mutual labels:  clojurescript-library

Rough-CLJS

A data-driven, reagent-wrapper for RoughJS

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

Clojars Project

Get it from Clojars: [monoid/rough-cljs "1.0"]

If you are using Shadow-CLJS, 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!

Build

Use shadow-cljs: $ shadow-cljs watch app

Kudos

You guys rock:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].