DynamicGridsGtk.DynamicGridsGtkModule

DynamicGridsGtk

Build Status codecov.io

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.GtkOutputType
GtkOutput(init; kw...)

Constructor for GtkOutput.

Arguments

  • init: initialisation AbstractArray or NamedTuple of AbstractArray

Keywords

DynamicGrids.Extent keywords:

  • init: initialisation Array/NamedTuple for grid/s.
  • mask: BitArray for defining cells that will/will not be run.
  • aux: NamedTuple of arbitrary input data. Use aux(data, Aux(:key)) to access from a Rule in a type-stable way.
  • padval: padding value for grids with neighborhood rules. The default is zero(eltype(init)).
  • tspan: Time span range. Never type-stable, only access this in modifyrule 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 like ArrayOutput or to disgard them after visualising. Very long simulation runs may fill available memory when store=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. A Vector/Matrix for multiple grids, matching the layout array. Note: The default is 0, and will not be updated automatically for the simulation.

  • maxval: Maximum value in the grid(s) to normalise for conversion to an RGB pixel. A Vector/Matrix for multiple grids, matching the layout array. Note: The default is 1, and will not be updated automatically for the simulation.

  • font: String name of font to search for. A default will be guessed.

  • text: TextConfig() or nothing for no text. Default is TextConfig(; font=font).

  • scheme: a ColorSchemes.jl colorscheme, ObjectScheme or object that defines Base.get(obj, val) and returns a Color or a value that can be converted to Color using ARGB32(val).

  • zerocolor: a Col to use when values are zero, or nothing to ignore.

  • maskcolor: a Color to use when cells are masked, or nothing to ignore.

  • renderer: Renderer like Image or Layout. Will be detected automatically, and use scheme, zerocolor and maskcolor keywords if available. Can be a Vector/Matrix for multiple grids, matching the layout array.

An ImageConfig object can be also passed to the imageconfig keyword, and other keywords will be ignored.