|
186 | 186 | """ |
187 | 187 | $(TYPEDSIGNATURES) |
188 | 188 |
|
189 | | -Return an expression `a{r*h}` to control relative plot height when using custom layouts. |
190 | | -
|
191 | | -Used for vertical space control in plot trees. |
192 | | -""" |
193 | | -function __height(r::Real)::Expr |
194 | | - i = Expr(:call, :*, r, :h) |
195 | | - a = Expr(:curly, :a, i) |
196 | | - return a |
197 | | -end |
198 | | - |
199 | | -""" |
200 | | -$(TYPEDSIGNATURES) |
201 | | -
|
202 | 189 | Return an empty plot for a `PlotLeaf`. |
203 | 190 |
|
204 | 191 | Used as a placeholder in layout trees. |
@@ -382,11 +369,10 @@ function __initial_plot( |
382 | 369 | nblines = 0 |
383 | 370 | if (!(node_xp isa EmptyPlot) && !(node_u isa EmptyPlot)) |
384 | 371 | nblines = n + l |
385 | | - a = __height(round(n / nblines; digits=2)) |
386 | | - @eval lay = @layout [ |
387 | | - $a |
388 | | - b |
389 | | - ] |
| 372 | + h = round(n / nblines; digits=2) |
| 373 | + lay = Matrix{Any}(undef, 2, 1) |
| 374 | + lay[1, 1] = (label = :a, width = :auto, height = h) |
| 375 | + lay[2, 1] = (label = :b, blank = false) |
390 | 376 | root = PlotNode(lay, [node_xp, node_u]) |
391 | 377 | elseif !(node_xp isa EmptyPlot) |
392 | 378 | root = node_xp |
@@ -428,11 +414,10 @@ function __initial_plot( |
428 | 414 | # update the root node |
429 | 415 | if !(node_cocp isa EmptyPlot) |
430 | 416 | nblines += nc |
431 | | - c = __height(round(nc / nblines; digits=2)) |
432 | | - @eval lay = @layout [ |
433 | | - a |
434 | | - $c |
435 | | - ] |
| 417 | + h = round(nc / nblines; digits=2) |
| 418 | + lay = Matrix{Any}(undef, 2, 1) |
| 419 | + lay[1, 1] = (label = :a, blank = false) |
| 420 | + lay[2, 1] = (label = :b, width = :auto, height = h) |
436 | 421 | root = PlotNode(lay, [root, node_cocp]) |
437 | 422 | end |
438 | 423 | end |
|
0 commit comments