forked from moritz155/ParallelPlots
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_recipe_observable.jl
38 lines (29 loc) · 1.08 KB
/
test_recipe_observable.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
using ParallelPlots: parallelplot
using CairoMakie:Observable, record, save # for Record Video
using Test: @testset
@testset "Use a Observable DataFrame" begin
# create the Data
df_observable = Observable(create_person_df(3))
title_observable = Observable("")
curve_observable = Observable(true)
# create the Plot
fig, ax, sc = parallelplot(df_observable, title=title_observable, curve = curve_observable)
save("pcp_initialized.png", fig)
# we can change a parameter and the graph will be automaticly changed
curve_observable[] = false
title_observable[] = "No Curve"
save("pcp_initialized_curve_Changed.png", fig)
# Record for Debug purpose
record(fig, "PCP_recipe_animation.mp4", 2:60, framerate = 2) do t
# Update Dataframe
if(iseven(t))
curve_observable[] = false
title_observable[] = ""
df_observable[] = create_person_df(5)
else
curve_observable[] = true
title_observable[] = "Curved"
df_observable[] = create_car_df(t+1)
end
end
end