Fork me on GitHub
#clojurescript
<
2020-06-13
>
ikitommi07:06:19

@thheller so it seems. Didn't know that. Thanks.

ikitommi07:06:24

What is a good way to see the effects/results of dce?

ikitommi07:06:07

...besides looking at the generated code size

thheller08:06:30

@ikitommi besides build reports I relatively often look at shadow-cljs release app --pseudo-names output when I'm trying to optimize code in a way. I'm quite used to reading the generated JS by now so I can usually spot things that could have been removed or otherwise shortened.

thheller08:06:15

the closure-compiler has an option to print the output after every compiler pass but that was just too much for me to be practical

ikitommi12:06:59

thanks @thheller, will dig into those.

jaime16:06:06

Hi, what is your recommended library for money/currency conversion in clojurescript? I've tried searching and can only find this https://github.com/clojurewerkz/money which looks like for clojure only

lilactown16:06:14

I think the google closure library has some utilities for that

donyorm19:06:52

Has anyone had any success getting react-plotly.js to work with shadow-cljs/reagent? I've had trouble getting it to import properly/be able to create a component with it

ouvasam08:06:07

Yes i have no problem with it. Which sort of problem do you have ? Thanks

ouvasam08:06:58

["react-plotly.js" :default Plot]

ouvasam09:06:23

Here is an example of Scatter

ouvasam09:06:28

[:> Plot
      {:id :plot1
       :on-click  #(dispatch [:plotly.points/select! (data/points->array  %)])
       :on-selected  #(dispatch [:plotly.points/select! (data/points->array %)])
       :data data'
       :layout {:width w
                :height h
                :plot_bgcolor colors/very-light-gray
                :paper_bgcolor colors/very-light-gray
                :autosize true
                :margin {:l 50 :t 50 :b 50}
                :legend {:autosize true}
                :hovermode :closest
                :xaxis {:title "Test"}
                :yaxis {}}
       :config {:scrollZoom true}}]]))

ouvasam09:06:12

and the data'

ouvasam09:06:16

data' (map (fn [[idx d]]
                     {:type :scattergl
                      :mode :markers
                      :x (map :x d)
                      :y (map :y d)
                      :data (map :data d)
                      :name (du/from-to :size d)
                      :color "#FFF"
                      :marker {:size (map :size d)
                               :color (map :color d)}})
                   (map-indexed vector data))]