Comments (7)
Interesting idea... Currently centrality is used only by Amazon products visualization to sort products by betweenness centrality. I call it "Diversity" there, because I could not come up with a better name.
Here is how you can calculate centralities of a graph:
// Let's say you have graph = Viva.Graph.graph();
var calculator = Viva.Graph.centrality();
var betweenness = calculator.betweennessCentrality(graph);
// betweenness is an array of objects {key: , value: }, where key is a node id
// in the graph and value is actual betweenness centrality value for this node.
// The array is sorted in descending order of betweenness centrality.
var degree = calculator.degreeCentrality(graph);
// degree will be an array of the same structure as betweenness, but
// value represents degree centrality of the node.
Can you please elaborate on how do you want to place nodes more centrally according to centrality?
from vivagraphjs.
Thanks — I'd worked out how to actually get the array from Viva.Graph.centrality(), but I can't see how to make the renderer do anything with that information. Basically, what we're trying to do is have a force-directed graph where nodes with a higher centrality gravitate towards the centre, and nodes with a lower centrality are pushed towards the outer regions — all subject to the effects of their connections, of course.
It looks like that's what you're doing with Amazon, but I can't quite work out how :)
from vivagraphjs.
@TinyClanger I'm dealing exactly the same problem, if you have come up with any solution, please let me know. It would be great helpful. By the way, I'm working on visualizing a person's social network online.
from vivagraphjs.
Amazon visualization does not use centrality information for rendering. It pins the root node to prevent the entire graph from flying away. Here is a demo: How to pin node in vivagraph. Force-based layout also uses number of edges to determine a weight of each node. So the more connection a node has the higher is its mass.
from vivagraphjs.
Hello! I've looked at example, I was not aware of possibility of pinning a node.
I created an example using force-directed layout; when I add and update neighbors to a node, the new ones appears in the center of the canvas rather than around the parent node. This cause the whole cluster to be pulled towards the center, and with highly densed networks, the center of the canvas because pretty soon over-crowded.
Which is the part that calculate the positions of the new nodes respect to a parent?
As effect I would like the neighbors to pop up around the parent.
from vivagraphjs.
Hey Andrei,
I've been trying the centrality functions, calling it after adding links, but it returns empty arrays both for degree and betweenness centrality. What might be wrong here?
from vivagraphjs.
Hi @arikan do you have a code sample?
from vivagraphjs.
Related Issues (20)
- Feedback
- how many nodes can this graph support
- Feedback - WebAssembly
- Cannot render graph HOT 2
- Documentation?
- Bug with links
- Go to the link by clicking on the node. HOT 1
- Adding text label functionality HOT 4
- render images on nodes instead of squares
- ngraph dependencies and other dependencies versions
- Messaging between nodes' position to optimise layout
- Request to be added to the list of examples
- how to make hyperlink <a href > from node
- How to fix nodes coordinates
- when you click on an object it jumps
- Performance is not good!
- change image in webgl graph node
- Extend Options to add Custom Force-Directed Layouts
- Node icon images turn to green when nodes number exceed 15,000.
- Custom nodes get stacked on top of each other HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vivagraphjs.