Minimum size of Makie grid cell?

I am layouting a Makie.jl figure with some figure elements (at [1,1], [2,1] and [1,2]) and a text box (at [2,2]). The text box is created as well as an axis and the text is written (a little painfully) into it. To get a well-behaved layout, I am currently using rowsize! and colsize! and specifying fixed sizes for the text part at figure startup in case the corresponding graphic needs too little space but else the colums and rows only get assigned relative widths and heights.

Yet, this does not behave well if the user resizes the whole figure. Therefore it would be very useful to specify something like MinSize(200) as a ContentSize as a 3rd argument to colsize!(). Is something like this possible? Even better, is it possible to force the text box to adapt to a minimum such that the text is always fully displayed (since different users may want different font sizes, etc.).

So far I am hacking via ax.layoutobservables.computedbbox.val.widths into the layout system to get an idea what the size of the current axis is, but I was having some trouble with the column size in which case it was consistently larger than what was set via colsize!() at the cell corresponding to that axis. Is there a better way to determine the size a figure cell in grid layout currently occupies?

I don’t quite understand your issue, maybe an image would help. There’s currently no way to specify min or max sizes, that could be a useful addition to GridLayoutBase. You can give the Textbox a fixed width, too, you don’t have to do that through colsize!

Yes, a minimum (and maximum?) size option might be a useful addition for layouting. As for the textbox, used for information display only (!), maybe I am constructing it entirely the wrong way:

ax_txt = Axis(fig[2,1], backgroundcolor=:white, xzoomlock=true, yzoomlock=true, xpanlock=true, ypanlock=true, xrectzoom=false, yrectzoom=false) 
hidedecorations!(ax_txt, grid = false); ax_im.xrectzoom = false; ax_im.yrectzoom = false
xlims!(ax_txt,-4,100); ylims!(ax_txt,-4,100)
text!(ax_txt, text_to_display, position = Point(0,99), color = :black, align = (:left, :top), justification = :left)

Maybe one could use the existing Textbox instead? But then how do I use it for display and disable user interaction?

Why don’t you use a Label for that which is just text?

Great. This is what I was looking for.

using GLMakie
fig = Figure()
plot(fig[1,1],sin.(1:0.1:10), color=:red)
lab = Label(fig[2,1],"Hello World!\nThis Label autoexpands!", halign = :left, valign = :top)

Its working fine :slight_smile: