R/monarch_palettes.R
monarch_palettes.Rd
This function returns a list of default color palettes and shape settings for nodes and edges used in Monarch knowledge graph visualizations. Users can run this function to inspect the default settings and override them with custom palettes if desired.
monarch_palettes()
A list containing color and shape information for nodes and edges:
A vector of hex color codes for continuous color gradients.
A list with the following elements:
A named vector of hex color codes for discrete node types:
"biolink:Disease"
: "#d52473"
"biolink:PhenotypicFeature"
: "#2f9869"
"biolink:Gene"
: "#2c81c6"
A named vector of hex color codes for continuous node gradients:
"biolink:Disease"
: first color in continuous
"biolink:PhenotypicFeature"
: second color in continuous
"biolink:Gene"
: third color in continuous
A named vector of shapes for node types:
"biolink:Disease"
: square (15
)
"biolink:PhenotypicFeature"
: circle (16
)
"biolink:Gene"
: triangle (18
)
A list with the following elements:
A named vector of hex color codes for discrete edge types:
"biolink:causes"
: "black"
"biolink:gene_associated_with_condition"
: "#2c81c6"
"biolink:has_phenotype"
: "#2f9869"
"biolink:subclass_of"
: "darkgrey"
A named vector of hex color codes for continuous edge gradients:
"biolink:causes"
: first color in continuous
"biolink:gene_associated_with_condition"
: second color in continuous
"biolink:has_phenotype"
: third color in continuous
"biolink:subclass_of"
: fourth color in continuous
# View the default palettes
monarch_palettes()
#> $continuous
#> [1] "#2c8c9a" "#79e4e7" "#a7ecf3" "#fafafa" "white"
#>
#> $nodes
#> $nodes$discrete
#> biolink:Disease biolink:PhenotypicFeature biolink:Gene
#> "#d52473" "#2f9869" "#2c81c6"
#>
#> $nodes$continuous
#> biolink:Disease biolink:PhenotypicFeature biolink:Gene
#> "#2c8c9a" "#79e4e7" "#a7ecf3"
#>
#> $nodes$shape
#> biolink:Disease biolink:PhenotypicFeature biolink:Gene
#> 15 16 18
#>
#>
#> $edges
#> $edges$discrete
#> biolink:causes biolink:gene_associated_with_condition
#> "black" "#2c81c6"
#> biolink:has_phenotype biolink:subclass_of
#> "#2f9869" "darkgrey"
#>
#> $edges$continuous
#> biolink:causes biolink:gene_associated_with_condition
#> "#2c8c9a" "#79e4e7"
#> biolink:has_phenotype biolink:subclass_of
#> "#a7ecf3" "#fafafa"
#>
#>
# Override the palette with custom colors
custom_palettes <- monarch_palettes()
custom_palettes$nodes$discrete["biolink:Disease"] <- "#ff0000"