microsoft / automatic-graph-layout

A set of tools for graph layout and viewing
Other
1.35k stars 302 forks source link

[question] How can I use it with GtkSharp #287

Closed michaelkruglos closed 3 years ago

michaelkruglos commented 3 years ago

How can I use MSAGL library with GtkSharp?

levnach commented 3 years ago

I think nobody tried it. There is an effort of porting MSAGL to JavaScript at https://github.com/msaglJS/msagl-js. I hope the JavaScript version will be more portable.

michaelkruglos commented 3 years ago

Is there example of creating a layout independent of rendering subsystem? I'm not sure I can find it.

levnach commented 3 years ago

Have a look, for example, at GraphLayout\Samples\DrawingFromGeometryGraphSample\DrawingFromGeometryGraphSample.csproj. Function DrawingFromGeometryGraphSample.CreateAndLayoutGraph does this job. A simpler example is GraphLayout\Samples\UsingMDSLayoutSample\UsingMDSLayoutSample.csproj.

michaelkruglos commented 3 years ago

Thanks. Those were helpful.

levnach commented 3 years ago

Have you succeeded to use Msagl with GtkSharp?

michaelkruglos commented 3 years ago

Yes. I took the code from CommonDrawingUtilsForSamples and modified it to work with GtkSharp and CairoSharp (drawing library). Some routing methods didn't work very well. I tested it on Windows in the mean time, and I'll try to build/run it on Linux as well. When I have more time, I may want to contribute a GtkSharp sample to this repository.

levnach commented 3 years ago

Can you leave some instructions of how you integrated MSAGL with GtkSharp? It is especially interesting for Linux.

michaelkruglos commented 3 years ago

I added a pull request #289