Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/kimim/re-echarts

React ECharts for ClojureScript
https://github.com/kimim/re-echarts

Last synced: 6 days ago
JSON representation

React ECharts for ClojureScript

Awesome Lists containing this project

README

        

[[https://clojars.org/re-echarts][https://clojars.org/re-echarts/latest-version.svg]]

[[https://www.npmjs.com/package/echarts][https://img.shields.io/npm/v/echarts.svg]]

Example project: [[./example]]

#+begin_src clojure
(ns starter.browser
(:require
[reagent.dom :as rdom]
[re-echarts.core :refer [ECharts]]))

(defn myechart []
[:> ECharts
{:style {:width "800px" :height "600px"}
:theme "dark"
:option
{:title {:text "Echarts is here"}
:dataset {:dimention [:Week :Value]
:source [{:Week "Mon" :Value 820} {:Week "Tue" :Value 932} {:Week "Wed" :Value 901}
{:Week "Thu" :Value 934} {:Week "Fri" :Value 1220} {:Week "Sat" :Value 820}
{:Week "Sun" :Value 990}]}
:xAxis {:type "category"}
:yAxis {:type "value"}
:series [{:type "line"
:smooth true}]}}])

(defn ^:dev/after-load start []
(js/console.log "start")
(rdom/render [#'myechart] (.getElementById js/document "app")))

(defn ^:export init []
(js/console.log "init")
(start))

(defn ^:dev/before-load stop []
(js/console.log "stop"))
#+end_src

* Deps:
- https://github.com/thheller/shadow-cljs
- https://clojurescript.org/news/news
- https://github.com/facebook/react
- https://github.com/reagent-project/reagent
- https://github.com/apache/echarts