thomasp85 / ggraph

Grammar of Graph Graphics

Home Page:https://ggraph.data-imaginist.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

geom_node_arc_bar for a piechart node plotting, stack nodes ontop of each other with later data.frame full_join

pwolf-okami opened this issue · comments

Hey Thomas,
first of, respect for this awesome package! That being said I am trying to achieve a very special case with your geom_node_arc_bar function:
Basically I have a tree that I want to visualize very much like clustree, so a single cell data set with, in an easy minimal example, 10 different cells that cluster in, depending on the resolution, 1 to 4 clusters.
I summarize the cells to their clusters at each resolution, getting unique nodes and their size (variable: node), but also want to consider adding any given metadata groups to these nodes by plotting them in a pie chart;
if the node is formed by cells of different metadata values it gets split up into their proportions (variable node_meta). I achieve this by creating the tbl_graph from unique nodes (and some proper edge matrix), then use create_layout("tree") to get my fixed positions in x and y column. Into that object I join in the nodes_meta multiple rows to directly assign each multiple of a node to their corresponding unique nodes position. I have the feeling that this last part is somehow faulty as the attributes of the layout likely are still unchanged and stay at the level of unique nodes, which is why plotting this might give me struggle. However I do not seem to be able to reproduce your manual mapping approaches, any help much appreciated as I am trying to work on a package for my master thesis! :)

edit: ultimatly I managed to do as inted, as it looks for now.. I thought I will leave the summary up so you can keep it ind mind eventually, great work with this plugin!