Skip to content

Commit

Permalink
- avoding the unnecessary use of Reagent for Python plots
Browse files Browse the repository at this point in the history
  • Loading branch information
daslu committed May 5, 2024
1 parent 37bac75 commit a1ee82e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Change Log
All notable changes to this project will be documented in this file. This change log follows the conventions of [keepachangelog.com](http://keepachangelog.com/).

## [1-alpha35] - unreleased
- avoding the unnecessary use of Reagent for Python plots

## [1-alpha34] - 2024-04-15
- removed the currently-unnecessary `calc-correlations-matrix` and `round` functions (#22) - thanks, @behrica
- dropped the histogram computation function and used the one in Fastmath instead (#21) - thanks, @behrica
Expand Down
10 changes: 2 additions & 8 deletions src/scicloj/noj/v1/vis/python.clj
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,6 @@
'matplotlib.backends.backend_agg
'numpy)

(defn html-in-reagent [html]
(-> [:div
{:dangerouslySetInnerHTML
{:__html html}}]
kind/reagent))

(defmacro with-pyplot
"Takes forms with mathplotlib.pyplot and returns a showable (SVG) plot."
[& body]
Expand All @@ -28,7 +22,7 @@
(matplotlib.pyplot/savefig path#)
(-> path#
slurp
html-in-reagent)))
kind/html)))


(defn pyplot
Expand All @@ -43,4 +37,4 @@
(matplotlib.pyplot/savefig path)
(-> path
slurp
html-in-reagent)))
kind/html)))

0 comments on commit a1ee82e

Please sign in to comment.