cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1659
Views
0
Helpful
3
Replies

Export topology

achelminski
Level 1
Level 1

Hi,

Is there a way to export the generated topology in a SVG file or other ?

I'd like to import it in a drawing software like Visio.

Thanks !

Alexandre

3 Replies 3

lindsayg
Level 1
Level 1

There is an exportPNG function. Needs a little work, but does work.

But a PNG is not something you can easily import into Visio. Good idea, I'm not sure how Visio handles importing of SVG. It might just come in as a single graphic, which is pointless.

achelminski
Level 1
Level 1

Hi @lindsayg ,

Do you have some code example using this function to share ?

Thanks !

lindsayg
Level 1
Level 1

Add this under next.js

 

            exportPNG: function() {
                // Declare topo to fix function
                var topo = this;

 

Then just call topology.exportPNG()

---------------------------------------------

To do that you add this function under app.js

 

triggerTopologyDownload = function () {
     topology.exportPNG();
};

 

 Then under index.html add something like this:

 

<button title="Download Topology Image" onClick="triggerTopologyDownload();">Download PNG</button>

 

 

The output is a little different to the actual graph view, as that exportPNG() function, changes some of the styling. But you can adjust it.