This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-07-06
Channels
- # admin-announcements (2)
- # boot (51)
- # bristol-clojurians (1)
- # capetown (14)
- # cider (4)
- # cljs-dev (3)
- # cljsrn (23)
- # clojure (76)
- # clojure-gamedev (2)
- # clojure-germany (2)
- # clojure-greece (2)
- # clojure-hk (5)
- # clojure-poland (1)
- # clojure-quebec (3)
- # clojure-russia (19)
- # clojure-spec (7)
- # clojure-sweden (10)
- # clojure-uk (77)
- # clojurescript (42)
- # clojurex (5)
- # core-async (40)
- # cursive (12)
- # datomic (58)
- # editors (1)
- # events (1)
- # heroku (1)
- # hoplon (4)
- # jobs (6)
- # jobs-discuss (1)
- # ldnclj (2)
- # lein-figwheel (1)
- # leiningen (5)
- # om (66)
- # onyx (51)
- # other-languages (80)
- # proton (20)
- # protorepl (12)
- # quil (3)
- # re-frame (3)
- # reagent (18)
- # spacemacs (14)
- # untangled (78)
- # yada (16)
@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.
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
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")
@jjunior130: try #C073DKH9P
JS noob here. Does anyone familiar with Quil know if you can have animations render in the background of a webpage, like this: http://p5js.org/ ?
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 goog.date.Date
and goog.date.DateTime
.
(defn date?
"Checks if argument is a goog.date.Date"
[date]
(= (type (goog.date.Date.)) (type date)))
(let [date (goog.date.Date.)
datet (goog.date.DateTime.)]
[(= goog.date.Date (type date))
(= goog.date.Date (type datet))])
returns [true false]
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)
@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
@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/d3.select (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 d3.inc.js 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.space, 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 d3.select
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=".0.0.2.0.1.2.0"></svg>
there is no svg g
any ideas?
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
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 http://cljsfiddle.com editor? I've never used paredit or its variants and I'm finding it a bit difficult to figure out.
@jjfine it is actually Parinfer, plenty of examples here: https://shaunlebron.github.io/parinfer/