Skip to content

Commit 4b5be15

Browse files
committed
mistake
1 parent 330dd98 commit 4b5be15

File tree

3 files changed

+33
-33
lines changed

3 files changed

+33
-33
lines changed

old/unused_functions.jl

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -115,35 +115,3 @@ function Bonito.jsrender(s::Session, selector::SelectSet)
115115
end
116116
return Bonito.jsrender(s, Card(Col(rows...)))
117117
end
118-
119-
function variable_legend(name, values::AbstractRange{<:Number}, palette::Dict)
120-
range, cmap = palette[:colormap]
121-
return S.Colorbar(limits = range, colormap = cmap, label = string(name))
122-
end
123-
124-
function variable_legend(name, values::Set, palette::Dict)
125-
marker_color_lookup = (x) -> begin
126-
if haskey(palette, :color)
127-
return get(palette[:color], x, :black)
128-
else
129-
return :black
130-
end
131-
end
132-
marker_lookup = (x) -> begin
133-
if haskey(palette, :marker)
134-
return palette[:marker][x]
135-
else
136-
return :rect
137-
end
138-
end
139-
conditions = collect(values)
140-
elements = map(conditions) do c
141-
return MarkerElement(marker = marker_lookup(c), color = marker_color_lookup(c))
142-
end
143-
return S.Legend(elements, conditions)
144-
end
145-
146-
147-
widget_value(w::Vector{<:String}; resolution = 1) = w
148-
widget_value(x::Vector; resolution = 1) =
149-
x[1] x[end] ? Float64[] : range(Float64(x[1]), Float64(x[end]), length = 5)

src/widgets_short.jl

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,38 @@ function widget(range::AbstractRange{<:Number})
4444
return range_slider
4545
end
4646

47+
widget_value(w::Vector{<:String}; resolution = 1) = w
48+
widget_value(x::Vector; resolution = 1) =
49+
x[1] x[end] ? Float64[] : range(Float64(x[1]), Float64(x[end]), length = 5)
50+
51+
4752
function formular_text(content; class = "")
4853
return DOM.div(content; class = "px-1 text-lg m-1 font-semibold $(class)")
4954
end
55+
56+
function variable_legend(name, values::AbstractRange{<:Number}, palette::Dict)
57+
range, cmap = palette[:colormap]
58+
return S.Colorbar(limits = range, colormap = cmap, label = string(name))
59+
end
60+
61+
function variable_legend(name, values::Set, palette::Dict)
62+
marker_color_lookup = (x) -> begin
63+
if haskey(palette, :color)
64+
return get(palette[:color], x, :black)
65+
else
66+
return :black
67+
end
68+
end
69+
marker_lookup = (x) -> begin
70+
if haskey(palette, :marker)
71+
return palette[:marker][x]
72+
else
73+
return :rect
74+
end
75+
end
76+
conditions = collect(values)
77+
elements = map(conditions) do c
78+
return MarkerElement(marker = marker_lookup(c), color = marker_color_lookup(c))
79+
end
80+
return S.Legend(elements, conditions)
81+
end

test/basic.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ begin
77
end
88

99
@testset "basic test" begin
10-
explore(model; positions = positions)
10+
ERPExplorer.explore(model; positions = positions)
1111
end

0 commit comments

Comments
 (0)