Home of the MathBox
Home of the [[MathBox]]
(MathBox props & children)
Component that configures a MathBox-backed canvas and reactively mounts all children into the canvas.
Supports the following options:
:threestrap
: these options are passed directly to the mathbox
constructor on instantiation;
these are in turn passed along to Threestrap's Bootstrap
constructor.
See this page for an example
of what to pass and why.
:renderer
: optional map with :background-color
and :background-opacity
keys. Updating these will update the settings without a re-render.
:controls
: optional map with :max-distance
and :rotate-speed
keys.
Updating these will update the settings on the registered controls without a
re-render.
:on
: optional map of type {<event-name> (fn [event three] ,,,)} On mount,
each event will be bound via mathbox.three.on
, as described in Threestrap's
docs.
:ref
: a 1-arg function that receives the underlying mathbox instance
whenever it changes. Note that you may receive nil
and should guard against
it.
As well as all options used to configure the base/root component. (The format of each following line is <keyword>: <default> (<type>) - <description>.)
:camera
: "[camera]"
(select) - Active camera:classes
: []
(string array) - Custom classes, e.g. ["big"]
:focus
: 1
(nullable number) - Camera focus distance in world units:fov
: null
(nullable number) - (Vertical) Field-of-view to calibrate units for (degrees), e.g. 60
:id
: null
(nullable string) - Unique ID, e.g. "sampler"
:pass
: "view"
(vertexPass) - Vertex pass (data, view, world, eye):scale
: null
(nullable number) - (Vertical) Reference scale of viewport in pixels, e.g. 720
:speed
: 1
(number) - Global speedComponent that configures a MathBox-backed canvas and reactively mounts all children into the canvas. Supports the following options: - `:threestrap`: these options are passed directly to the [mathbox constructor](https://github.com/unconed/mathbox#basic-usage) on instantiation; these are in turn passed along to Threestrap's `Bootstrap` constructor. See [this page](https://github.com/unconed/threestrap#plugins) for an example of what to pass and why. - `:renderer`: optional map with `:background-color` and `:background-opacity` keys. Updating these will update the settings without a re-render. - `:controls`: optional map with `:max-distance` and `:rotate-speed` keys. Updating these will update the settings on the registered controls without a re-render. - `:on`: optional map of type {<event-name> (fn [event three] ,,,)} On mount, each event will be bound via `mathbox.three.on`, as described in [Threestrap's docs](https://github.com/unconed/threestrap#events). - `:ref`: a 1-arg function that receives the underlying mathbox instance whenever it changes. Note that you may receive `nil` and should guard against it. As well as all options used to configure the [base/root component](https://github.com/unconed/mathbox/blob/master/docs/primitives.md#base/root). (The format of each following line is <keyword>: <default> (<type>) - <description>.) - `:camera`: `"[camera]"` (select) - Active camera - `:classes`: `[]` (string array) - Custom classes, e.g. `["big"]` - `:focus`: `1` (nullable number) - Camera focus distance in world units - `:fov`: `null` (nullable number) - (Vertical) Field-of-view to calibrate units for (degrees), e.g. `60` - `:id`: `null` (nullable string) - Unique ID, e.g. `"sampler"` - `:pass`: `"view"` (vertexPass) - Vertex pass (data, view, world, eye) - `:scale`: `null` (nullable number) - (Vertical) Reference scale of viewport in pixels, e.g. `720` - `:speed`: `1` (number) - Global speed
Default :threestrap
options for the MathBox
component.
Default `:threestrap` options for the [[MathBox]] component.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close