Skip to content
This repository has been archived by the owner on Jun 21, 2024. It is now read-only.

Commit

Permalink
dont overwrite method in 3b1b example
Browse files Browse the repository at this point in the history
  • Loading branch information
Datseris committed Feb 27, 2022
1 parent bd53cca commit 6189316
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "InteractiveDynamics"
uuid = "ec714cd0-5f51-11eb-0b6e-452e7367ff84"
repo = "https://github.com/JuliaDynamics/InteractiveDynamics.jl.git"
version = "0.19.3"
version = "0.19.4"


[deps]
Expand Down
7 changes: 2 additions & 5 deletions docs/src/billiards.jl
Original file line number Diff line number Diff line change
Expand Up @@ -200,21 +200,18 @@ fig
# the style of [3Blue1Brown](https://www.3blue1brown.com/).
# %% #src
using DynamicalBilliards, InteractiveDynamics, CairoMakie

BLUE = "#7BC3DC"
BROWN = "#8D6238"
colors = [BLUE, BROWN]
## Overwrite default color of obstacles to white (to fit with black background)
InteractiveDynamics.obcolor(::Obstacle) = RGBf(1,1,1)
bd = billiard_stadium(1, 1)
ps = particlebeam(1.0, 0.6, 0, 200, 0.01)

## Notice that keyword `color = :white` is propagated to billiard plot
bdplot_video(
"3b1billiard.mp4", bd, ps;
frames = 120, colors, dt = 0.01, tail_length = 100,
backgroundcolor = :black, framerate = 10,
backgroundcolor = :black, framerate = 10, color = :white,
)
nothing

# ```@raw html
# <video width="auto" controls autoplay loop>
Expand Down
3 changes: 2 additions & 1 deletion src/billiards/defs_animating.jl
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,10 @@ function bdplot_plotting_init!(ax::Axis, bd::Billiard, ps::Vector{<:AbstractPart
bmap_size = 4,
α = 0.9,
bmax = nothing,
kwargs...,
)

bdplot!(ax, bd)
bdplot!(ax, bd; kwargs...)
N = length(ps)
cs = if !(colors isa Vector) || length(colors) N
InteractiveDynamics.colors_from_map(colors, N, α)
Expand Down
1 change: 1 addition & 0 deletions src/billiards/premade_anim_functions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ and `phs, chs` can be used for making custom animations, see below.
* `velocity_size = 0.05`: Multiplication of particle velocity before plotted as quiver.
* `bmap_size = 4`: Marker size of boundary map scatter plot.
* `backgroundcolor, resolution`: Background color and resolution of the created figure.
* `kwargs...`: Remaining keywords are propagated to the billiard plotting.
## Custom Animations
Two helper structures are defined for each particle:
Expand Down

0 comments on commit 6189316

Please # to comment.