Skip to content

Commit e5f13d7

Browse files
authored
Merge pull request #203 from ClojureCivitas/norway-1
norway wip
2 parents 54d055b + a9d1726 commit e5f13d7

File tree

1 file changed

+20
-21
lines changed

1 file changed

+20
-21
lines changed

src/clojure_norway/meetup_2025_12/violin.clj

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -470,32 +470,31 @@ wav-format
470470
bufimg/tensor->image)
471471

472472
(defn animated-echarts [specs]
473-
(kind/reagent
474-
['(fn [specs]
475-
(let [*i (reagent.core/atom 0)]
476-
(fn []
477-
^{:key @*i}
478-
[:div
479-
[:div {:style {:height "400px"}
480-
:ref (fn [el]
481-
(when el
482-
(let [chart (.init js/echarts el)]
483-
(.setOption chart
484-
(clj->js
485-
(specs (rem @*i (count specs))))))))}]
486-
(js/setInterval #(swap! *i inc) 1000)
487-
;; Include this to force component update:
488-
[:p {:style {:display :none}}
489-
(hash @*i)]])))
490-
specs]
491-
{:html/deps [:echarts]}))
473+
[(kind/reagent
474+
['(fn [specs]
475+
(let [*i (reagent.core/atom 0)]
476+
(fn []
477+
^{:key @*i}
478+
[:di
479+
[:div {:style {:height "400px"}
480+
:ref (fn [el]
481+
(when el
482+
(let [chart (.init js/echarts el)]
483+
(.setOption chart
484+
(clj->js
485+
(specs (rem @*i (count specs))))))))}]
486+
(js/setInterval #(swap! *i inc) 1000)
487+
;; Include this to force component update:
488+
[:p {:style {:display :none}}
489+
(hash @*i)]])))
490+
specs]
491+
{:html/deps [:echarts]})])
492492

493493
(let [n 100]
494494
(-> normalized-spectrogram
495495
(tensor/transpose [1 0])
496496
(tensor/slice 1)
497-
(->> (take 20)
498-
(mapv (fn [spectrum]
497+
(->> (mapv (fn [spectrum]
499498
{:xAxis {:show false
500499
:data (vec (range 100))}
501500
:yAxis {:show false}

0 commit comments

Comments
 (0)