File tree Expand file tree Collapse file tree
src/clojure_norway/meetup_2025_12 Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2929
3030; ; ## Relevant community projects
3131
32+ ; ; {width=100}
33+
34+ ; ; [Clojure Civitas](https://clojurecivitas.github.io/)
35+
3236; ; {width=100}
3337
3438; ; [DSP Study group](https://scicloj.github.io/docs/community/groups/dsp-study/)
@@ -171,7 +175,7 @@ wav-format
171175
172176(def cosine-wave
173177 (-> {:time (-> (range 0
174- 10
178+ 0.1
175179 (/ 1.0 sample-rate)))}
176180 tc/dataset
177181 (tc/add-column :value #(-> %
@@ -452,6 +456,40 @@ wav-format
452456 bufimg/tensor->image)
453457
454458
459+
460+
461+
462+
463+
464+ (defn animated-echarts [{:as details
465+ :keys [specs time-for-transition]}]
466+ (kind/reagent
467+ ['(fn [{:keys [specs
468+ time-for-transition]}]
469+ (let [*i (reagent.core/atom 0 )]
470+ (fn []
471+ ^{:key @*i}
472+ [:div
473+ [:p (pr-str (rem @*i (count specs)))]
474+ [:div {:style {:height " 400px" }
475+ :ref (fn [el]
476+ (when el
477+ (let [chart (.init js/echarts el)]
478+ (.setOption chart
479+ (clj->js
480+ (specs (rem @*i (count specs))))))))}]
481+ (js/setInterval #(swap! *i inc) time-for-transition)
482+ ; ; Include this to force component update:
483+ [:p {:style {:display :none }}
484+ (hash @*i)]
485+ ])))
486+ details]
487+ {:html/deps [:echarts ]}))
488+
489+
490+
491+
492+
455493; ; ## Playing the STFT
456494
457495(-> stft
You can’t perform that action at this time.
0 commit comments