greedybuddha
greedybuddha

Reputation: 7507

Converting GraphViz/Dot to Powerpoint Graph

I'm trying to get from a GraphViz graph to a graph in Powerpoint. But, when it's inside of Powerpoint I would like to be able to edit the individual nodes, edges, boundaries. This means exporting the GraphViz as an image file won't work.

Does anyone know any path to get from GraphViz to Powerpoint?

Upvotes: 5

Views: 2072

Answers (3)

haba713
haba713

Reputation: 2687

You can achieve this by using LibreOffice. I've tested the process with LibreOffice 7.0.4.2.

  1. Export your graph as SVG in Graphviz (-Tsvg).
  2. Create a presentation in LibreOffice: File → New → Presentation
  3. Delete the elements in the slide (title & body boxes).
  4. Import the SVG file: Insert → Image
  5. Once the image is inserted, select it by left-clicking on it.
  6. Open the context menu by right-clicking on the image and choose Break.
  7. Save the presentation as .pptx: File → Save As... → Choose the file type .pptx in the dialog.
  8. Open the .pptx in PowerPoint.
  9. Select all the image components and copy them to your actual presentation.
  10. Edit the image.

(Of course, you can do 9. and 10. in reverse order.)

Upvotes: 1

Anthony Hayward
Anthony Hayward

Reputation: 2352

You can generate .emf (Enhanced Metafile) images from .dot files using GraphViz on Windows. You can import the .emf file into your PowerPoint presentation and then ungroup it (several times) to break it down into the individual shapes.

This is good, but unfortunately the edges of your graph do not get turned into connectors. Instead, they are pictures of lines, so they don't reroute when you move any of the nodes of your graph around.

Upvotes: 3

TomServo
TomServo

Reputation: 7409

If you know the XML structure of a .PPTX file, you could export your GraphViz graph as an SVG -- which is in reality a text format -- then parse it and emit the XML needed to create the .PPTX file. A difficult method though, I know.

Like all of the Microsoft "open document" formats, the .PPTX is really just a ZIP file that contains many elements, the XML describing the graph being one of them.

Upvotes: 2

Related Questions