@@ -5,7 +5,7 @@ using TableView
5
5
6
6
export browse, showtable
7
7
8
- # Method for keeping current window active borrowed
8
+ # Method for keeping current window active borrowed
9
9
# from Plots.jl
10
10
mutable struct CurrentWin
11
11
nullablewin:: Union{Window, Nothing}
28
28
current (win:: Window ) = (CURRENT_WIN. nullablewin = win)
29
29
30
30
"""
31
- browse(t; kwargs)
31
+ browse(t; newwindow = false, kwargs... )
32
32
33
- Browse data source in a new Blink window using
34
- Tables.jl's `showtable` function.
33
+ Browse data source in a new Blink window using
34
+ Tables.jl's `showtable` function.
35
35
36
36
# Arguments
37
37
38
- - `t`, a Tables.jl-compatible data source,
39
- for example a `DataFrame` or a `NamedTuple`
38
+ - `t`, a Tables.jl-compatible data source,
39
+ for example a `DataFrame` or a `NamedTuple`
40
40
of `Vector`s
41
- - `kwargs`, keyword arguments passed to the
42
- `showtable` command from TableView.jl to
41
+ - `newwindow`, boolean keyword argument to view the data
42
+ in a new `Blink` window instead of over-writing.
43
+ Viewing in a new window will be slower than over-writing.
44
+ - `kwargs...`, keyword arguments passed to the
45
+ `showtable` command from TableView.jl to
43
46
control the details of the new data viewer.
44
47
See [`showtable`](@ref) for details.
45
48
@@ -59,8 +62,10 @@ julia> browse(t, dark = true)
59
62
60
63
See also: [`showtable`](@ref)
61
64
"""
62
- function browse (df; height = " 100vh" , kwargs... )
63
- if iswinnull () || ! active (current ())
65
+ function browse (df; height = " 100vh" , newwindow:: Bool = false , kwargs... )
66
+ if newwindow == true
67
+ body! (Window (), showtable (df; height = height, kwargs... ))
68
+ elseif iswinnull () || ! active (current ())
64
69
w = Window ()
65
70
current (w)
66
71
body! (current (), showtable (df; height = height, kwargs... ))
0 commit comments