Converting GraphViz/Dot to Powerpoint Graph - 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?

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.

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.

You can achieve this by using LibreOffice. I've tested the process with LibreOffice 7.0.4.2.
Export your graph as SVG in Graphviz (-Tsvg).
Create a presentation in LibreOffice: File → New → Presentation
Delete the elements in the slide (title & body boxes).
Import the SVG file: Insert → Image
Once the image is inserted, select it by left-clicking on it.
Open the context menu by right-clicking on the image and choose Break.
Save the presentation as .pptx: File → Save As... → Choose the file type .pptx in the dialog.
Open the .pptx in PowerPoint.
Select all the image components and copy them to your actual presentation.
Edit the image.
(Of course, you can do 9. and 10. in reverse order.)

Related

Convert hex code from TIFF to readable format

I am trying to read in the JPEG table from a TIFF file to locate sub-images in the TIFF file. (This is coming from a whole slide image svs file and I am trying to delete the label and macro image.) The JPEG table is hex encoded and I can't figure out to turn it to readable information to locate the sub-images.
I have tried unpacking the values. I don't want to save the file and open in Linux. I want to do this from within a jupyter notebook. I've tried for a while using "unpack" from IO core tools which didn't work. I also briefly tried BeautifulSoup, but it tells me that there is an invalid start byte. Here's the first line I am trying to decode:
b'\xff\xd8\xff\xdb\x00C\x00'
This line should return something like "JPEG image file..." I think if I can translate this line I can do the rest of this JPEG table.
Used a python TIFF package to help find the pages of the TIFF file I was looking for.

Why does R raster::writeRaster() generate a pic which can't be shown in Win10?

I read my hyperspectral (.raw) file and combine three bands to "gai_out_r" Then I output as following:
writeRaster(gai_out_r,filepath,format="GTiff")
finally I got gai_out_r.tif
But, why Win10 can't display this small tif as the pic that I output the same way from envi--save image as--tif
Two tiffs are displayed by Win10 as following:
Default windows image viewing applications doesn't support Hyperspectral Images-since you are just reading and combining 3 bands from your .raw file, the resulting image will be a hyperspectral image.You need to have separate dedicated softwares to view hypercubes or can view it using spectral-python also.
In sPy, using envi.save_image , will save it as a ENVI type file only. To save it as an rgb image file(readable in windows OS) we need to use other methods.
You are using writeRaster to write to a GTiff (GeoTiff) format file. To write to a standard tif file you can use the tiff method. With writeRaster you could also write to a PNG instead
writeRaster(gai_out_r, "gai.png")
Cause of the issue:
I had a similar issue and recognised that the exported .tif files had a different bit depth than .tif images I could open. The images could not be displayed using common applications, although they were not broken and I could open them in R or QGIS. Hence, the values were coded in a way Windows would not expect.
When you type ?writeRaster() you will find that there are various options when it comes to saving a .tif (or other format) using the raster::writeRaster() function. Click on the links therein to get to the dataType {raster} help site and you'll find there are various integer types to choose from.
Solution (write a Windows-readable GeoTIFF):
I set the following options to make the resulting .tif file readable (note the datatype option):
writeRaster(raster, filename = "/path/to/your/output.tif",
format = "GTiff", datatype = "INT1U")
Note:
I realised your post is from 2 and a half years ago... Anyways, may this answer help others who encounter this problem.

How i can create a .ppt file from as3?

How i can create a .ppt file from as3? i need to add one image to powerpoint and save the .ppt file on a button click. Is there any as3 library available for saving files as ppt?
Any help would be immensely appreciated.
Thanks in advance..
I write VBA code in Microsoft Office PowerPoint for you. You can achieve to your goal with this code.
You must create a text file with name "Info.txt" in following order when you want to create a PowerPoint presentation (path of the text file must be in where you have placed my attached "InsertPicture-Office 2007.pptm" and "InsertPicture-Office 2010 & 2013.pptm" files):
Line 1. Distance of the image from Left of the slide
Line 2. Distance of the image from Top of the slide
Line 3. Image Width in the slide
Line 4. Image Height in the slide
Line 5. Full path and name (with extension [.pptx]) for saving PowerPoint presentation file
Line 6. Full path and name (with extension) of an image for inserting in the slide of the PowerPoint presentation
After save the text file, you only must run the "InsertPicture-Office 2007.pptm" or "InsertPicture-Office 2010 & 2013.pptm" file and everything will be done.
Remember that you must "Enable all macros" for Microsoft Office PowerPoint from following way:
Open Microsoft Office Powerpoint -> File -> Options -> Trust Center -> Trust Center Settings -> Macro Settings -> Enable all macros ...
4Shared -> InsertPicture-Office 2007.pptm, InsertPicture-Office 2010 & 2013.pptm and Info.txt files
SendSpace -> InsertPicture-Office 2007.pptm, InsertPicture-Office 2010 & 2013.pptm and Info.txt files
You can test it only with change "Info.txt" file in order of what I'm mentioned above, and opening one of the "InsertPicture-Office 2007.pptm" or "InsertPicture-Office 2010 & 2013.pptm" files according to installed version of the Microsoft Office PowerPoint in your system.

