【发布时间】:2018-04-24 04:00:19
【问题描述】:
我似乎无法理解 sunburstR 包中的 sunburst 如何处理某些参数,即赋予它的颜色矢量以及它如何将颜色应用于不同的类别,以及如何显示不同分区的标签。
它有什么逻辑吗,有没有更好的方法来手动指定哪种颜色应该与哪个根/叶搭配?
来自?sunburst:(不知道“提供范围和/或域的列表”是什么意思。
colors
vector of strings representing colors as hexadecimal for manual colors.
If you want precise control of colors, supply a list with range and/or domain.
For advanced customization, supply a JavaScript function.
谢谢!
sourcestatus
# A tibble: 5 x 2
SourceStatus count
<chr> <int>
1 blood-affected 4369
2 blood-unaffected 2848
3 blood-unknown 1
4 cell_line-affected 1797
5 cell_line-unaffected 151
创建旭日形:
sunburst(sourcestatus, count = TRUE, percent= T,
colors = c("#6b5b95", "#feb236", "#d64161", "#ff7b25"))
【问题讨论】:
标签: r d3.js donut-chart sunburst-diagram htmlwidgets