SliderGrid
|
Страница в процессе перевода. |
Для столбца с метками значений автоматически устанавливается фиксированная ширина, чтобы макет не дрожал при перетаскивании ползунков и изменении ширины меток значений. Эта ширина выбирается путем задания нескольких значений для каждого ползунка и записи максимальной ширины метки. Или можно задать ширину вручную с помощью атрибута value_column_width.
using GLMakie
fig = Figure()
ax = Axis(fig[1, 1])
sg = SliderGrid(
fig[1, 2],
(label = "Voltage", range = 0:0.1:10, format = "{:.1f}V", startvalue = 5.3),
(label = "Current", range = 0:0.1:20, format = "{:.1f}A", startvalue = 10.2),
(label = "Resistance", range = 0:0.1:30, format = "{:.1f}Ω", startvalue = 15.9),
width = 350,
tellheight = false)
sliderobservables = [s.value for s in sg.sliders]
bars = lift(sliderobservables...) do slvalues...
[slvalues...]
end
barplot!(ax, bars, color = [:yellow, :orange, :red])
ylims!(ax, 0, 30)
fig
Атрибуты
MarkdownAST.Heading(3)
Defaults to Inside()
The align mode of the block in its parent GridLayout.
MarkdownAST.Heading(3)
Defaults to :center
The horizontal alignment of the block in its suggested bounding box.
MarkdownAST.Heading(3)
Defaults to Auto()
The height setting of the block.
MarkdownAST.Heading(3)
Defaults to true
Controls if the parent layout can adjust to this block’s height
MarkdownAST.Heading(3)
Defaults to true
Controls if the parent layout can adjust to this block’s width
MarkdownAST.Heading(3)
Defaults to :center
The vertical alignment of the block in its suggested bounding box.
MarkdownAST.Heading(3)
Defaults to automatic
The width of the value label column. If automatic, the width is determined by sampling a few values from the slider ranges and picking the largest label size found.
MarkdownAST.Heading(3)
Defaults to Auto()
The width setting of the block.