Liking cljdoc? Tell your friends :D

mindra.core


default-exit-event?clj

(default-exit-event? event)

Default predicate function to decide if an event is an exit-event.

ESC key is the default way to exit.

Default predicate function to decide if an event is an exit-event.

ESC key is the default way to exit.
sourceraw docstring

diagram->svgclj

(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.
sourceraw docstring

gloss-drawclj

(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') :window -- a map with :width, :height, :x, :y and :title keys for configuring the GUI window (defaults to 512, 512, 10, 10, 'Mindra') :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')
:window -- a map with :width, :height, :x, :y and :title keys for configuring the GUI window
           (defaults to 512, 512, 10, 10, 'Mindra')
:background-color -- a map with :red, :green, :blue, :alpha keys for setting the background color
                     (defaults to 255, 255, 255, 255)
sourceraw docstring

gloss-playclj

(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) :window -- a map with :width, :height, :x, :y and :title keys for configuring the GUI window (defaults to 512, 512, 10, 10, 'Mindra') :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)
:window -- a map with :width, :height, :x, :y and :title keys for configuring the GUI window
           (defaults to 512, 512, 10, 10, 'Mindra')
:steps-per-second -- number of steps per second (defaults to 50)
sourceraw docstring

handle-eventclj

(handle-event writer configuration world event)

Handles an event message sent by mindra.

Handles an event message sent by mindra.
sourceraw docstring

handle-gloss-init-requestclj

(handle-gloss-init-request writer configuration)

Handles initialization request from mindra for setting it up for Gloss.

Handles initialization request from mindra for setting it up for Gloss.
sourceraw docstring

handle-gloss-readyclj

(handle-gloss-ready writer configuration world message-body)

Handles ready message from mindra for Gloss.

Handles ready message from mindra for Gloss.
sourceraw docstring

handle-picture-requestclj

(handle-picture-request writer configuration world)

Handles a picture request message sent by mindra.

Handles a picture request message sent by mindra.
sourceraw docstring

handle-shutdownclj

(handle-shutdown writer configuration world)

Handles shutdown message from mindra.

Handles shutdown message from mindra.
sourceraw docstring

handle-stepclj

(handle-step writer configuration world message-body)

Handles a step message sent by mindra.

Handles a step message sent by mindra.
sourceraw docstring

handle-svg-init-requestclj

(handle-svg-init-request writer configuration)

Handles initialization request from mindra for setting it up for SVG drawing.

Handles initialization request from mindra for setting it up for SVG drawing.
sourceraw docstring

handle-svg-readyclj

(handle-svg-ready writer configuration svg message-body)

Handles ready message from mindra for SVG drawings.

Handles ready message from mindra for SVG drawings.
sourceraw docstring

handle-svg-requestclj

(handle-svg-request writer _configuration svg)

Handles a SVG request message sent by mindra.

Handles a SVG request message sent by mindra.
sourceraw docstring

MINDRA-MODE-GLOSS-INTERACTIVEclj

source

MINDRA-MODE-GLOSS-STATICclj

source

parse-eventclj

(parse-event message-body)

Parses an event message from mindra to a dict with :name and :args.

Parses an event message from mindra to a dict with :name and :args.
sourceraw docstring

(print-and-raise-mindra-failure tag body)

Prints and raises a failure message from mindra.

Prints and raises a failure message from mindra.
sourceraw docstring

read-messageclj

(read-message reader)

Reads a message sent by mindra.

Reads a message sent by mindra.
sourceraw docstring

start-mindra-or-failclj

(start-mindra-or-fail path)

Starts mindra command from given command or fails with a helpful error message.

Starts mindra command from given command or fails with a helpful error message.
sourceraw docstring

write-messageclj

(write-message writer tag)
(write-message writer tag body)

Writes a message to mindra's stdin.

Writes a message to mindra's stdin.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close