gephi / gephi-plugins

Repository for Gephi Plugins maintained by the team. Each plugin has it's branch.
270 stars 620 forks source link

Not very sure what I need #185

Closed xinstein closed 6 years ago

xinstein commented 6 years ago

I want to write a custom db connection which connects to third party graph database, I want to be able to edit query inside gephi and transform the return data into a gephi graph and play with it in gephi.

I'm not sure if I need to write a gephi plugin, or which kind of gephi plugin I need?

eduramiba commented 6 years ago

Hi, depending on the kind of database you might use a standard database connection gephi plugin or you would need a custom one.

Check for example the Oracle plugin https://github.com/gephi/gephi-plugins/tree/master-forge/modules/OracleDriver

Or the core plugins: https://github.com/gephi/gephi/tree/master/modules/DBDrivers/src/main/java/org/gephi/io/database/drivers

xinstein commented 6 years ago

Thanks very much for your reply.

The examples you provided are all relational db connectors, I am using a graph db (dgraph) to store graph, I usually query a subgraph (in dgraph's own graphql language) and want to visualize the resulting subgraph. the return format of dgraph's query engine is some sort of json represented graph.

What in this case do I need to do?

eduramiba commented 6 years ago

Oh, then I think you should create a Wizard importer (similar to a File importer), with a custom UI and then have your plugin do whatever custom logic it needs to fill the import container data.

Once implemented, it will appear in the "File - Import..." menu as an available importer.

This is an old guide on how to do it: https://github.com/gephi/gephi/wiki/Spigot-importer-with-Wizard so you can start. It is a bit outdated but should get you started. For example, to setup dependencies it's now different, all done in pom.xml, just follow the existing plugins code here: https://github.com/gephi/gephi-plugins/tree/master-forge

The SPIs to implement are:

Also you could just create a plugin with any custom UI panel you need and have it load data into the graph in any needed way but that's probably more difficult and unnecessary.

xinstein commented 6 years ago

Thank you~ the spigot tutorial didn't mention which category I should choose: Layout, Export, Import, Data Laboratory, Filter, Generator, Metric, Preview, Tool, Appearance, Clustering, Other Category

which one do you suggest?

eduramiba commented 6 years ago

Hi, You can choose any category text you want for the wizard UI, and for the plugin, you should use Importer for example.

xinstein commented 6 years ago

Thank you for all the help, I'll try the tutorial~