DynamicGridsGtk.DynamicGridsGtk
— ModuleDynamicGridsGtk
Provides a GTK interface for visualising simulations with DynamicGrids.jl and packages that build on it like Dispersal.jl.
To create a Gtk window for use as a simulation output:
using DynamicGridsGtk
output = GtkOutput(init; tspan=1:100, fps=25, showfps=fps, store=false, processor=ColorProcessor())
Where init
is the initialisation array for the simulation, and processor can be any GridProcessor
from DynamicGrids.jl, which can use ColorSchemes.jl schemes.
Keyword arguments are optional, with defaults shown above.
Documentation
See the documentation for DynamicGrids.jl
Note: using Gtk on Windows will lead to very slow performance of the REPL and IDEs like Atom. Use DynamicGridsInteract instead.
DynamicGridsGtk.GtkOutput
— TypeGtkOutput(init; kw...)
Constructor for GtkOutput.
Arguments
init
: initialisationAbstractArray
orNamedTuple
ofAbstractArray
Keywords
DynamicGrids.Extent
keywords:
init
: initialisationArray
/NamedTuple
for grid/s.mask
:BitArray
for defining cells that will/will not be run.aux
: NamedTuple of arbitrary input data. Useaux(data, Aux(:key))
to access from aRule
in a type-stable way.padval
: padding value for grids with neighborhood rules. The default iszero(eltype(init))
.tspan
: Time span range. Never type-stable, only access this inmodifyrule
methods
An Extent
object can be also passed to the extent
keyword, and other keywords will be ignored.
DynamicGrids.GraphicConfig
keywords:
fps::Real
: Frames per second.store::Bool
: Whether to store frames likeArrayOutput
or to disgard them after visualising. Very long simulation runs may fill available memory whenstore=true
.
A GraphicConfig
object can be also passed to the graphicconfig
keyword, and other keywords will be ignored.
DynamicGrids.ImageConfig
keywords:
minval
: Minimum value in the grid(s) to normalise for conversion to an RGB pixel. AVector/Matrix
for multiple grids, matching thelayout
array. Note: The default is0
, and will not be updated automatically for the simulation.maxval
: Maximum value in the grid(s) to normalise for conversion to an RGB pixel. AVector/Matrix
for multiple grids, matching thelayout
array. Note: The default is1
, and will not be updated automatically for the simulation.font
:String
name of font to search for. A default will be guessed.text
:TextConfig()
ornothing
for no text. Default isTextConfig(; font=font)
.scheme
: a ColorSchemes.jl colorscheme,ObjectScheme
or object that definesBase.get(obj, val)
and returns aColor
or a value that can be converted toColor
usingARGB32(val)
.zerocolor
: aCol
to use when values are zero, ornothing
to ignore.maskcolor
: aColor
to use when cells are masked, ornothing
to ignore.renderer
:Renderer
likeImage
orLayout
. Will be detected automatically, and usescheme
,zerocolor
andmaskcolor
keywords if available. Can be aVector/Matrix
for multiple grids, matching thelayout
array.
An ImageConfig
object can be also passed to the imageconfig
keyword, and other keywords will be ignored.