garthtarr / edgebundler Goto Github PK
View Code? Open in Web Editor NEWCircle plot with bundled edges
Home Page: http://garthtarr.github.io/edgebundleR/
Circle plot with bundled edges
Home Page: http://garthtarr.github.io/edgebundleR/
edgebundleR worked fine by itself in my ShinyApp, but I could not display a D3 network generated by networkD3. No error in my ShinyApp, but got the following javascript error in my browser. Apparently there is a conflict between edgebundleR and networkD3. I want to display my network in both on two different tabs. I would greatly appreciate it if you could help me to find a solution!
Uncaught TypeError: Cannot read property 'cluster' of undefined edgebundleR.js:30
at Object.drawGraphic (http://127.0.0.1:6080/edgebundleR-binding-0.1.4/edgebundleR.js:30:29)
at Object.renderValue (http://127.0.0.1:6080/edgebundleR-binding-0.1.4/edgebundleR.js:12:10)
at exports.OutputBinding.shinyBinding.renderValue (http://127.0.0.1:6080/htmlwidgets-0.9/htmlwidgets.js:516:20)
at exports.OutputBinding.onValueChange (http://127.0.0.1:6080/shared/shiny.min.js:4:9871)
at exports.OutputBinding.delegator.(anonymous function) [as onValueChange] (http://127.0.0.1:6080/htmlwidgets-0.9/htmlwidgets.js:112:23)
at OutputBindingAdapter.onValueChange (http://127.0.0.1:6080/shared/shiny.min.js:4:29679)
at ShinyApp.receiveOutput (http://127.0.0.1:6080/shared/shiny.min.js:3:26802)
at ShinyApp. (http://127.0.0.1:6080/shared/shiny.min.js:3:28780)
at ShinyApp._sendMessagesToHandlers (http://127.0.0.1:6080/shared/shiny.min.js:3:28585)
at ShinyApp.dispatchMessage (http://127.0.0.1:6080/shared/shiny.min.js:3:28375)
@garthtarr I have been trying to figure out a way to remove the node names from which there is no linkage in the graph after setting a cutoff range. When I set a higher cutoff range than an initial range, the node names that don't have a linkage anymore still show up in the graph, making it less readable. I thought this could be a quick fix.
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.
Thank you for the great work, garthtarr and timelyportfolio!
I think it may be worth adding an order argument for the nodes. I think it will be a fairly common use case when one will have a lot of groups/classes in their data. Although they can colour these, but even if we have 5 groups of a thousand observations, it becomes difficult to spot patterns in the data.
Adding an order argument will be able to show if certain groups have intra/inter-groups linkage.
Hi,
I am wondering if I can use lines with arrows between connections, since there are many connections within my plot and it unable to distinguish them, many thanks !
Dear author,
When using a small matrix (2x2) the package displays the vertex but not the node.
Also, using a big matrix that only contains a a single correlation (aka, 9x9 filled with 0s with a single value) produces the same result (all the nodes but the link it is not displayed).
How I can overcome this situation?
From an email:
I am trying to assign colors to the edges, using groups and an igraph object; I am being able to make the assignments using the color names, but not with codes in hexadecimal. Is there any possible solution for this?
Probably should add in functionality to identify 2 way imports in a similar manner to this stackoverflow question. This is necessary because the link lines overlap so currently you can only tell if there's a two way interaction or just a one way import by checking if the link colour is the same as the colour of the highlighted node. If they are the same, then it is a one way import.
@timelyportfolio thanks for the great updates, I've made a couple of changes to ensure that the original examples still work.
I've hit an issue with the json object example where the sizes are specified:
library(edgebundleR)
filepath = system.file("sampleData", "flare-imports.json", package = "edgebundleR")
edgebundle(filepath,width=800,fontsize=8,tension=0.95)
I think a good fix will be to specify the maximum size that an vertex dot can be and rescale the sizes relative to the maximum size.
My javascript is terrible, I could probably work it out given enough time, but maybe you're able to quickly implement a simple fix. My suggested pseudo javascript code is below.
It assumes that the maxsize variable has been passed in through the xin object. My main issue is finding the maximum over a JSON array in javascript (don't mock me, I'm not JSON/javascript native!)
var maxval = Math.max(nodes_g.size)
nodes_g.append("circle")
.attr("cx", 0)
.attr("cy", 0)
.attr("fill", function(d,i){
if(d.color) return d.color;
return null;
})
.attr("opacity", 1.0)
.attr("r", function(d,i){
var size = (d.size) ? d.size : 10;
return Math.round(Math.pow(size / maxval * xin.maxsize, 1/2));
});
Hi.
I am able to create circle plots in R console, but for some unknown reason, I am not able to present the circle plot in my Rshiny app. I even tried to reproduce the "shinyedge" function in my app, but the plot does not show up. The app does not through any error, it just does not show the plot.
here is a piece of my code:
UI side:
tabPanel(title="CirclePlot",value="CP",
fluidRow(
column(3,
sliderInput("tension", "Tension", 0.3,min=0,max=1,step = 0.01),
sliderInput("fontsize","Font size",12,min=6,max=24),
sliderInput("width","Width and height",600,min=200,max=1200),
sliderInput("padding","Padding",100,min=0,max=300),
downloadButton("export",label="Download")),
column(9,
uiOutput("circplot")
)))
Server:
output$circplot <- renderUI({
edgebundleOutput("eb", width = input$width, height=input$width)
})
output$eb <- renderEdgebundle({
edgebundle(values$spp,tension=input$tension,cutoff=input$cutoff,
fontsize=input$fontsize,padding=input$padding)
})
Thanks for the great work! Is there any way to add legend/title to the output?
Specifically I'm looking for adding legend based on color of the node and title in a Shiny app.
It's time-consuming at my first use of edgebundleR. Because it has numorous reference packages and my program had to spend almost 20 mins to download all of the dependences. May I ask are all of the packages you referred to in the library necessary? It will be more than perfect If you could kindly exclude the redundant ones.
Hi!
Thank you very much for this amazing package.
However, I noticed that it is not compatible with flexdashboard (to build up serverless dashboards as R markdown).
I tried multiple approaches (this one included without success. The edgebundleR is included in the output (inspecting the html code), but the it is not rendered like other htmlwidgets (such as the ones of echarts and networkD3).
Hi -
Thanks for making this package! I was trying to tinker with seeing how I could get the ID of the variable selected. Specifically, when you click on a highlighted arc, can we return the underlying data?
Thanks,
Jon
Hi, it's a wonderful works, just as needed!
I believe would be useful to get and set the selected node by code, as well as setting another events like click to interact with the graph.
1.Based on all the articles on edgebundleR, I am yet to find out a way on how to change the color of links based on whether the link is incoming or outgoing. Any help with this would be great. I am looking for something like https://bl.ocks.org/mbostock/7607999
2.Is changing the width of the links possible based on a weight parameter?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.