edgebundleR
edgebundleR copied to clipboard
If vertex name contains strings with more than one word
The javascript doesn't work when the vertex name contains more than one word. Can you please let me know what might be the issue here?
Thanks.
Hi @galaktoboureko thanks for reporting the issue. I'm not sure what the problem is and I don't currently have time to investigate. A quick and dirty solution would be to replace spaces with underscores. I'll try to investigate further, but can't give a timeline at this stage. Happy to take pull requests though if you identify the offending code!
Hi, @garthtarr , another thing. The nodes of the graph is now ordered alphabetically, can I choose my own order for the nodes in the circle? Please let me know how I can do that.
Try the development version to see if it no longer orders alphabetically, see issue #6
Can you please give me a link to the development version? Shall I have to download the zip from here and upload it in R? Thanks for the quick reply.
# install.packages("devtools")
devtools::install_github("garthtarr/edgebundleR")
@garthtarr Just checking if there's any update on displaying node names with spaces?
@galaktoboureko sorry, no, haven't looked into this yet. Happy to take pull requests if you identify the issue.
I realize this is very late but I had the same problem and modified the JS code from:
nodes_g.append("text")
.attr("dx", function(d) { return d.x < 180 ? 8 : -8; })
.attr("dy", ".31em")
.attr("text-anchor", function(d) { return d.x < 180 ? "start" : "end"; })
.attr("transform", function(d) { return d.x < 180 ? null : "rotate(180)"; })
.style("fill", function(d){
if(d.color) return d.color;
})
.text(function(d) { return d.key; })
.on("mouseover", mouseover)
.on("mouseout", mouseout)
.on("click", click)
.append("svg:title")
.text(function(d) { return d.name; });
to
nodes_g.append("text")
.attr("dx", function(d) { return d.x < 180 ? 8 : -8; })
.attr("dy", ".31em")
.attr("text-anchor", function(d) { return d.x < 180 ? "start" : "end"; })
.attr("transform", function(d) { return d.x < 180 ? null : "rotate(180)"; })
.style("fill", function(d){
if(d.color) return d.color;
})
//.text(function(d) { return d.key; })
.on("mouseover", mouseover)
.on("mouseout", mouseout)
.on("click", click)
.text(function(d) { return d.key.split("_").join(" "); })
.append("svg:title")
.text(function(d) { return d.name; });
Admittedly this is a bit of a hack as it simply removes the underscores and replaces them with spaces for the plot. You can see this in the image below where the hover text shows how the actual value has an underscore but the text in the plot has the space. This 'fix' does not actually allow the user to upload data with the spaces in the names and have the arcs work. However, it may be enough to get you by.