Skip to content

Add option to change label and label value fontsize in SligerGrid #4983

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pmc4
Copy link

@pmc4 pmc4 commented May 15, 2025

Description

Fixes #2377

  • Adds labelsize attribute to SliderGrid block to change the fontsize of the slider labels.
  • Adds valuesize attribute to SliderGrid block to change the fontsize of the slider label values.

Maybe valuesize is not the most appropiate name. Should valuelabelsize or something else be used instead?

For reference, this is how it looks like on the example of the docs:

example

I have exagerated the fontsize of both elements to perceive the difference. The code is the following:

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,
    labelsize = 8,
    valuesize = 30)

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

Type of change

  • New feature (non-breaking change which adds functionality)

Checklist

  • Added an entry in CHANGELOG.md (for new features and breaking changes)
  • Added or changed relevant sections in the documentation
  • Added unit tests for new algorithms, conversion methods, etc.
  • Added reference image tests for new plotting functions, recipes, visual options, etc.

Because
* It was not possible to do it before unless you changed the whole theme
`Label` `fontsize` attribute.
@github-project-automation github-project-automation bot moved this to Work in progress in PR review May 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Work in progress
Development

Successfully merging this pull request may close these issues.

Cannot set fontsize with SliderGrid - GLMakie
1 participant