From ce878c910fac36cc59f226724c53c0a837579bda Mon Sep 17 00:00:00 2001 From: Alexander Plavin Date: Sun, 21 May 2023 13:10:44 +0300 Subject: [PATCH] add style kwarg do Slider --- src/Builtins.jl | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Builtins.jl b/src/Builtins.jl index 9208397f..59c6d986 100644 --- a/src/Builtins.jl +++ b/src/Builtins.jl @@ -140,6 +140,7 @@ begin values::AbstractVector{T} default::T show_value::Bool + style end end @@ -154,12 +155,12 @@ begin end end - function Slider(values::AbstractVector{T}; default=missing, show_value=false, max_steps=1_000) where T + function Slider(values::AbstractVector{T}; default=missing, show_value=false, max_steps=1_000, style=(;)) where T new_values = downsample(values, max_steps) Slider(new_values, (default === missing) ? first(new_values) : let d = default d ∈ new_values ? convert(T, d) : closest(new_values, d) - end, show_value) + end, show_value, style) end function Base.show(io::IO, m::MIME"text/html", slider::Slider) @@ -182,6 +183,7 @@ begin min=1, max=length(slider.values), value=start_index, + style=slider.style, ))>$( slider.show_value ? @htl( """