Skip to content

Commit

Permalink
update docs, bump DG version to 0.21, and patch version to 0.6.3
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaqz committed Dec 13, 2021
1 parent 0e5acdb commit b356b6e
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 24 deletions.
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "DynamicGridsInteract"
uuid = "3ccff026-9a20-11e9-1704-43e1c6ed0af5"
authors = ["Rafael Schouten <[email protected]>"]
version = "0.6.2"
version = "0.6.3"

[deps]
Blink = "ad839575-38b3-5650-b840-f874b8c74a25"
Expand All @@ -16,7 +16,7 @@ WebSockets = "104b5d7c-a370-577a-8038-80a2059c5097"

[compat]
Blink = "0.12"
DynamicGrids = "^0.18.4, 0.19, 0.20"
DynamicGrids = "0.21"
ImageShow = "0.2.3, 0.3"
Interact = "0.10"
InteractBase = "0.10"
Expand Down
8 changes: 7 additions & 1 deletion src/electron.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@ A html output using Interact.jl and an Electron window through Blink.jl
ElectronOutput automatically generates sliders to control simulations
in realtime. args and kwargs are passed to [`InteractOutput`](@ref).
Keyword arguments are passed to [`InteractOutput`](@ref).
# Arguments
- `init`: initialisation `AbstractArray` or `NamedTuple` of `AbstractArray`.
# Keywords
$INTERACT_OUTPUT_KEYWORDS
"""
mutable struct ElectronOutput{T,F,I<:InteractOutput{T,F}} <: AbstractInteractOutput{T,F}
interface::I
Expand Down
39 changes: 24 additions & 15 deletions src/interact.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,26 @@

const INTERACT_OUTPUT_KEYWORDS = """
- `ruleset::Ruleset`: the ruleset to run in the interface simulations.
#### `DynamicGrids.Extent` keywords:
$(DynamicGrids.EXTENT_KEYWORDS)
An `Extent` object can be also passed to the `extent` keyword, and other keywords will be ignored.
#### `DynamicGrids.GraphicConfig` keywords:
$(DynamicGrids.GRAPHICCONFIG_KEYWORDS)
A `GraphicConfig` object can be also passed to the `graphicconfig` keyword, and other keywords will be ignored.
#### `DynamicGrids.ImageConfig` keywords:
$(DynamicGrids.IMAGECONFIG_KEYWORDS)
(See DynamicGrids.jl docs for more details)
"""

"""
AbstractInteractOutput
Expand All @@ -18,24 +40,11 @@ and the back-end for [`ElectronOutput`](@ref) and [`ServerOutput`](@ref).
# Arguments:
- `init`: initialisation `Array` or `NamedTuple` of arrays.
- `init`: initialisation `AbstractArray` or `NamedTuple` of `AbstractArray`.
# Keywords
- `ruleset::Ruleset`: the ruleset to run in the interface simulations.
- `tspan`: `AbstractRange` timespan for the simulation
- `aux`: NamedTuple of arbitrary input data. Use `get(data, Aux(:key), I...)`
to access from a `Rule` in a type-stable way.
- `mask`: `BitArray` for defining cells that will/will not be run.
- `padval`: padding value for grids with neighborhood rules. The default is `zero(eltype(init))`.
- `font`: `String` font name, used in default `TextConfig`. A default will be guessed.
- `text`: `TextConfig` object or `nothing` for no text.
- `scheme`: ColorSchemes.jl scheme, or `Greyscale()`
- `renderer`: `Renderer` such as `Image` or `Layout`
- `minval`: minimum value(s) to set colour maximum
- `maxval`: maximum values(s) to set colour minimum
(See DynamicGrids.jl docs for more details)
$INTERACT_OUTPUT_KEYWORDS
"""
mutable struct InteractOutput{T,F<:AbstractVector{T},E,GC,IC,RS<:Ruleset,Pa,IM,TI} <: AbstractInteractOutput{T,F}
frames::F
Expand Down
12 changes: 6 additions & 6 deletions src/server.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@ Each page load gets a newly initialised Rulset.
# Keyword arguments
- `port`: port number to reach the server. ie localhost:8080
- `ruleset::Ruleset`: the ruleset to run in the interface simulations.
- `tspan`: `AbstractRange` timespan for the simulation
- `kw`: other keyword arguments to be passed to [`InteractOuput`](@ref).
- `port`: port number to reach the server. `8080` by default, found at `localhost:8080`.
$INTERACT_OUTPUT_KEYWORDS
An `ImageConfig` object can be also passed to the `imageconfig` keyword, and other keywords will be ignored.
"""
mutable struct ServerOutput{I}
init::I
port::Int
end
function ServerOutput(init; port=8080, ruleset, kwargs...)
function ServerOutput(init; port=8080, ruleset, kw...)
server = ServerOutput(init, port)
function app(request)
InteractOutput(deepcopy(server.init); ruleset=deepcopy(ruleset), kwargs...).page
InteractOutput(deepcopy(server.init); ruleset=deepcopy(ruleset), kw...).page
end
WebIO.webio_serve(Mux.page("/", request -> app(request)), port)
return server
Expand Down

2 comments on commit b356b6e

@rafaqz
Copy link
Member Author

@rafaqz rafaqz commented on b356b6e Dec 13, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/50441

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.6.3 -m "<description of version>" b356b6e390a67be4d3ea0859c0bd7754a44516cf
git push origin v0.6.3

Please sign in to comment.