agordon / d3export_demo Goto Github PK
View Code? Open in Web Editor NEWExport d3js graphics to PDF/PNG/SVG
Home Page: http://d3export.housegordon.org/
Export d3js graphics to PDF/PNG/SVG
Home Page: http://d3export.housegordon.org/
I tried to run the code on XAMPP and exporting as a svg works perfectly. But when I try to export as a pdf or png this error is thrown
"rsvg-convert -o '\xampp\tmp\d3export.out.c9sWxKK' -z '10' -f 'png' '\xampp\tmp\d3export.svg.sxxMJEX'" unexpectedly returned exit value 1 at (eval 79) line 13.
at C:/xampp/htdocs/d3e/download.pl line 81
I am trying to use your application locally and it doesn't work.
When I copy relevant pieces into my app, I get
Not Found
The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.
One trouble with the XML serialization you are doing here is that CSS defined styles are lost. This is a problem I'm working on here: https://github.com/Hypercubed/svgsaver . If you include svgsaver in this project it might be as simple as replacing this line: https://github.com/agordon/d3export_demo/blob/master/index.html#L174 with svgsaver.getHTML(svg)
.
You might also eliminate the need for a server for downloading SVG and PNG (with some caveats)
This is a great tool! However, I'm trying to recreate this in an MVC environment and I'm getting:
HTTP Error 405.0 - Method Not Allowed
The page you are looking for cannot be displayed because an invalid method (HTTP verb) is being used.
This seems to be happen when the hidden svgform is being submitted. Any ideas how to get this to work in IIS?
EDIT: I see it's a Perl file. Am I only able to use this demo on an Apache server?
I am currently running my website on heroku with node.js
Do you have any idea how I could make this run on their platform?
the html:
<embed src="svg/moMegye.svg" id="svgmap" width="100%" height="100%" wmode="transparent" type="image/svg+xml">
the javascript:
function submit_download_form(output_format)
{
var tmp = document.getElementById("mainmap");
var svg = tmp.getElementsByTagName("[??????]")[0];
var svg_xml = (new XMLSerializer).serializeToString(svg);
var form = document.getElementById("svgform");
form['output_format'].value = output_format;
form['data'].value = svg_xml ;
form.submit();
}
$(document).ready(function() {
$("#save_as_png").click(function() { submit_download_form("png"); });
});
result on download.pl
Missing 'data' parameter at ***********/download.pl line 48.
Hi,
I am using d3.js ver 3.4. I am trying to export svg to pdf.
Your demo looks excellent. But it does not work with d3.js svg chart. (Java script)
As the project have been inactive for past 4 years, would you recommend another library for doing that same task ? Any info ? Please write it in your readme so netizens landing on your project (still highly visible) can smoothly be redirected with the best lib of 2017~2018.
It would help the community to use the best tools ๐
Hello,
I'm a very beginner in d3js. I'm using it to create nice diagrams but not for the web. I'm using your code to export them in high resolution for large printing.
Everything working well excepting that the svg file cannot be read by inkscape.
Is it a known limitation ? are you working on ?
Anyway, you've done a nice job !
hi,
please help me to fix the following error,
Server error!
The server encountered an internal error and was unable to complete your request.
Error message:
couldn't create child process: 720002: download.pl
Hi,
When forked the source, the 3 buttons to download head me to download.pl and only displays the content of download.pl fine instead of actually downloading it,
What am i needing to change to make it work?
Thnks ahead
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.