jacomyal / sigma.js

A JavaScript library aimed at visualizing graphs of thousands of nodes and edges
https://www.sigmajs.org/
MIT License
11.3k stars 1.59k forks source link

Callback without sigma parser #893

Closed StevenElsworth closed 3 years ago

StevenElsworth commented 7 years ago

Is it possible to apply a callback function when not using a parser to read from .json or .gexf file?

StevenElsworth commented 7 years ago

Believe I managed to do what I need by modifying the sigma.js code.

AVermeij commented 7 years ago

If I understand correctly, your aim is to read a GEXF or JSON without using sigma's parser plugins for these file types? Using HTML5's FileReader API, it is pretty straightforward to read a file and work with its contents after loading has succeeded.

StevenElsworth commented 7 years ago

No sorry, I did not make myself very clear. I wanted to use a callback function when making a graph directly in javascript rather than importing a .json or .gexf file.

AVermeij commented 7 years ago

Alright - you could simply create a function which fills a graph object with nodes and edges (in whichever way you want to do it), which then initializes sigma using that graph when the object has been populated?

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Yomguithereal commented 3 years ago

I think this issue is not relevant anymore with v2 and graphology. As such I will close it. But feel free to reopen one if you have the same issues with the new implementations.