embedding a R animated 3D plot in PowerPoint

The rgl R package allows to plot interactive 3D figures and to save these figures in a html document (with the writeWebGL() function).
I would like to put such an interactive 3D figure in a PowerPoint presentation. Is it possible ?
EDIT: After studying Dieter Menne's answer with the help of Google, my conclusions are the following ones:
Currently Luke Tierney's method to convert a 3D graphic to an U3D file and/or an Asymptote file only works for graphics created with the misc3d package, not the rgl package.
The export of 3D rgl graphics to VRML/X3D files has been announced as a future plan. Perhaps this would allow to embed a 3D rgl graphic into a Powerpoint and/or LaTeX presentation.
EDIT : related discussion
It is possible if you transfer the Powerpoint presentation (or, even more R-ish, use beamer/latex), and embed the 3D-plot as described in Luke Tierney's article
http://homepage.stat.uiowa.edu/~luke/R/misc3d/misc3d-pdf/misc3d-pdf.pdf
If you put this in to an HTML document, you can probably use the IWebBrowser2 object to open the HTML inside a Slide. I am not sure how a 3d graphic would render, and I'mnot familiar with R or would not be able to offer any further advice, but you might start by trying to simply create a WebBrowser object inside your slide, and then tell it to Navigate to the HTML file.
Sub InsertHTMLFrame()
Dim sld as Slide
Dim shp as Shape
Dim wb as Object
Set sld = ActivePresentation.Slides(1) '## Modify as needed
'## Create the shape container, you will need to modify the L/T/W/H to fit your document
Set shp = sld.Shapes.AddOLEObject(100, 200, 200, 150, _
"Shell.Explorer.2")
shp.Name = "3dgraphic"
Set wb = shp.OLEFormat.Object
wb.Navigate "C:\Users\you\Desktop\exported3dgraphic.html"
End Sub
Controlling this flow during SlideShow mode may be a little trickier, but it's doable, provided the graphic renders properly through IE like this.
How to Install This Macro
Open your PowerPoint Presentation, and click Alt+F11 to bring up the Visual Basic project.
Right-click the project in the left pane, and Insert Module:
Paste the code from my answer in to this module.
In the line that says wb.Navigate "C:\..." modify this to the correct file path for your HTML file. This can be on your computer or in a shared network folder, etc.
The browser should be able to display HTML pages when in SlideShow mode, but will not render them in the normal or preview mode.

Extracting path data from an SVG map to use in RaphaelJs

I'm trying to build an an interactive map using RaphaelJS (e.g. http://raphaeljs.com/australia.html). Please check the source. It requires map path data to input. There is no clear explanation anywhere about how to obtain this information, other than the fact that illustrator or inkscape are capable of doing it.
I'm looking to obtain "States" path data from this India map: http://en.wikipedia.org/wiki/File:India-locator-map-blank.svg
well, this one is easy. SVG is just a simple XML file. So you don't have to "extract" anything via Illustrator.
Just open the SVG in any text editor and it's all there! (the path data string you can use with RaphaelJS path-function is held in the d-attribute of the path nodes).
Watch our for copyright issues when using SVG files of others ;)
Skunks
You could also use a converter like Ready.Set.Raphael to extract the paths for you and create the javascript output. It's a real time saver!
For older SVG files the path data will need to be optimized for RaphaelJS. Open the file in Inkspace and save as Optimized AVG. If you have an AVG file that opens as a blank image in Adobe Illustrator, edit the file with a text editor and set the first two values of the viewBox to 0,0. Both steps may be required when working with map AVG files from Wikipedia.

Resources