Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. ;; Highcharts element for Hoplon without the need to destory and
  2. ;; re-initialize on changes.
  3.  
  4. (defn update-chart
  5. [chart options]
  6. (.update (.highcharts chart) (clj->js options) true true))
  7.  
  8. (defelem chart
  9. [{:keys [options] :as attr}]
  10. (with-let [elem (div :class (str (gensym)) (dissoc attr :options))]
  11. (let [chart (.highcharts (js/jQuery elem) (clj->js {}))]
  12. (cell= (update-chart chart options)))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement