This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-05-27
Channels
- # announcements (3)
- # babashka (35)
- # babashka-sci-dev (42)
- # beginners (27)
- # calva (7)
- # clj-kondo (18)
- # cljs-dev (1)
- # clojure (40)
- # clojure-europe (141)
- # clojure-nl (1)
- # clojure-norway (6)
- # clojure-uk (40)
- # clojurescript (15)
- # community-development (4)
- # cursive (54)
- # events (1)
- # fulcro (8)
- # helix (5)
- # hyperfiddle (22)
- # introduce-yourself (6)
- # jobs (3)
- # joyride (26)
- # lsp (7)
- # music (1)
- # nbb (7)
- # off-topic (28)
- # pathom (120)
- # pedestal (3)
- # podcasts-discuss (2)
- # portal (2)
- # rdf (2)
- # releases (20)
- # rewrite-clj (9)
- # shadow-cljs (26)
- # spacemacs (1)
- # sql (13)
- # vim (10)
- # xtdb (63)
https://ej2.syncfusion.com/react/demos/#/bootstrap5/chart/line I'm trying to translate this code into helix, but only grid is showing and lines for data1 and data2 are not showing.
cljs vectors (created using []
syntax) and maps (created using {}
syntax) are not the same as JS arrays and objects
💯 1
so your data1
and data2
are created using CLJS vectors and maps and the chart components probably don't know how to read them
💯 1
you can write JS arrays and objects using the #js
reader tag, e.g.
(def data1
#js [#js {:x (js/Date. 2005 0 1) :y 21}
#js {:x (js/Date. 2006 0 1) :y 24}
#js {:x (js/Date. 2007 0 1) :y 36}
#js {:x (js/Date. 2008 0 1) :y 38}
#js {:x (js/Date. 2009 0 1) :y 54}
#js {:x (js/Date. 2010 0 1) :y 57}
#js {:x (js/Date. 2011 0 1) :y 70}])
💯 1
Thanks, It works. I also had to do similar to the CLJS vector of services:
($ Inject {:services #js [LineSeries, DateTime, Legend, Tooltip]})
1
🙌 1