question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Problem with neighborhoods plugin and loading graph

See original GitHub issue

Hello, I have problem with loading my graph exported to json from gephi into neighborhoods plugin. Arctic.json example works fine but when i change file at db.load line i get blank canvas without an errors in console. I can’t figure out what is wrong with my file, when i use parser it works fine. xtest2.zip I have another problem … how to iterate on edges, nodes using event listeners ? In old version of sigma there was code that allowed to hover all neighbours of node when mouse point(iterEdges,e.content) , but now these methods were removed 😦

`var g = {
nodes: [],
edges: []
};
var s = new sigma({

  graph: g,
  renderer: {
    container: document.getElementById('graph-container'),
    type: 'canvas'
  },
  settings: {
    doubleClickEnabled: false,
    enableEdgeHovering: true,
    edgeHoverColor: 'edge',
    defaultEdgeHoverColor: '#000',
    edgeHoverSizeRatio: 1,
    edgeHoverExtremities: true,
  }
});
sigma.parsers.json('data/xdtest2.json', 
  s,
  function() {
    s.refresh();
  }
);

I tried s.g.edges.length s.graph.edges.length but i dont know where nodes and edges are stored. Last problem i encountered is when i tried use sigma.plugins.relativeSize(s,1); after parser, the graph had not changed … Thank you.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:12

github_iconTop GitHub Comments

2reactions
dijana-sagitcommented, Sep 17, 2016

Hello Everyone, this worked for me:

sigma.classes.graph.addMethod('neighbors', function(nodeId) {
        var i,
            neighbors = {},
            index = this.allNeighborsIndex.get(nodeId).keyList() || {};
            for (i = 0; i < index.length; i++) {
                neighbors[index[i]] = this.nodesIndex.get(index[i]);
            }
        return neighbors;
});
1reaction
conker84commented, Mar 13, 2016

Hi for the neighbours problem use this function:

sigma.classes.graph.addMethod('neighbors', function(nodeId) {
    var k,
        neighbors = {},
        index = this.allNeighborsIndex[nodeId] || {};

    for (k in index) {
        neighbors[k] = this.nodesIndex[k];
    }
    return neighbors;
});
Read more comments on GitHub >

github_iconTop Results From Across the Web

Slow loading - WordPress.org
This issue arises as soon as I try to add 5 or more charts to a page. The other plugins defer js and...
Read more >
How to Install & Fix Graphics on Windows 10 for The Sims 2
Sul sul! In today's video I'll show you guys how to install and fix The Sims 2 on your Windows 10 device, so...
Read more >
heur_gins.h File Reference - SCIP Doxygen Documentation
LNS heuristic that tries to delimit the search region to a neighborhood in the constraint graph. Author: Gregor Hendel. Graph Induced Neighborhood Search ......
Read more >
11 Best WordPress Map Plugin Options in 2022 (Free ... - Kinsta
Find the perfect WordPress map plugin for your next navigation, ... to produce slow-loading maps and potential problems with your pages.
Read more >
Exploring Relations in a Diagram - yWorks
Connected items in a diagram can either be highlighted or displayed in a separate filtered view to quickly identify the neighborhood of an...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found