-
Notifications
You must be signed in to change notification settings - Fork 3
vjust arg for gridify Object #18
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
Changes from 18 commits
2115dc6
515e4d2
35ada01
83dcb55
c9416ef
f8a873d
edb3951
b024802
b32ca4b
3df43b8
d634309
ee3c33f
0cb5890
c62b05f
b4d1519
56a2400
3a79954
4cc3da1
8edd959
3425491
151ea8d
293f2ce
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -254,16 +254,22 @@ setMethod( | |
| setMethod("print", "gridifyClass", function(x, ...) { | ||
| grid::grid.newpage() | ||
|
|
||
| # See object_viewport_height_expr() for the rationale behind this choice. | ||
| height_expr <- object_viewport_height_expr( | ||
| grob = x@object, | ||
| vjust = x@layout@object@vjust, | ||
| height = x@layout@object@height | ||
| ) | ||
|
|
||
| pp_list <- list( | ||
| substitute( | ||
| grid::grobTree( | ||
| grid::editGrob( | ||
| OBJECT, | ||
| vp = grid::viewport( | ||
| height = grid::unit.pmax( | ||
| grid::unit(height_value, "npc"), | ||
| grid::unit(1, "inch") | ||
| ), | ||
| y = grid::unit(vjust_value, "npc"), | ||
| just = c(0.5, vjust_value), | ||
| height = HEIGHT_EXPR, | ||
| width = grid::unit.pmax( | ||
| grid::unit(width_value, "npc"), | ||
| grid::unit(1, "inch") | ||
|
|
@@ -276,10 +282,11 @@ setMethod("print", "gridifyClass", function(x, ...) { | |
| ) | ||
| ), | ||
| env = list( | ||
| height_value = x@layout@object@height, | ||
| width_value = x@layout@object@width, | ||
| nrow_value = x@layout@object@row, | ||
| ncol_value = x@layout@object@col | ||
| ncol_value = x@layout@object@col, | ||
| vjust_value = x@layout@object@vjust, | ||
| HEIGHT_EXPR = height_expr | ||
| ) | ||
| ) | ||
| ) | ||
|
|
@@ -668,6 +675,15 @@ setMethod("show_spec", "gridifyLayout", function(object) { | |
|
|
||
| cat(sprintf(" Width: %s\n", object@object@width)) | ||
| cat(sprintf(" Height: %s\n", object@object@height)) | ||
| cat(sprintf( | ||
| " Vjust: %s%s\n", | ||
| object@object@vjust, | ||
| if (object@object@vjust == 0.5) { | ||
| " (default; the object fills the full row regardless of grob type)" | ||
| } else { | ||
| " (anchors fixed-size grobs; flexible grobs e.g. ggplot still fill the row)" | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i do not think so it is a good description
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We already documented it well so I think we can remove this additional text. |
||
| } | ||
| )) | ||
|
|
||
| cat("\nObject Row Heights:\n") | ||
| rows_span <- object_row[1]:object_row[length(object_row)] | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i do not think so it is a good description
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We already documented it well so I think we can remove this additional text.