uclahs-cds / package-CancerEvolutionVisualization

Publication Quality Phylogenetic Tree Plots
https://cran.r-project.org/web/packages/CancerEvolutionVisualization/
GNU General Public License v2.0
2 stars 0 forks source link

Control node size #140

Closed dan-knight closed 2 weeks ago

dan-knight commented 1 month ago

Description

Closes #80. Allows node-by-node control of the size of the node. This accounts for the node size using the existing algorithm for positioning nodes, which accounts for node radius. While this could be be slightly improved for a pixel-perfect solution, that is beyond the scope of these changes.

Screenshot 2024-09-06 at 12 40 28 PM

Checklist

[^1]: UCLA Health reaches $7.5m settlement over 2015 breach of 4.5m patient records [^2]: The average healthcare data breach costs $2.2 million, despite the majority of breaches releasing fewer than 500 records. [^3]: Genetic information is considered PHI. Forensic assays can identify patients with as few as 21 SNPs [^4]: RNA-Seq, DNA methylation, microbiome, or other molecular data can be used to predict genotypes (PHI) and reveal a patient's identity.

  To automatically exclude such files using a .gitignore file, see here for example.

whelena commented 4 weeks ago

Another thing: when label is empty, '', the node size becomes zero.

test.dt <- data.frame(
    label = rep('', 4),
    parent = c(NA, 1, 1, 2),
    node.size = c(1, 0.7, 0.3, 0.4)
    );
grid.draw(SRCGrob(test.dt));

results in: Screenshot 2024-09-08 at 4 17 08 PM

This might arise when users want to associate a value with node.size and want to remove labels if the node.size is to small to contain it.

whelena commented 3 weeks ago

Im just documenting node behaviour here to verify if all these are intended outcomes:

  1. node.size = NA default node size is used
  2. node.size=0 Node is not drawn but labels are still present
  3. node.size = NA and draw.nodes = FALSE Node is not drawn but labels are still present
  4. node.size = 0 and draw.nodes = FALSE Node is not drawn but labels are still present
  5. draw.nodes is a mixture of T/F : >> Error in validDetails.polygon(x) : 'x' and 'y' and 'id.lengths' must specify same overall length I think when draw.nodes = FALSE the labels should be gone too
whelena commented 3 weeks ago
  1. draw.nodes is a mixture of T/F : >> Error in validDetails.polygon(x) : 'x' and 'y' and 'id.lengths' must specify same overall length I think when draw.nodes = FALSE the labels should be gone too

fixed!