-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MathBox server-side fragments, demo (#30)
- Loading branch information
Showing
4 changed files
with
1,368 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
^{:nextjournal.clerk/visibility {:code :hide}} | ||
(ns emmy-viewers.mathbox | ||
#:nextjournal.clerk | ||
{:toc true :no-cache true} | ||
(:refer-clojure | ||
:exclude [+ - * / zero? compare divide numerator denominator | ||
infinite? abs ref partial =]) | ||
(:require [emmy.env :as e :refer :all] | ||
[emmy.clerk :as ec] | ||
[emmy.mathbox :as box] | ||
[nextjournal.clerk :as clerk])) | ||
|
||
;; ## Server-Side MathBox | ||
|
||
(def ->tex (comp clerk/tex ->TeX simplify)) | ||
|
||
{::clerk/width :wide} | ||
|
||
^{::clerk/visibility {:code :hide :result :hide}} | ||
(ec/install!) | ||
|
||
^{::clerk/width :wide} | ||
(box/mathbox | ||
{:container {:style {:height "400px" :width "100%"}} | ||
:renderer {:background-color 0x000000}} | ||
;; This makes us 2d. | ||
(box/layer | ||
(box/cartesian | ||
{:range [[(- Math/PI) (- Math/PI 0.00001)] [-10 10]] | ||
:scale [1 0.5]} | ||
(box/grid {:width 2 :divideX 20 :divideY 10})))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.