-
Notifications
You must be signed in to change notification settings - Fork 148
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
81 changed files
with
1,350 additions
and
1,024 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
Package: circlize | ||
Type: Package | ||
Title: Circular Visualization | ||
Version: 0.4.10 | ||
Version: 0.4.11 | ||
Date: 2020-06-14 | ||
Author: Zuguang Gu | ||
Maintainer: Zuguang Gu <[email protected]> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,23 +3,25 @@ | |
# Draw arrow which is paralle to the circle | ||
# | ||
# == param | ||
# -x1 start position of the arrow on the x-axis. | ||
# -x2 end position of the arrow on the x-axis. | ||
# -y position of the arrow on the y-axis. Note this is the center of the arrow on y-axis. | ||
# -width width of the arrow body. | ||
# -sector.index index of the sector. | ||
# -track.index index of the track. | ||
# -arrow.head.length length of the arrow head. Note the value should be smaller than the length of the arrow itself (which is ``x2 - x1``). | ||
# -arrow.head.width width of the arrow head. | ||
# -arrow.position where is the arrow head on the arrow. | ||
# -tail the shape of the arrow tail (the opposite side of arrow head). | ||
# -border border color of the arrow. | ||
# -col filled color of the arrow. | ||
# -lty line style of the arrow. | ||
# -... pass to `graphics::polygon`. | ||
# -x1 Start position of the arrow on the x-axis. | ||
# -x2 End position of the arrow on the x-axis. Note ``x2`` should be larger than ``x1``. The direction | ||
# of arrows can be controlled by ``arrow.position`` argument. | ||
# -y Position of the arrow on the y-axis. Note this is the center of the arrow on y-axis. | ||
# -width Width of the arrow body. | ||
# -sector.index Index of the sector. | ||
# -track.index Index of the track. | ||
# -arrow.head.length Length of the arrow head. Note the value should be smaller than the length of the arrow itself (which is ``x2 - x1``). | ||
# -arrow.head.width Width of the arrow head. | ||
# -arrow.position Where is the arrow head on the arrow. If you want to the arrow in the reversed direction, set this value to ``"start"``. | ||
# -tail The shape of the arrow tail (the opposite side of arrow head). | ||
# -border Border color of the arrow. | ||
# -col Filled color of the arrow. | ||
# -lty Line style of the arrow. | ||
# -... Pass to `graphics::polygon`. | ||
# | ||
# == details | ||
# Note all position values are measured in the data coordinate (the coordinate in each cell). | ||
# Note all position values are measured in the data coordinate (the coordinate in each cell). For the values of | ||
# ``width``, ``arrow.head.Length``, ``arrow.head.width``, they can be set with `mm_y`/`cm_y`/`inches_y` in absolute units. | ||
# | ||
# If you see points overflow warnings, you can set ``circos.par(points.overflow.warning = FALSE)`` to turn it off. | ||
# | ||
|
@@ -30,14 +32,30 @@ | |
# Zuguang Gu <[email protected]> | ||
# | ||
# == example | ||
# op = par(no.readonly = TRUE) | ||
# par(mfrow = c(1, 2)) | ||
# circos.initialize(letters[1:4], xlim = c(0, 1)) | ||
# col = rand_color(4) | ||
# tail = c("point", "normal", "point", "normal") | ||
# circos.track(ylim = c(0, 1), panel.fun = function(x, y) { | ||
# circos.arrow(0, 1, y = 0.5, width = 0.4, arrow.head.length = ux(1, "cm"), | ||
# col = "red", tail = ifelse(CELL_META$sector.index \%in\% c("a", "c"), | ||
# "point", "normal")) | ||
# circos.arrow(x1 = 0, x2 = 1, y = 0.5, width = 0.4, | ||
# arrow.head.width = 0.6, arrow.head.length = cm_x(1), | ||
# col = col[CELL_META$sector.numeric.index], | ||
# tail = tail[CELL_META$sector.numeric.index]) | ||
# }, bg.border = NA, track.height = 0.4) | ||
# circos.clear() | ||
# | ||
# circos.initialize(letters[1:4], xlim = c(0, 1)) | ||
# tail = c("point", "normal", "point", "normal") | ||
# circos.track(ylim = c(0, 1), panel.fun = function(x, y) { | ||
# circos.arrow(x1 = 0, x2 = 1, y = 0.5, width = 0.4, | ||
# arrow.head.width = 0.6, arrow.head.length = cm_x(1), | ||
# col = col[CELL_META$sector.numeric.index], | ||
# tail = tail[CELL_META$sector.numeric.index], | ||
# arrow.position = "start") | ||
# }, bg.border = NA, track.height = 0.4) | ||
# par(op) | ||
# | ||
# ########## cell cycle ########### | ||
# cell_cycle = data.frame(phase = factor(c("G1", "S", "G2", "M"), | ||
# levels = c("G1", "S", "G2", "M")), | ||
|
@@ -47,7 +65,7 @@ | |
# circos.initialize(cell_cycle$phase, xlim = cbind(rep(0, 4), cell_cycle$hour)) | ||
# circos.track(ylim = c(0, 1), panel.fun = function(x, y) { | ||
# circos.arrow(CELL_META$xlim[1], CELL_META$xlim[2], | ||
# arrow.head.width = CELL_META$yrange*0.8, arrow.head.length = ux(1, "cm"), | ||
# arrow.head.width = CELL_META$yrange*0.8, arrow.head.length = cm_x(1), | ||
# col = color[CELL_META$sector.numeric.index]) | ||
# circos.text(CELL_META$xcenter, CELL_META$ycenter, CELL_META$sector.index, | ||
# facing = "downward") | ||
|
@@ -57,11 +75,11 @@ | |
circos.arrow = function( | ||
x1, | ||
x2, | ||
y = get.cell.meta.data("ycenter", sector.index, track.index), | ||
width = get.cell.meta.data("yrange", sector.index, track.index)/2, | ||
y = get.cell.meta.data("ycenter"), | ||
width = get.cell.meta.data("yrange")/2, | ||
sector.index = get.current.sector.index(), | ||
track.index = get.current.track.index(), | ||
arrow.head.length = convert_x(5, "mm", sector.index, track.index), | ||
arrow.head.length = mm_x(5), | ||
arrow.head.width = width*2, | ||
arrow.position = c("end", "start"), | ||
tail = c("normal", "point"), | ||
|
@@ -73,8 +91,7 @@ circos.arrow = function( | |
arrow.position = match.arg(arrow.position)[1] | ||
tail = match.arg(tail)[1] | ||
|
||
sector.index = sector.index | ||
track.index = track.index | ||
set.current.cell(sector.index, track.index) | ||
|
||
if(x2 <= x1) { | ||
stop_wrap("`x2` should be larger than `x1`. Set `arrow.position = 'start'`\nto get reverse clockwise arrows.") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.