Skip to content

Instantly share code, notes, and snippets.

@mooreryan
Last active October 10, 2019 02:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mooreryan/6fea3126b65f5b9d999b2ed7b5e2d525 to your computer and use it in GitHub Desktop.
Save mooreryan/6fea3126b65f5b9d999b2ed7b5e2d525 to your computer and use it in GitHub Desktop.
(ns cljs_reagent_proj.core
(:require
[reagent.core :as r]
[cljsjs.react-vis :as rvis]))
(def chart-data [{:x 1 :y 1}
{:x 2 :y 2}
{:x 3 :y 4}
{:x 4 :y 5}
{:x 5 :y 4}
{:x 6 :y 6}
{:x 7 :y 8}
{:x 8 :y 6}
{:x 9 :y 5}
{:x 10 :y 5}])
(defn line-chart [data]
[:> rvis/XYPlot
{:width 800 :height 225}
[:> rvis/LineSeries {:data data}]])
(defn app-scaffold []
[:div
[line-chart chart-data]])
(defn render-app []
(r/render [app-scaffold]
(.getElementById js/document "app")))
(render-app)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment