laingsimon / render-diagram Goto Github PK
View Code? Open in Web Editor NEWRender draw.io diagrams from a URL or embedded into a webpage
Home Page: https://laingsimon.github.io/render-diagram
License: Apache License 2.0
Render draw.io diagrams from a URL or embedded into a webpage
Home Page: https://laingsimon.github.io/render-diagram
License: Apache License 2.0
Content should flow better headings should be
div.setAttribute("data-mxgraph", JSON.stringify({
highlight: "none",
target: "self",
lightbox: false,
nav: true,
xml: "<mxfile version=\"10.6.5\"><diagram>" + diagramData + "</diagram></mxfile>"
}));
Support modifying the above via a data attribute
highlight
: colour of link highlighttarget
: where to open linkslightbox
: whether lightbox is enablednav
: whether links are enabledxml
: diagram data (shouldn't be modifiable)toolbar
: toolbar features (pages, layers, zoom, etc.)Draw.io offloads PDF rendering to a webservice, https://exp-pdf.draw.io/ImageExport4/export, it may be possible to re-use this - or identify how it works to achieve the same result in-house.
http://localhost:8080/?url=https://laingsimon.github.io/render-diagram/Sample%20file.xml&format=png
actual | expected |
---|---|
![]() |
![]() |
POST https://exp-pdf.draw.io/ImageExport4/export HTTP/1.1
Host: exp-pdf.draw.io
Content-Type: application/x-www-form-urlencoded
format=png&allPages=1&bg=none&base64=0&embedXml=0&xml=<url encoded file content>
This method works for PDF & PNG exports, but doesn't support SVG
Error appears with message:
Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.
This is from a URL file which contains a <mxfile>
element, maybe the data (element content) needs to be extracted from the response and passed along?
The samples contain a file which is returned in this format and works without issue, it could be a deflate/inflate versioning issue?
I.e. to maintain drawing as a file, and easily maintainable
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.