我正在尝试使用R中的D3气泡图来制作带有分组气泡颜色的气泡图表.
我已将index.html和flare.json文件从D3 上传到R中,并在运行时生成气泡图.但我不想手动更改此JSON代码以创建我自己的气泡和组(下面的标题显示了一组3个气泡组,其中包含不同组的名称).
{
"name": "flare",
"children": [
{
"name": "analytics",
"children": [
{
"name": "cluster",
"children": [
{"name": "AgglomerativeCluster", "size": 3938},
{"name": "CommunityStructure", "size": 3812},
{"name": "HierarchicalCluster", "size": 6714},
{"name": "MergeEdge", "size": 743}
]
},
{
"name": "graph",
"children": [
{"name": "BetweennessCentrality", "size": 3534},
{"name": "LinkDistance", "size": 5731},
{"name": "MaxFlowMinCut", "size": 7840},
{"name": "ShortestPaths", "size": 5914},
{"name": "SpanningTree", "size": 3416}
]
},
{
"name": "optimization",
"children": [
{"name": "AspectRatioBanker", "size": 7074}
]
} …Run Code Online (Sandbox Code Playgroud)