Skip to content

Commit

Permalink
show_hmpreport closed triangles
Browse files Browse the repository at this point in the history
  • Loading branch information
fawda123 committed Jun 10, 2024
1 parent f9c10f2 commit 542edca
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions R/show_hmpreport.R
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ show_hmpreport <- function(acres, subtacres, hmptrgs, typ, twocol = FALSE, strat
x0 = grid::unit(x, "npc") - dx, y0 = grid::unit(y, "npc") - dy,
x1 = grid::unit(x, "npc") + dx, y1 = grid::unit(y, "npc") + dy,
gp = grid::gpar(col = color, fill = color, lwd = 4),
arrow = grid::arrow(type = "open", length = grid::unit(size, "mm"), angle = 45)
arrow = grid::arrow(type = "closed", length = grid::unit(size, "mm"), angle = 45)
)
}

Expand Down Expand Up @@ -226,7 +226,7 @@ show_hmpreport <- function(acres, subtacres, hmptrgs, typ, twocol = FALSE, strat
x0 = grid::unit(x, "npc") - dx, y0 = grid::unit(y, "npc") + dy,
x1 = grid::unit(x, "npc") + dx, y1 = grid::unit(y, "npc") - dy,
gp = grid::gpar(col = color, fill = color, lwd = 4),
arrow = grid::arrow(type = "open", length = grid::unit(size, "mm"), angle = 45)
arrow = grid::arrow(type = "closed", length = grid::unit(size, "mm"), angle = 45)
)
}

Expand Down Expand Up @@ -258,18 +258,20 @@ show_hmpreport <- function(acres, subtacres, hmptrgs, typ, twocol = FALSE, strat

# legend drawing function up arrow
draw_key_up <- function(data, params, size){
params$arrow$length <- grid::unit(0.35, 'cm')
grid::segmentsGrob(0.1, 0.1, 0.9, 0.9,
gp = grid::gpar(col = 'black', fill = 'black', lwd = 2, lineend = "butt"),
params$arrow$length <- grid::unit(0.3, 'cm')
params$arrow$type <- 2L
grid::segmentsGrob(0.15, 0.15, 0.85, 0.85,
gp = grid::gpar(col = 'black', fill = 'black', lwd = 3.5, lineend = "round"),
arrow = params$arrow
)
}

# legend drawing function down arrow
draw_key_down <- function(data, params, size){
params$arrow$length <- grid::unit(0.35, 'cm')
grid::segmentsGrob(0.1, 0.9, 0.9, 0.1,
gp = grid::gpar(col = 'black', fill = 'black', lwd = 2, lineend = "butt"),
params$arrow$length <- grid::unit(0.3, 'cm')
params$arrow$type <- 2L
grid::segmentsGrob(0.15, 0.85, 0.85, 0.15,
gp = grid::gpar(col = 'black', fill = 'black', lwd = 3.5, lineend = "round"),
arrow = params$arrow
)
}
Expand Down

0 comments on commit 542edca

Please sign in to comment.