Draw.io – How to Iframe Embed a Diagram into Another Site

draw.io

I'm having trouble embedding a draw.io diagram into another webpage. I'm not sure I know the correct steps, but here's what I've tried.

  1. Create new folder in google drive
  2. Go to Share->Advanced and enable Anyone on the internet can find and view (Public on the web)
  3. Create new diagram in folder (inheriting permissions), and save.
  4. In drive, go back to sharesettings and copy the link to share
  5. In draw.io, go to File->Embed->IFrame and paste the url
  6. Copy the output from "Paste this into the page"
  7. Add that iframe markup to my site

Instead of getting an embedding diagram, the iframe loads an error message:

Error loading file

Cannot open file

What am I missing? My page is currently a local development page @ localhost, I can't imagine that's an issue though.

In case its of any use, here's the public url I pasted:
https://drive.google.com/folderview?id=0B9uwt2HwBYZDdjMyMWs2SUdFV00&usp=sharing

and here's the iframe result from the embed menu (that fails)

<iframe frameborder="0" style="width:100%;height:516px" src="https://www.draw.io/?chrome=0&gapi=0&db=0&url=https%3A%2F%2Fdrive.google.com%2Ffolderview%3Fid%3D0B9uwt2HwBYZDdjMyMWs2SUdFV00%26amp%3Busp%3Dsharing"></iframe>

Best Answer

The links that Google provide to publicly visible files aren't actually the raw file, they are a link to a Google page that has an indirection to that file.

In order to get the raw file the file must be placed in a publicly visible folder, being public on its own isn't enough.

Next, Google decided to remove your ability to get the raw URL of the file in the new Drive UI. You need to click on the cog top right and select "Leave the new Drive". In the old Drive UI select the file, then the "Details" panel on the right:

The details tab in Google Drive

You'll then get the raw URL under "HOSTING":

Raw hosting URL in Google Drive

That's the URL to paste into "Public URL of the diagram"

Obviously, Google seem to be wanting to remove public file raw URLs, we are thinking about an alternative to this when they remove the old Drive UI completely.