Fork me on GitHub

@ag: yep. i am curious how CLJS/closure modules will integrate into webpack since it seems these two systems both compete in many of the same ways


@johanatan: oh, I think that’s not right though. In my opinion Closure compiler is way more powerful than any compiler/transpiler/bundler available today.


@ag: I agree but webpack is attempting to do the same sort of things.


the only con of Closure compiler that it still needs Java. I wonder if anyone ever attempted to rewrite it completely let’s say in Javascript


it's a lot of .java files. I doubt it.


Hi, First time on slack and clojurians. I'm working on a clojurescript re-frame production-and-consumption_analytics web app; For the purpose of helping to economize resources by analyzing a transaction-history : '(Transaction). Transaction : {(enum :production :consumption) PhysicalQuantity, :timestamp DateTime}. PhysicalQuantity : {:amount Num, :unit Unit}. Unit : [Name {:v Num, :u Dimension}] Name : Str Dimension : [{Fundamental Int} Name] Fundamental : (enum "K" "s" "bit" "dollar" "cd" "kg" "A" "m" "mol")


@ag: how would you integrate with hapi.js (server-side rendering)?


JS noob here. Does anyone familiar with Quil know if you can have animations render in the background of a webpage, like this: ?


So literally evaluating the tech stacks to use for a new project and was wondering does anyone know if there is a recommended approach to making om / clojurescript universal / isomorphic?


Got no answer yesterday, trying again, can I achieve this without having to instantiate a new object? instance? does not work since it makes no difference between and

(defn date?
  "Checks if argument is a"
  (= (type ( (type date)))



(let [date (
      datet (]
  [(= (type date))
   (= (type datet))])
returns [true false]

braai engineer11:07:09

Is it possible to combine a ClojureScript build with a Clojure uberjar build on CircleCI for deployment to Heroku? When I locally run lein cljsbuild … followed by lein uberjar, it overrides my cljs output.


@aengelberg: interesting would need more information about that - probably better to discuss in #C07UQ678E re: re-seq perf


Trying to call a function in a js/object. This works, but breaks in advanced compilation #(.. iframe -contentWindow -location (reload true))


this throws an Illegal invocation error: ((aget iframe "contentWindow" "location" "reload") true)


nvmd, got it :) (.reload (aget iframe "contentWindow" "location") true)


@dnolen: I investigated it some more, it turned out something was really weird with my planck, the garbage collection seemed messed up and it was eating lots of memory. My use case on the Node REPL worked fine. So I know it's not a cljs issue


@aengelberg: k that was going to be my first suggestion - test the behavior under different JS VMs


Hey guys, i'm trying to create a ds3 line Chart from within clojurescript. Does anyone have any pointer. I am failing to .append to an svg Element


Example code?


@exupero: sure, here it is

(defn create-panel-svg []
  [:svg {:id "line-chart" :width 1000 :height 200}])

(def chart-margins {:top 20 :right 20 :bottom 30 :left 50})

(def days ["Mo" "Di" "Mi" "Do" "Fr" "Sa" "So"])

(defn calc-width [base-width {:keys [left right]}]
  (- base-width left right))

(defn calc-height [base-height {:keys [top bottom]}]
  (- base-height top bottom))

(defn calc-x [width ordinal-domain]
  (-> (js/d3.scale.ordinal)
      (.domain (clj->js ["Mo" "Di" "Mi" "Do" "Fr" "Sa" "So"] ))
      (.rangePoints (clj->js [0 width]))))

(defn calc-y [height]
  (-> (js/d3.scale.linear)
      (.range (clj->js [height 0]))
      (.domain (clj->js [0 500]))))

(defn calculate-axis [axis-def orientation]
  (-> (js/d3.svg.axis)
      (.scale (clj->js axis-def))
      (.orient (clj->js orientation))))

(defn append-to-svg-g [id width height axis margins axis-def]
  (let [translate-val (if (= axis-def :y)
                        (:left margins)
                        (- height (:bottom margins)))]
  (-> (js/ (clj->js [(str "#" id)  width height margins]) )
      (.append (clj->js ["svg:g" ]))
      (.attr (clj->js ["transform" (str "translate(" translate-val "),0")])
      (.call (clj->js axis))))))

(defn create-line-chart [base-width base-height id]
  (let [height (calc-height base-height chart-margins)
        width (calc-width base-width chart-margins)
        y-scale (calc-y height)
        x-scale (calc-x width days)
        y-axis (calculate-axis y-scale "left")
        x-axis (calculate-axis x-scale "bottom")]
    (append-to-svg-g id width height x-axis chart-margins :x)
    (append-to-svg-g id width height y-axis chart-margins :y)))


@exupero: that's the relevant part where it throws the error

function d3_selection_creator(name) {
    function create() {
      var document = this.ownerDocument, namespace = this.namespaceURI;
      return namespace === d3_nsXhtml && document.documentElement.namespaceURI === d3_nsXhtml ? document.createElement(name) : document.createElementNS(namespace, name);
    function createNS() {
      return this.ownerDocument.createElementNS(, name.local);


It looks like you’re passing arrays to D3 methods in places I wouldn’t expect. I think you just need (.append “svg:g”). Also seems odd to pass arrays to and .attr.


Ok, to be honest that was desperate experimenting. I'll try without 😁


ok, now it's working, but i don't see anything.. nothing get's rendered and append doesn't seem to append anything


<svg id="line-chart" width="1000" height="200" data-reactid="."></svg> 


there is no svg g


You need an .enter with some data to render. Take a look at a simple D3 example in plain JS. It translates fairly easily to ClojureScript once you know how to use D3.


I just wanted to See if it renders the x and y axis


Didn't know there was a need for Data just yet


.select needs data.


i setup bidi and accountant so that I get URL routing with automatic preventDefault. I'm using react bootstrap pagination widget that uses A tags with onClick events when the pagination 'buttons' are clicked. I'm seeing a navigation event everytime these pagination buttons are clicked, but the href is undefined, so the nagivation event is to the exact same page that we're already on. Which makes it a totally useless navigation event. How can I prevent these events?


@exupero thanks, will try with test Data


@dev-hartmann: It’s been a while since I’ve used D3, so you’ll have to look at the docs to be sure. I would sort out what you’re doing in plain JS first.


is there a guide on how to use the editor? I've never used paredit or its variants and I'm finding it a bit difficult to figure out.


ahhh, looks like tabs are important. that helps a lot.


@jjfine it is actually Parinfer, plenty of examples here:


Does anyone know how to bundle css with clojurescript? Like in JS world, one can use webpack to bundle css and js to generate one single js file, which would insert css as string to html page. All they need to do is require the css file.