(diagram->file diagram
file-path
&
{:keys [mindra-path width height]
:or {mindra-path "mindra" width 512 height 512}})
Writes diagram to a file on disk.
The file-type is determined by the file-extension. The following file-extensions are supported: svg, png, tif, bmp, jpg, pdf. If file-type cannot be determined, mindra will assume png.
Returns path of file written to.
Writes diagram to a file on disk. The file-type is determined by the file-extension. The following file-extensions are supported: svg, png, tif, bmp, jpg, pdf. If file-type cannot be determined, mindra will assume png. Returns path of file written to.
(diagram->svg diagram
&
{:keys [mindra-path width height]
:or {mindra-path "mindra" width 512 height 512}})
Converts a diagram into SVG string using mindra.
Options: :mindra-path -- path to mindra command (defaults to 'mindra') :width -- width of svg to create :height -- height of svg to create
Returns SVG as a string.
Converts a diagram into SVG string using mindra. Options: :mindra-path -- path to mindra command (defaults to 'mindra') :width -- width of svg to create :height -- height of svg to create Returns SVG as a string.
(gloss-draw picture & {:as provided-opts})
Draws a gloss picture.
See https://hackage.haskell.org/package/gloss-1.13.2.1/docs/Graphics-Gloss-Interface-IO-Display.html
Options: :mindra-path -- path to mindra command (defaults to 'mindra') :full-screen? Whether gloss should start in full-screen mode (defaults to false. If true, then :window option is ignored) :window -- a map with :width, :height, :x, :y and :title keys for configuring the GUI window (defaults to 512, 512, 10, 10, 'Mindra'. Ignored if :full-screen? is set to true) :background-color -- a map with :red, :green, :blue, :alpha keys for setting the background color (defaults to 255, 255, 255, 255)
Draws a gloss picture. See https://hackage.haskell.org/package/gloss-1.13.2.1/docs/Graphics-Gloss-Interface-IO-Display.html Options: :mindra-path -- path to mindra command (defaults to 'mindra') :full-screen? Whether gloss should start in full-screen mode (defaults to false. If true, then :window option is ignored) :window -- a map with :width, :height, :x, :y and :title keys for configuring the GUI window (defaults to 512, 512, 10, 10, 'Mindra'. Ignored if :full-screen? is set to true) :background-color -- a map with :red, :green, :blue, :alpha keys for setting the background color (defaults to 255, 255, 255, 255)
(gloss-play world & {:as provided-opts})
Plays a gloss animation starting with given initial state (the world).
See https://hackage.haskell.org/package/gloss-1.13.2.1/docs/Graphics-Gloss-Interface-IO-Game.html
Options:
:mindra-path -- path to mindra command (defaults to 'mindra')
:on-step -- function that takes in world and number of seconds elasped; called on every step
:on-event -- function that takes in world and a map describing the event; called whenever an event fires
:on-exit -- function that takes in world; called when the gloss window is closed
:exit-event? -- a predicate function that takes in an event and decides if it is an exit event
(by default hitting ESC
key is an exit event)
:world->picture -- a function that converts world to a gloss picture
(defaults to creating a rectangle of size 100 x 100)
:full-screen? Whether gloss should start in full-screen mode
(defaults to false. If true, then :window option is ignored)
:window -- a map with :width, :height, :x, :y and :title keys for configuring the GUI window
(defaults to 512, 512, 10, 10, 'Mindra'. Ignored if :full-screen? is set to true)
:steps-per-second -- number of steps per second (defaults to 50)
Plays a gloss animation starting with given initial state (the world). See https://hackage.haskell.org/package/gloss-1.13.2.1/docs/Graphics-Gloss-Interface-IO-Game.html Options: :mindra-path -- path to mindra command (defaults to 'mindra') :on-step -- function that takes in world and number of seconds elasped; called on every step :on-event -- function that takes in world and a map describing the event; called whenever an event fires :on-exit -- function that takes in world; called when the gloss window is closed :exit-event? -- a predicate function that takes in an event and decides if it is an exit event (by default hitting `ESC` key is an exit event) :world->picture -- a function that converts world to a gloss picture (defaults to creating a rectangle of size 100 x 100) :full-screen? Whether gloss should start in full-screen mode (defaults to false. If true, then :window option is ignored) :window -- a map with :width, :height, :x, :y and :title keys for configuring the GUI window (defaults to 512, 512, 10, 10, 'Mindra'. Ignored if :full-screen? is set to true) :steps-per-second -- number of steps per second (defaults to 50)
(mindra-version)
(mindra-version mindra-path)
Gets version of the installed mindra binary.
Gets version of the installed mindra binary.
(show-diagram diagram
&
{:keys [mindra-path full-screen? window background-color]
:or {mindra-path "mindra"
full-screen? false
window {:width 512 :height 512 :x 10 :y 10 :title "Mindra"}
background-color
{:red 255 :green 255 :blue 255 :alpha 255}}})
A convenience function to show a diagram in a gloss window.
Requires mindra v0.0.3 or higher.
It writes a bmp file to a temp file and then loads it in gloss window.
This function accepts the same options as gloss-draw function.
A convenience function to show a diagram in a gloss window. Requires mindra v0.0.3 or higher. It writes a bmp file to a temp file and then loads it in gloss window. This function accepts the same options as gloss-draw function.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close