Last active
August 29, 2015 14:24
-
-
Save henrygarner/d41e02ba3662aef88c69 to your computer and use it in GitHub Desktop.
barebones.core.cljs
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
(ns ^:figwheel-always barebones.core | |
(:require [om.core :as om :include-macros true] | |
[om.dom :as dom :include-macros true] | |
[reagent.core :as r] | |
[b1.charts :as c] | |
[b1.svg :as s])) | |
(enable-console-print!) | |
(def data (take 100 (repeatedly rand))) | |
(println "Edits to this text should show up in your developer console.") | |
;; define your app data so that it doesn't get over-written on reload | |
(defonce app-state (r/atom {:text "Hello world!" | |
:data data})) | |
(defn run [] | |
(r/render-component | |
[:div | |
[:h1 "Hello world!"] | |
(-> (c/histogram (get @app-state :data) :x-axis [0 1] :bins 20) | |
(s/as-svg :width 500 :height 200))] | |
(.getElementById js/document "app"))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment