Skip to content

Commit

Permalink
new RangeData
Browse files Browse the repository at this point in the history
  • Loading branch information
hhaensel committed Jan 3, 2025
1 parent 72b0afb commit 64766c4
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/Ranges.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ export range, RangeData, slider
register_normal_element("q__range", context = @__MODULE__)
register_normal_element("q__slider", context = @__MODULE__)

# we have to use UnitRange because Quasar does not send back the step so we always
# end up with a UnitRange from Quasar
# this means that we need to use UnitRange on the Julia side and do the stepping in Quasar
# so no StepRange is allowed here
Base.@kwdef mutable struct RangeData{T}
range::UnitRange{T}
const QRangeType = Union{Symbol, String, Real}

Base.@kwdef mutable struct RangeData{QRangeType}
min::QRangeType
max::QRangeType
end

const QRangeType = Union{Symbol, String, Real}
RangeData(ar::AbstractRange{<:QRangeType}) = RangeData(first(ar), last(ar))

struct QRange <: AbstractRange{QRangeType}
min::QRangeType
step::QRangeType
Expand Down

0 comments on commit 64766c4

Please sign in to comment.